Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'akpm' (patches from Andrew)

Merge yet more updates from Andrew Morton:
"This is everything else from -mm for this merge window.

90 patches.

Subsystems affected by this patch series: mm (cleanups and slub),
alpha, procfs, sysctl, misc, core-kernel, bitmap, lib, compat,
checkpatch, epoll, isofs, nilfs2, hpfs, exit, fork, kexec, gcov,
panic, delayacct, gdb, resource, selftests, async, initramfs, ipc,
drivers/char, and spelling"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (90 commits)
mm: fix typos in comments
mm: fix typos in comments
treewide: remove editor modelines and cruft
ipc/sem.c: spelling fix
fs: fat: fix spelling typo of values
kernel/sys.c: fix typo
kernel/up.c: fix typo
kernel/user_namespace.c: fix typos
kernel/umh.c: fix some spelling mistakes
include/linux/pgtable.h: few spelling fixes
mm/slab.c: fix spelling mistake "disired" -> "desired"
scripts/spelling.txt: add "overflw"
scripts/spelling.txt: Add "diabled" typo
scripts/spelling.txt: add "overlfow"
arm: print alloc free paths for address in registers
mm/vmalloc: remove vwrite()
mm: remove xlate_dev_kmem_ptr()
drivers/char: remove /dev/kmem for good
mm: fix some typos and code style problems
ipc/sem.c: mundane typo fixes
...

+1323 -2093
+1 -1
Documentation/admin-guide/devices.txt
··· 4 4 5 5 1 char Memory devices 6 6 1 = /dev/mem Physical memory access 7 - 2 = /dev/kmem Kernel virtual memory access 7 + 2 = /dev/kmem OBSOLETE - replaced by /proc/kcore 8 8 3 = /dev/null Null device 9 9 4 = /dev/port I/O port access 10 10 5 = /dev/zero Null byte source
+12
Documentation/admin-guide/kernel-parameters.txt
··· 1835 1835 initcall functions. Useful for debugging built-in 1836 1836 modules and initcalls. 1837 1837 1838 + initramfs_async= [KNL] 1839 + Format: <bool> 1840 + Default: 1 1841 + This parameter controls whether the initramfs 1842 + image is unpacked asynchronously, concurrently 1843 + with devices being probed and 1844 + initialized. This should normally just work, 1845 + but as a debugging aid, one can get the 1846 + historical behaviour of the initramfs 1847 + unpacking being completed before device_ and 1848 + late_ initcalls. 1849 + 1838 1850 initrd= [BOOT] Specify the location of the initial ramdisk 1839 1851 1840 1852 initrdmem= [KNL] Specify a physical address and size from which to
+1 -1
Documentation/dev-tools/gdb-kernel-debugging.rst
··· 114 114 [ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved 115 115 .... 116 116 117 - - Examine fields of the current task struct:: 117 + - Examine fields of the current task struct(supported by x86 and arm64 only):: 118 118 119 119 (gdb) p $lx_current().pid 120 120 $1 = 4998
+16
MAINTAINERS
··· 3207 3207 F: fs/bfs/ 3208 3208 F: include/uapi/linux/bfs_fs.h 3209 3209 3210 + BITMAP API 3211 + M: Yury Norov <yury.norov@gmail.com> 3212 + R: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 3213 + R: Rasmus Villemoes <linux@rasmusvillemoes.dk> 3214 + S: Maintained 3215 + F: include/asm-generic/bitops/find.h 3216 + F: include/linux/bitmap.h 3217 + F: lib/bitmap.c 3218 + F: lib/find_bit.c 3219 + F: lib/find_bit_benchmark.c 3220 + F: lib/test_bitmap.c 3221 + F: tools/include/asm-generic/bitops/find.h 3222 + F: tools/include/linux/bitmap.h 3223 + F: tools/lib/bitmap.c 3224 + F: tools/lib/find_bit.c 3225 + 3210 3226 BLINKM RGB LED DRIVER 3211 3227 M: Jan-Simon Moeller <jansimon.moeller@gmx.de> 3212 3228 S: Maintained
-5
arch/alpha/include/asm/io.h
··· 602 602 */ 603 603 #define xlate_dev_mem_ptr(p) __va(p) 604 604 605 - /* 606 - * Convert a virtual cached pointer to an uncached pointer 607 - */ 608 - #define xlate_dev_kmem_ptr(p) p 609 - 610 605 #endif /* __KERNEL__ */ 611 606 612 607 #endif /* __ALPHA_IO_H */
+2 -2
arch/alpha/kernel/pc873xx.c
··· 13 13 static unsigned int base, model; 14 14 15 15 16 - unsigned int __init pc873xx_get_base() 16 + unsigned int __init pc873xx_get_base(void) 17 17 { 18 18 return base; 19 19 } 20 20 21 - char *__init pc873xx_get_model() 21 + char *__init pc873xx_get_model(void) 22 22 { 23 23 return pc873xx_names[model]; 24 24 }
+1
arch/alpha/lib/csum_partial_copy.c
··· 13 13 #include <linux/types.h> 14 14 #include <linux/string.h> 15 15 #include <linux/uaccess.h> 16 + #include <net/checksum.h> 16 17 17 18 18 19 #define ldq_u(x,y) \
-1
arch/arm/configs/dove_defconfig
··· 63 63 # CONFIG_MOUSE_PS2 is not set 64 64 # CONFIG_SERIO is not set 65 65 CONFIG_LEGACY_PTY_COUNT=16 66 - # CONFIG_DEVKMEM is not set 67 66 CONFIG_SERIAL_8250=y 68 67 CONFIG_SERIAL_8250_CONSOLE=y 69 68 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
-1
arch/arm/configs/magician_defconfig
··· 72 72 CONFIG_INPUT_MISC=y 73 73 CONFIG_INPUT_UINPUT=m 74 74 # CONFIG_SERIO is not set 75 - # CONFIG_DEVKMEM is not set 76 75 CONFIG_SERIAL_PXA=y 77 76 # CONFIG_LEGACY_PTYS is not set 78 77 # CONFIG_HW_RANDOM is not set
-1
arch/arm/configs/moxart_defconfig
··· 79 79 # CONFIG_SERIO is not set 80 80 # CONFIG_VT is not set 81 81 # CONFIG_LEGACY_PTYS is not set 82 - # CONFIG_DEVKMEM is not set 83 82 CONFIG_SERIAL_8250=y 84 83 CONFIG_SERIAL_8250_CONSOLE=y 85 84 CONFIG_SERIAL_8250_NR_UARTS=1
-1
arch/arm/configs/mps2_defconfig
··· 69 69 # CONFIG_VT is not set 70 70 # CONFIG_LEGACY_PTYS is not set 71 71 CONFIG_SERIAL_NONSTANDARD=y 72 - # CONFIG_DEVKMEM is not set 73 72 CONFIG_SERIAL_MPS2_UART_CONSOLE=y 74 73 CONFIG_SERIAL_MPS2_UART=y 75 74 # CONFIG_HW_RANDOM is not set
-1
arch/arm/configs/mvebu_v5_defconfig
··· 100 100 CONFIG_KEYBOARD_GPIO=y 101 101 # CONFIG_INPUT_MOUSE is not set 102 102 CONFIG_LEGACY_PTY_COUNT=16 103 - # CONFIG_DEVKMEM is not set 104 103 CONFIG_SERIAL_8250=y 105 104 CONFIG_SERIAL_8250_CONSOLE=y 106 105 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
-1
arch/arm/configs/xcep_defconfig
··· 53 53 # CONFIG_INPUT_KEYBOARD is not set 54 54 # CONFIG_INPUT_MOUSE is not set 55 55 # CONFIG_SERIO is not set 56 - # CONFIG_DEVKMEM is not set 57 56 CONFIG_SERIAL_PXA=y 58 57 CONFIG_SERIAL_PXA_CONSOLE=y 59 58 # CONFIG_LEGACY_PTYS is not set
+1
arch/arm/include/asm/bug.h
··· 88 88 struct mm_struct; 89 89 void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr); 90 90 extern void __show_regs(struct pt_regs *); 91 + extern void __show_regs_alloc_free(struct pt_regs *regs); 91 92 92 93 #endif
-5
arch/arm/include/asm/io.h
··· 430 430 */ 431 431 #define xlate_dev_mem_ptr(p) __va(p) 432 432 433 - /* 434 - * Convert a virtual cached pointer to an uncached pointer 435 - */ 436 - #define xlate_dev_kmem_ptr(p) p 437 - 438 433 #include <asm-generic/io.h> 439 434 440 435 #ifdef CONFIG_MMU
+11
arch/arm/kernel/process.c
··· 92 92 ledtrig_cpu(CPU_LED_IDLE_END); 93 93 } 94 94 95 + void __show_regs_alloc_free(struct pt_regs *regs) 96 + { 97 + int i; 98 + 99 + /* check for r0 - r12 only */ 100 + for (i = 0; i < 13; i++) { 101 + pr_alert("Register r%d information:", i); 102 + mem_dump_obj((void *)regs->uregs[i]); 103 + } 104 + } 105 + 95 106 void __show_regs(struct pt_regs *regs) 96 107 { 97 108 unsigned long flags;
+1
arch/arm/kernel/traps.c
··· 287 287 288 288 print_modules(); 289 289 __show_regs(regs); 290 + __show_regs_alloc_free(regs); 290 291 pr_emerg("Process %.*s (pid: %d, stack limit = 0x%p)\n", 291 292 TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), end_of_stack(tsk)); 292 293
+4 -4
arch/h8300/include/asm/bitops.h
··· 9 9 10 10 #include <linux/compiler.h> 11 11 12 + #include <asm-generic/bitops/fls.h> 13 + #include <asm-generic/bitops/__fls.h> 14 + #include <asm-generic/bitops/fls64.h> 15 + 12 16 #ifdef __KERNEL__ 13 17 14 18 #ifndef _LINUX_BITOPS_H ··· 176 172 #include <asm-generic/bitops/ext2-atomic.h> 177 173 178 174 #endif /* __KERNEL__ */ 179 - 180 - #include <asm-generic/bitops/fls.h> 181 - #include <asm-generic/bitops/__fls.h> 182 - #include <asm-generic/bitops/fls64.h> 183 175 184 176 #endif /* _H8300_BITOPS_H */
-1
arch/hexagon/configs/comet_defconfig
··· 34 34 # CONFIG_SERIO is not set 35 35 # CONFIG_CONSOLE_TRANSLATIONS is not set 36 36 CONFIG_LEGACY_PTY_COUNT=64 37 - # CONFIG_DEVKMEM is not set 38 37 # CONFIG_HW_RANDOM is not set 39 38 CONFIG_SPI=y 40 39 CONFIG_SPI_DEBUG=y
-1
arch/hexagon/include/asm/io.h
··· 64 64 * convert a physical pointer to a virtual kernel pointer for 65 65 * /dev/mem access. 66 66 */ 67 - #define xlate_dev_kmem_ptr(p) __va(p) 68 67 #define xlate_dev_mem_ptr(p) __va(p) 69 68 70 69 /*
-1
arch/ia64/include/asm/io.h
··· 277 277 #define memcpy_fromio memcpy_fromio 278 278 #define memcpy_toio memcpy_toio 279 279 #define memset_io memset_io 280 - #define xlate_dev_kmem_ptr xlate_dev_kmem_ptr 281 280 #define xlate_dev_mem_ptr xlate_dev_mem_ptr 282 281 #include <asm-generic/io.h> 283 282 #undef PCI_IOBASE
-18
arch/ia64/include/asm/uaccess.h
··· 272 272 return ptr; 273 273 } 274 274 275 - /* 276 - * Convert a virtual cached kernel memory pointer to an uncached pointer 277 - */ 278 - static __inline__ void * 279 - xlate_dev_kmem_ptr(void *p) 280 - { 281 - struct page *page; 282 - void *ptr; 283 - 284 - page = virt_to_page((unsigned long)p); 285 - if (PageUncached(page)) 286 - ptr = (void *)__pa(p) + __IA64_UNCACHED_OFFSET; 287 - else 288 - ptr = p; 289 - 290 - return ptr; 291 - } 292 - 293 275 #endif /* _ASM_IA64_UACCESS_H */
-7
arch/m68k/atari/time.c
··· 317 317 318 318 return( 0 ); 319 319 } 320 - 321 - /* 322 - * Local variables: 323 - * c-indent-level: 4 324 - * tab-width: 8 325 - * End: 326 - */
-1
arch/m68k/configs/amcore_defconfig
··· 60 60 # CONFIG_VT is not set 61 61 # CONFIG_UNIX98_PTYS is not set 62 62 # CONFIG_DEVMEM is not set 63 - # CONFIG_DEVKMEM is not set 64 63 CONFIG_SERIAL_MCF=y 65 64 CONFIG_SERIAL_MCF_BAUDRATE=115200 66 65 CONFIG_SERIAL_MCF_CONSOLE=y
+3 -3
arch/m68k/include/asm/bitops.h
··· 440 440 441 441 #endif 442 442 443 - #include <asm-generic/bitops/find.h> 444 - 445 443 #ifdef __KERNEL__ 446 444 447 445 #if defined(CONFIG_CPU_HAS_NO_BITFIELDS) ··· 523 525 #define __clear_bit_unlock clear_bit_unlock 524 526 525 527 #include <asm-generic/bitops/ext2-atomic.h> 526 - #include <asm-generic/bitops/le.h> 527 528 #include <asm-generic/bitops/fls64.h> 528 529 #include <asm-generic/bitops/sched.h> 529 530 #include <asm-generic/bitops/hweight.h> 531 + #include <asm-generic/bitops/le.h> 530 532 #endif /* __KERNEL__ */ 533 + 534 + #include <asm-generic/bitops/find.h> 531 535 532 536 #endif /* _M68K_BITOPS_H */
-5
arch/m68k/include/asm/io_mm.h
··· 397 397 */ 398 398 #define xlate_dev_mem_ptr(p) __va(p) 399 399 400 - /* 401 - * Convert a virtual cached pointer to an uncached pointer 402 - */ 403 - #define xlate_dev_kmem_ptr(p) p 404 - 405 400 #define readb_relaxed(addr) readb(addr) 406 401 #define readw_relaxed(addr) readw(addr) 407 402 #define readl_relaxed(addr) readl(addr)
-5
arch/mips/include/asm/io.h
··· 564 564 */ 565 565 #define xlate_dev_mem_ptr(p) __va(p) 566 566 567 - /* 568 - * Convert a virtual cached pointer to an uncached pointer 569 - */ 570 - #define xlate_dev_kmem_ptr(p) p 571 - 572 567 void __ioread64_copy(void *to, const void __iomem *from, size_t count); 573 568 574 569 #endif /* _ASM_IO_H */
-1
arch/openrisc/configs/or1ksim_defconfig
··· 43 43 # CONFIG_SERIO is not set 44 44 # CONFIG_VT is not set 45 45 # CONFIG_LEGACY_PTYS is not set 46 - # CONFIG_DEVKMEM is not set 47 46 CONFIG_SERIAL_8250=y 48 47 CONFIG_SERIAL_8250_CONSOLE=y 49 48 CONFIG_SERIAL_OF_PLATFORM=y
-5
arch/parisc/include/asm/io.h
··· 316 316 */ 317 317 #define xlate_dev_mem_ptr(p) __va(p) 318 318 319 - /* 320 - * Convert a virtual cached pointer to an uncached pointer 321 - */ 322 - #define xlate_dev_kmem_ptr(p) p 323 - 324 319 extern int devmem_is_allowed(unsigned long pfn); 325 320 326 321 #endif
-1
arch/parisc/include/asm/pdc_chassis.h
··· 365 365 PDC_CHASSIS_EOM_SET ) 366 366 367 367 #endif /* _PARISC_PDC_CHASSIS_H */ 368 - /* vim: set ts=8 */
-5
arch/powerpc/include/asm/io.h
··· 663 663 #define xlate_dev_mem_ptr(p) __va(p) 664 664 665 665 /* 666 - * Convert a virtual cached pointer to an uncached pointer 667 - */ 668 - #define xlate_dev_kmem_ptr(p) p 669 - 670 - /* 671 666 * We don't do relaxed operations yet, at least not with this semantic 672 667 */ 673 668 #define readb_relaxed(addr) readb(addr)
-5
arch/s390/include/asm/io.h
··· 20 20 #define unxlate_dev_mem_ptr unxlate_dev_mem_ptr 21 21 void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr); 22 22 23 - /* 24 - * Convert a virtual cached pointer to an uncached pointer 25 - */ 26 - #define xlate_dev_kmem_ptr(p) p 27 - 28 23 #define IO_SPACE_LIMIT 0 29 24 30 25 void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot);
-1
arch/sh/configs/edosk7705_defconfig
··· 23 23 # CONFIG_INPUT is not set 24 24 # CONFIG_SERIO is not set 25 25 # CONFIG_VT is not set 26 - # CONFIG_DEVKMEM is not set 27 26 # CONFIG_UNIX98_PTYS is not set 28 27 # CONFIG_LEGACY_PTYS is not set 29 28 # CONFIG_HW_RANDOM is not set
-1
arch/sh/configs/se7206_defconfig
··· 71 71 # CONFIG_INPUT is not set 72 72 # CONFIG_SERIO is not set 73 73 # CONFIG_VT is not set 74 - # CONFIG_DEVKMEM is not set 75 74 CONFIG_SERIAL_SH_SCI=y 76 75 CONFIG_SERIAL_SH_SCI_NR_UARTS=4 77 76 CONFIG_SERIAL_SH_SCI_CONSOLE=y
-1
arch/sh/configs/sh2007_defconfig
··· 75 75 # CONFIG_INPUT_MOUSE is not set 76 76 # CONFIG_SERIO is not set 77 77 CONFIG_VT_HW_CONSOLE_BINDING=y 78 - # CONFIG_DEVKMEM is not set 79 78 CONFIG_SERIAL_SH_SCI=y 80 79 CONFIG_SERIAL_SH_SCI_CONSOLE=y 81 80 # CONFIG_LEGACY_PTYS is not set
-1
arch/sh/configs/sh7724_generic_defconfig
··· 18 18 # CONFIG_INPUT is not set 19 19 # CONFIG_SERIO is not set 20 20 # CONFIG_VT is not set 21 - # CONFIG_DEVKMEM is not set 22 21 CONFIG_SERIAL_SH_SCI=y 23 22 CONFIG_SERIAL_SH_SCI_NR_UARTS=6 24 23 CONFIG_SERIAL_SH_SCI_CONSOLE=y
-1
arch/sh/configs/sh7770_generic_defconfig
··· 20 20 # CONFIG_INPUT is not set 21 21 # CONFIG_SERIO is not set 22 22 # CONFIG_VT is not set 23 - # CONFIG_DEVKMEM is not set 24 23 CONFIG_SERIAL_SH_SCI=y 25 24 CONFIG_SERIAL_SH_SCI_NR_UARTS=6 26 25 CONFIG_SERIAL_SH_SCI_CONSOLE=y
-1
arch/sh/configs/sh7785lcr_32bit_defconfig
··· 66 66 CONFIG_INPUT_EVDEV=y 67 67 CONFIG_INPUT_EVBUG=m 68 68 CONFIG_VT_HW_CONSOLE_BINDING=y 69 - # CONFIG_DEVKMEM is not set 70 69 CONFIG_SERIAL_SH_SCI=y 71 70 CONFIG_SERIAL_SH_SCI_NR_UARTS=6 72 71 CONFIG_SERIAL_SH_SCI_CONSOLE=y
+3 -2
arch/sh/include/asm/bitops.h
··· 58 58 return result; 59 59 } 60 60 61 - #include <asm-generic/bitops/find.h> 62 61 #include <asm-generic/bitops/ffs.h> 63 62 #include <asm-generic/bitops/hweight.h> 64 63 #include <asm-generic/bitops/lock.h> 65 64 #include <asm-generic/bitops/sched.h> 66 - #include <asm-generic/bitops/le.h> 67 65 #include <asm-generic/bitops/ext2-atomic.h> 68 66 #include <asm-generic/bitops/fls.h> 69 67 #include <asm-generic/bitops/__fls.h> 70 68 #include <asm-generic/bitops/fls64.h> 69 + 70 + #include <asm-generic/bitops/le.h> 71 + #include <asm-generic/bitops/find.h> 71 72 72 73 #endif /* __ASM_SH_BITOPS_H */
-5
arch/sh/include/asm/io.h
··· 283 283 */ 284 284 #define xlate_dev_mem_ptr(p) __va(p) 285 285 286 - /* 287 - * Convert a virtual cached pointer to an uncached pointer 288 - */ 289 - #define xlate_dev_kmem_ptr(p) p 290 - 291 286 #define ARCH_HAS_VALID_PHYS_ADDR_RANGE 292 287 int valid_phys_addr_range(phys_addr_t addr, size_t size); 293 288 int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
-1
arch/sparc/configs/sparc64_defconfig
··· 122 122 # CONFIG_SERIO_SERPORT is not set 123 123 CONFIG_SERIO_PCIPS2=m 124 124 CONFIG_SERIO_RAW=m 125 - # CONFIG_DEVKMEM is not set 126 125 CONFIG_SERIAL_SUNSU=y 127 126 CONFIG_SERIAL_SUNSU_CONSOLE=y 128 127 CONFIG_SERIAL_SUNSAB=y
-5
arch/sparc/include/asm/io_64.h
··· 454 454 */ 455 455 #define xlate_dev_mem_ptr(p) __va(p) 456 456 457 - /* 458 - * Convert a virtual cached pointer to an uncached pointer 459 - */ 460 - #define xlate_dev_kmem_ptr(p) p 461 - 462 457 #endif 463 458 464 459 #endif /* !(__SPARC64_IO_H) */
-7
arch/um/drivers/cow.h
··· 24 24 int *data_offset_out); 25 25 26 26 #endif 27 - 28 - /* 29 - * --------------------------------------------------------------------------- 30 - * Local variables: 31 - * c-file-style: "linux" 32 - * End: 33 - */
-1
arch/xtensa/configs/xip_kc705_defconfig
··· 72 72 # CONFIG_INPUT_KEYBOARD is not set 73 73 # CONFIG_INPUT_MOUSE is not set 74 74 # CONFIG_SERIO is not set 75 - CONFIG_DEVKMEM=y 76 75 CONFIG_SERIAL_8250=y 77 76 # CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set 78 77 CONFIG_SERIAL_8250_CONSOLE=y
+1
block/blk-settings.c
··· 7 7 #include <linux/init.h> 8 8 #include <linux/bio.h> 9 9 #include <linux/blkdev.h> 10 + #include <linux/pagemap.h> 10 11 #include <linux/gcd.h> 11 12 #include <linux/lcm.h> 12 13 #include <linux/jiffies.h>
-7
drivers/auxdisplay/panel.c
··· 1737 1737 module_exit(panel_cleanup_module); 1738 1738 MODULE_AUTHOR("Willy Tarreau"); 1739 1739 MODULE_LICENSE("GPL"); 1740 - 1741 - /* 1742 - * Local variables: 1743 - * c-indent-level: 4 1744 - * tab-width: 8 1745 - * End: 1746 - */
+2
drivers/base/firmware_loader/main.c
··· 15 15 #include <linux/kernel_read_file.h> 16 16 #include <linux/module.h> 17 17 #include <linux/init.h> 18 + #include <linux/initrd.h> 18 19 #include <linux/timer.h> 19 20 #include <linux/vmalloc.h> 20 21 #include <linux/interrupt.h> ··· 505 504 if (!path) 506 505 return -ENOMEM; 507 506 507 + wait_for_initramfs(); 508 508 for (i = 0; i < ARRAY_SIZE(fw_path); i++) { 509 509 size_t file_size = 0; 510 510 size_t *file_size_ptr = NULL;
+1
drivers/block/brd.c
··· 18 18 #include <linux/bio.h> 19 19 #include <linux/highmem.h> 20 20 #include <linux/mutex.h> 21 + #include <linux/pagemap.h> 21 22 #include <linux/radix-tree.h> 22 23 #include <linux/fs.h> 23 24 #include <linux/slab.h>
+1
drivers/block/loop.c
··· 53 53 #include <linux/moduleparam.h> 54 54 #include <linux/sched.h> 55 55 #include <linux/fs.h> 56 + #include <linux/pagemap.h> 56 57 #include <linux/file.h> 57 58 #include <linux/stat.h> 58 59 #include <linux/errno.h>
-10
drivers/char/Kconfig
··· 334 334 memory. 335 335 When in doubt, say "Y". 336 336 337 - config DEVKMEM 338 - bool "/dev/kmem virtual device support" 339 - # On arm64, VMALLOC_START < PAGE_OFFSET, which confuses kmem read/write 340 - depends on !ARM64 341 - help 342 - Say Y here if you want to support the /dev/kmem device. The 343 - /dev/kmem device is rarely used, but can be used for certain 344 - kind of kernel debugging operations. 345 - When in doubt, say "N". 346 - 347 337 config NVRAM 348 338 tristate "/dev/nvram support" 349 339 depends on X86 || HAVE_ARCH_NVRAM_OPS
-231
drivers/char/mem.c
··· 403 403 return 0; 404 404 } 405 405 406 - static int mmap_kmem(struct file *file, struct vm_area_struct *vma) 407 - { 408 - unsigned long pfn; 409 - 410 - /* Turn a kernel-virtual address into a physical page frame */ 411 - pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT; 412 - 413 - /* 414 - * RED-PEN: on some architectures there is more mapped memory than 415 - * available in mem_map which pfn_valid checks for. Perhaps should add a 416 - * new macro here. 417 - * 418 - * RED-PEN: vmalloc is not supported right now. 419 - */ 420 - if (!pfn_valid(pfn)) 421 - return -EIO; 422 - 423 - vma->vm_pgoff = pfn; 424 - return mmap_mem(file, vma); 425 - } 426 - 427 - /* 428 - * This function reads the *virtual* memory as seen by the kernel. 429 - */ 430 - static ssize_t read_kmem(struct file *file, char __user *buf, 431 - size_t count, loff_t *ppos) 432 - { 433 - unsigned long p = *ppos; 434 - ssize_t low_count, read, sz; 435 - char *kbuf; /* k-addr because vread() takes vmlist_lock rwlock */ 436 - int err = 0; 437 - 438 - read = 0; 439 - if (p < (unsigned long) high_memory) { 440 - low_count = count; 441 - if (count > (unsigned long)high_memory - p) 442 - low_count = (unsigned long)high_memory - p; 443 - 444 - #ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED 445 - /* we don't have page 0 mapped on sparc and m68k.. */ 446 - if (p < PAGE_SIZE && low_count > 0) { 447 - sz = size_inside_page(p, low_count); 448 - if (clear_user(buf, sz)) 449 - return -EFAULT; 450 - buf += sz; 451 - p += sz; 452 - read += sz; 453 - low_count -= sz; 454 - count -= sz; 455 - } 456 - #endif 457 - while (low_count > 0) { 458 - sz = size_inside_page(p, low_count); 459 - 460 - /* 461 - * On ia64 if a page has been mapped somewhere as 462 - * uncached, then it must also be accessed uncached 463 - * by the kernel or data corruption may occur 464 - */ 465 - kbuf = xlate_dev_kmem_ptr((void *)p); 466 - if (!virt_addr_valid(kbuf)) 467 - return -ENXIO; 468 - 469 - if (copy_to_user(buf, kbuf, sz)) 470 - return -EFAULT; 471 - buf += sz; 472 - p += sz; 473 - read += sz; 474 - low_count -= sz; 475 - count -= sz; 476 - if (should_stop_iteration()) { 477 - count = 0; 478 - break; 479 - } 480 - } 481 - } 482 - 483 - if (count > 0) { 484 - kbuf = (char *)__get_free_page(GFP_KERNEL); 485 - if (!kbuf) 486 - return -ENOMEM; 487 - while (count > 0) { 488 - sz = size_inside_page(p, count); 489 - if (!is_vmalloc_or_module_addr((void *)p)) { 490 - err = -ENXIO; 491 - break; 492 - } 493 - sz = vread(kbuf, (char *)p, sz); 494 - if (!sz) 495 - break; 496 - if (copy_to_user(buf, kbuf, sz)) { 497 - err = -EFAULT; 498 - break; 499 - } 500 - count -= sz; 501 - buf += sz; 502 - read += sz; 503 - p += sz; 504 - if (should_stop_iteration()) 505 - break; 506 - } 507 - free_page((unsigned long)kbuf); 508 - } 509 - *ppos = p; 510 - return read ? read : err; 511 - } 512 - 513 - 514 - static ssize_t do_write_kmem(unsigned long p, const char __user *buf, 515 - size_t count, loff_t *ppos) 516 - { 517 - ssize_t written, sz; 518 - unsigned long copied; 519 - 520 - written = 0; 521 - #ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED 522 - /* we don't have page 0 mapped on sparc and m68k.. */ 523 - if (p < PAGE_SIZE) { 524 - sz = size_inside_page(p, count); 525 - /* Hmm. Do something? */ 526 - buf += sz; 527 - p += sz; 528 - count -= sz; 529 - written += sz; 530 - } 531 - #endif 532 - 533 - while (count > 0) { 534 - void *ptr; 535 - 536 - sz = size_inside_page(p, count); 537 - 538 - /* 539 - * On ia64 if a page has been mapped somewhere as uncached, then 540 - * it must also be accessed uncached by the kernel or data 541 - * corruption may occur. 542 - */ 543 - ptr = xlate_dev_kmem_ptr((void *)p); 544 - if (!virt_addr_valid(ptr)) 545 - return -ENXIO; 546 - 547 - copied = copy_from_user(ptr, buf, sz); 548 - if (copied) { 549 - written += sz - copied; 550 - if (written) 551 - break; 552 - return -EFAULT; 553 - } 554 - buf += sz; 555 - p += sz; 556 - count -= sz; 557 - written += sz; 558 - if (should_stop_iteration()) 559 - break; 560 - } 561 - 562 - *ppos += written; 563 - return written; 564 - } 565 - 566 - /* 567 - * This function writes to the *virtual* memory as seen by the kernel. 568 - */ 569 - static ssize_t write_kmem(struct file *file, const char __user *buf, 570 - size_t count, loff_t *ppos) 571 - { 572 - unsigned long p = *ppos; 573 - ssize_t wrote = 0; 574 - ssize_t virtr = 0; 575 - char *kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */ 576 - int err = 0; 577 - 578 - if (p < (unsigned long) high_memory) { 579 - unsigned long to_write = min_t(unsigned long, count, 580 - (unsigned long)high_memory - p); 581 - wrote = do_write_kmem(p, buf, to_write, ppos); 582 - if (wrote != to_write) 583 - return wrote; 584 - p += wrote; 585 - buf += wrote; 586 - count -= wrote; 587 - } 588 - 589 - if (count > 0) { 590 - kbuf = (char *)__get_free_page(GFP_KERNEL); 591 - if (!kbuf) 592 - return wrote ? wrote : -ENOMEM; 593 - while (count > 0) { 594 - unsigned long sz = size_inside_page(p, count); 595 - unsigned long n; 596 - 597 - if (!is_vmalloc_or_module_addr((void *)p)) { 598 - err = -ENXIO; 599 - break; 600 - } 601 - n = copy_from_user(kbuf, buf, sz); 602 - if (n) { 603 - err = -EFAULT; 604 - break; 605 - } 606 - vwrite(kbuf, (char *)p, sz); 607 - count -= sz; 608 - buf += sz; 609 - virtr += sz; 610 - p += sz; 611 - if (should_stop_iteration()) 612 - break; 613 - } 614 - free_page((unsigned long)kbuf); 615 - } 616 - 617 - *ppos = p; 618 - return virtr + wrote ? : err; 619 - } 620 - 621 406 static ssize_t read_port(struct file *file, char __user *buf, 622 407 size_t count, loff_t *ppos) 623 408 { ··· 640 855 #define write_zero write_null 641 856 #define write_iter_zero write_iter_null 642 857 #define open_mem open_port 643 - #define open_kmem open_mem 644 858 645 859 static const struct file_operations __maybe_unused mem_fops = { 646 860 .llseek = memory_lseek, ··· 647 863 .write = write_mem, 648 864 .mmap = mmap_mem, 649 865 .open = open_mem, 650 - #ifndef CONFIG_MMU 651 - .get_unmapped_area = get_unmapped_area_mem, 652 - .mmap_capabilities = memory_mmap_capabilities, 653 - #endif 654 - }; 655 - 656 - static const struct file_operations __maybe_unused kmem_fops = { 657 - .llseek = memory_lseek, 658 - .read = read_kmem, 659 - .write = write_kmem, 660 - .mmap = mmap_kmem, 661 - .open = open_kmem, 662 866 #ifndef CONFIG_MMU 663 867 .get_unmapped_area = get_unmapped_area_mem, 664 868 .mmap_capabilities = memory_mmap_capabilities, ··· 696 924 } devlist[] = { 697 925 #ifdef CONFIG_DEVMEM 698 926 [DEVMEM_MINOR] = { "mem", 0, &mem_fops, FMODE_UNSIGNED_OFFSET }, 699 - #endif 700 - #ifdef CONFIG_DEVKMEM 701 - [2] = { "kmem", 0, &kmem_fops, FMODE_UNSIGNED_OFFSET }, 702 927 #endif 703 928 [3] = { "null", 0666, &null_fops, 0 }, 704 929 #ifdef CONFIG_DEVPORT
-1
drivers/gpu/drm/qxl/qxl_drv.c
··· 1 - /* vim: set ts=8 sw=8 tw=78 ai noexpandtab */ 2 1 /* qxl_drv.c -- QXL driver -*- linux-c -*- 3 2 * 4 3 * Copyright 2011 Red Hat, Inc.
+1
drivers/isdn/capi/kcapi_proc.c
··· 201 201 202 202 static const struct proc_ops empty_proc_ops = { 203 203 .proc_read = empty_read, 204 + .proc_lseek = default_llseek, 204 205 }; 205 206 206 207 // ---------------------------------------------------------------------------
+1
drivers/md/bcache/super.c
··· 16 16 #include "features.h" 17 17 18 18 #include <linux/blkdev.h> 19 + #include <linux/pagemap.h> 19 20 #include <linux/debugfs.h> 20 21 #include <linux/genhd.h> 21 22 #include <linux/idr.h>
-3
drivers/media/usb/pwc/pwc-uncompress.c
··· 9 9 Please send bug reports and support requests to <luc@saillard.org>. 10 10 The decompression routines have been implemented by reverse-engineering the 11 11 Nemosoft binary pwcx module. Caveat emptor. 12 - 13 - 14 - vim: set ts=8: 15 12 */ 16 13 17 14 #include <asm/current.h>
-8
drivers/net/ethernet/adaptec/starfire.c
··· 2070 2070 2071 2071 module_init(starfire_init); 2072 2072 module_exit(starfire_cleanup); 2073 - 2074 - 2075 - /* 2076 - * Local variables: 2077 - * c-basic-offset: 8 2078 - * tab-width: 8 2079 - * End: 2080 - */
-8
drivers/net/ethernet/amd/atarilance.c
··· 1156 1156 module_init(atarilance_module_init); 1157 1157 module_exit(atarilance_module_exit); 1158 1158 #endif /* MODULE */ 1159 - 1160 - 1161 - /* 1162 - * Local variables: 1163 - * c-indent-level: 4 1164 - * tab-width: 4 1165 - * End: 1166 - */
-7
drivers/net/ethernet/amd/pcnet32.c
··· 3029 3029 3030 3030 module_init(pcnet32_init_module); 3031 3031 module_exit(pcnet32_cleanup_module); 3032 - 3033 - /* 3034 - * Local variables: 3035 - * c-indent-level: 4 3036 - * tab-width: 8 3037 - * End: 3038 - */
+1
drivers/net/wireless/intersil/hostap/hostap_proc.c
··· 227 227 228 228 static const struct proc_ops prism2_aux_dump_proc_ops = { 229 229 .proc_read = prism2_aux_dump_proc_no_read, 230 + .proc_lseek = default_llseek, 230 231 }; 231 232 232 233
-8
drivers/net/wireless/intersil/orinoco/orinoco_nortel.c
··· 312 312 313 313 module_init(orinoco_nortel_init); 314 314 module_exit(orinoco_nortel_exit); 315 - 316 - /* 317 - * Local variables: 318 - * c-indent-level: 8 319 - * c-basic-offset: 8 320 - * tab-width: 8 321 - * End: 322 - */
-8
drivers/net/wireless/intersil/orinoco/orinoco_pci.c
··· 255 255 256 256 module_init(orinoco_pci_init); 257 257 module_exit(orinoco_pci_exit); 258 - 259 - /* 260 - * Local variables: 261 - * c-indent-level: 8 262 - * c-basic-offset: 8 263 - * tab-width: 8 264 - * End: 265 - */
-8
drivers/net/wireless/intersil/orinoco/orinoco_plx.c
··· 360 360 361 361 module_init(orinoco_plx_init); 362 362 module_exit(orinoco_plx_exit); 363 - 364 - /* 365 - * Local variables: 366 - * c-indent-level: 8 367 - * c-basic-offset: 8 368 - * tab-width: 8 369 - * End: 370 - */
-8
drivers/net/wireless/intersil/orinoco/orinoco_tmd.c
··· 235 235 236 236 module_init(orinoco_tmd_init); 237 237 module_exit(orinoco_tmd_exit); 238 - 239 - /* 240 - * Local variables: 241 - * c-indent-level: 8 242 - * c-basic-offset: 8 243 - * tab-width: 8 244 - * End: 245 - */
+1
drivers/nvdimm/btt.c
··· 6 6 #include <linux/highmem.h> 7 7 #include <linux/debugfs.h> 8 8 #include <linux/blkdev.h> 9 + #include <linux/pagemap.h> 9 10 #include <linux/module.h> 10 11 #include <linux/device.h> 11 12 #include <linux/mutex.h>
+1
drivers/nvdimm/pmem.c
··· 8 8 */ 9 9 10 10 #include <linux/blkdev.h> 11 + #include <linux/pagemap.h> 11 12 #include <linux/hdreg.h> 12 13 #include <linux/init.h> 13 14 #include <linux/platform_device.h>
-12
drivers/parport/parport_ip32.c
··· 2224 2224 ", bit 2: hardware SPP mode" 2225 2225 ", bit 3: hardware EPP mode" 2226 2226 ", bit 4: hardware ECP mode"); 2227 - 2228 - /*--- Inform (X)Emacs about preferred coding style ---------------------*/ 2229 - /* 2230 - * Local Variables: 2231 - * mode: c 2232 - * c-file-style: "linux" 2233 - * indent-tabs-mode: t 2234 - * tab-width: 8 2235 - * fill-column: 78 2236 - * ispell-local-dictionary: "american" 2237 - * End: 2238 - */
-3
drivers/platform/x86/dell/dell_rbu.c
··· 675 675 676 676 module_exit(dcdrbu_exit); 677 677 module_init(dcdrbu_init); 678 - 679 - /* vim:noet:ts=8:sw=8 680 - */
-1
drivers/scsi/53c700.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8 -*- */ 3 2 4 3 /* NCR (or Symbios) 53c700 and 53c700-66 Driver 5 4 *
-1
drivers/scsi/53c700.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* -*- mode: c; c-basic-offset: 8 -*- */ 3 2 4 3 /* Driver for 53c700 and 53c700-66 chips from NCR and Symbios 5 4 *
-6
drivers/scsi/ch.c
··· 1058 1058 1059 1059 module_init(init_ch_module); 1060 1060 module_exit(exit_ch_module); 1061 - 1062 - /* 1063 - * Local variables: 1064 - * c-basic-offset: 8 1065 - * End: 1066 - */
+1
drivers/scsi/esas2r/esas2r_main.c
··· 616 616 }; 617 617 618 618 static const struct proc_ops esas2r_proc_ops = { 619 + .proc_lseek = default_llseek, 619 620 .proc_ioctl = esas2r_proc_ioctl, 620 621 #ifdef CONFIG_COMPAT 621 622 .proc_compat_ioctl = compat_ptr_ioctl,
-20
drivers/scsi/ips.c
··· 7099 7099 MODULE_LICENSE("GPL"); 7100 7100 MODULE_DESCRIPTION("IBM ServeRAID Adapter Driver " IPS_VER_STRING); 7101 7101 MODULE_VERSION(IPS_VER_STRING); 7102 - 7103 - 7104 - /* 7105 - * Overrides for Emacs so that we almost follow Linus's tabbing style. 7106 - * Emacs will notice this stuff at the end of the file and automatically 7107 - * adjust the settings for this buffer only. This must remain at the end 7108 - * of the file. 7109 - * --------------------------------------------------------------------------- 7110 - * Local variables: 7111 - * c-indent-level: 2 7112 - * c-brace-imaginary-offset: 0 7113 - * c-brace-offset: -2 7114 - * c-argdecl-indent: 2 7115 - * c-label-offset: -2 7116 - * c-continued-statement-offset: 2 7117 - * c-continued-brace-offset: 0 7118 - * indent-tabs-mode: nil 7119 - * tab-width: 8 7120 - * End: 7121 - */
-20
drivers/scsi/ips.h
··· 1211 1211 IPS_COMPAT_TAMPA, \ 1212 1212 IPS_COMPAT_KEYWEST \ 1213 1213 } 1214 - 1215 - 1216 - /* 1217 - * Overrides for Emacs so that we almost follow Linus's tabbing style. 1218 - * Emacs will notice this stuff at the end of the file and automatically 1219 - * adjust the settings for this buffer only. This must remain at the end 1220 - * of the file. 1221 - * --------------------------------------------------------------------------- 1222 - * Local variables: 1223 - * c-indent-level: 2 1224 - * c-brace-imaginary-offset: 0 1225 - * c-brace-offset: -2 1226 - * c-argdecl-indent: 2 1227 - * c-label-offset: -2 1228 - * c-continued-statement-offset: 2 1229 - * c-continued-brace-offset: 0 1230 - * indent-tabs-mode: nil 1231 - * tab-width: 8 1232 - * End: 1233 - */
-1
drivers/scsi/lasi700.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8 -*- */ 3 2 4 3 /* PARISC LASI driver for the 53c700 chip 5 4 *
-2
drivers/scsi/megaraid/mbox_defs.h
··· 781 781 } __attribute__ ((packed)) mbox_sgl32; 782 782 783 783 #endif // _MRAID_MBOX_DEFS_H_ 784 - 785 - /* vim: set ts=8 sw=8 tw=78: */
-2
drivers/scsi/megaraid/mega_common.h
··· 282 282 }; 283 283 284 284 #endif // _MEGA_COMMON_H_ 285 - 286 - // vim: set ts=8 sw=8 tw=78:
-2
drivers/scsi/megaraid/megaraid_mbox.c
··· 4068 4068 */ 4069 4069 module_init(megaraid_init); 4070 4070 module_exit(megaraid_exit); 4071 - 4072 - /* vim: set ts=8 sw=8 tw=78 ai si: */
-2
drivers/scsi/megaraid/megaraid_mbox.h
··· 230 230 #define WROUTDOOR(rdev, value) writel(value, (rdev)->baseaddr + 0x2C) 231 231 232 232 #endif // _MEGARAID_H_ 233 - 234 - // vim: set ts=8 sw=8 tw=78:
-12
drivers/scsi/qla1280.c
··· 4403 4403 MODULE_FIRMWARE("qlogic/1280.bin"); 4404 4404 MODULE_FIRMWARE("qlogic/12160.bin"); 4405 4405 MODULE_VERSION(QLA1280_VERSION); 4406 - 4407 - /* 4408 - * Overrides for Emacs so that we almost follow Linus's tabbing style. 4409 - * Emacs will notice this stuff at the end of the file and automatically 4410 - * adjust the settings for this buffer only. This must remain at the end 4411 - * of the file. 4412 - * --------------------------------------------------------------------------- 4413 - * Local variables: 4414 - * c-basic-offset: 8 4415 - * tab-width: 8 4416 - * End: 4417 - */
+1
drivers/scsi/scsicam.c
··· 17 17 #include <linux/genhd.h> 18 18 #include <linux/kernel.h> 19 19 #include <linux/blkdev.h> 20 + #include <linux/pagemap.h> 20 21 #include <linux/msdos_partition.h> 21 22 #include <asm/unaligned.h> 22 23
-1
drivers/scsi/sni_53c710.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8 -*- */ 3 2 4 3 /* SNI RM driver 5 4 *
-9
drivers/video/fbdev/matrox/matroxfb_base.c
··· 2608 2608 EXPORT_SYMBOL(matroxfb_unregister_driver); 2609 2609 EXPORT_SYMBOL(matroxfb_wait_for_sync); 2610 2610 EXPORT_SYMBOL(matroxfb_enable_irq); 2611 - 2612 - /* 2613 - * Overrides for Emacs so that we follow Linus's tabbing style. 2614 - * --------------------------------------------------------------------------- 2615 - * Local variables: 2616 - * c-basic-offset: 8 2617 - * End: 2618 - */ 2619 -
-10
drivers/video/fbdev/vga16fb.c
··· 1451 1451 MODULE_LICENSE("GPL"); 1452 1452 module_init(vga16fb_init); 1453 1453 module_exit(vga16fb_exit); 1454 - 1455 - 1456 - /* 1457 - * Overrides for Emacs so that we follow Linus's tabbing style. 1458 - * --------------------------------------------------------------------------- 1459 - * Local variables: 1460 - * c-basic-offset: 8 1461 - * End: 1462 - */ 1463 -
+1 -3
fs/configfs/configfs_internal.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset:8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * configfs_internal.h - Internal stuff for configfs 6 4 * 7 5 * Based on sysfs:
+1 -3
fs/configfs/dir.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dir.c - Operations for configfs directories. 6 4 * 7 5 * Based on sysfs:
+1 -3
fs/configfs/file.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * file.c - operations for regular (text) files. 6 4 * 7 5 * Based on sysfs:
+1 -3
fs/configfs/inode.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * inode.c - basic inode and dentry operations. 6 4 * 7 5 * Based on sysfs:
+1 -3
fs/configfs/item.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * item.c - library routines for handling generic config items 6 4 * 7 5 * Based on kobject:
+1 -3
fs/configfs/mount.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * mount.c - operations for initializing and mounting configfs. 6 4 * 7 5 * Based on sysfs:
+1 -3
fs/configfs/symlink.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * symlink.c - operations for configfs symlinks. 6 4 * 7 5 * Based on sysfs:
+6
fs/eventpoll.c
··· 657 657 */ 658 658 list_splice(txlist, &ep->rdllist); 659 659 __pm_relax(ep->ws); 660 + 661 + if (!list_empty(&ep->rdllist)) { 662 + if (waitqueue_active(&ep->wq)) 663 + wake_up(&ep->wq); 664 + } 665 + 660 666 write_unlock_irq(&ep->lock); 661 667 } 662 668
+1 -1
fs/fat/fatent.c
··· 771 771 /* 772 772 * FAT data is organized as clusters, trim at the granulary of cluster. 773 773 * 774 - * fstrim_range is in byte, convert vaules to cluster index. 774 + * fstrim_range is in byte, convert values to cluster index. 775 775 * Treat sectors before data region as all used, not to trim them. 776 776 */ 777 777 ent_start = max_t(u64, range->start>>sbi->cluster_bits, FAT_START_ENT);
+2 -1
fs/hpfs/hpfs.h
··· 356 356 u8 no_of_acls; /* number of ACL's (low 3 bits) */ 357 357 u8 ix; /* code page index (of filename), see 358 358 struct code_page_data */ 359 - u8 namelen, name[1]; /* file name */ 359 + u8 namelen; /* file name length */ 360 + u8 name[]; /* file name */ 360 361 /* dnode_secno down; btree down pointer, if present, 361 362 follows name on next word boundary, or maybe it 362 363 precedes next dirent, which is on a word boundary. */
+1
fs/isofs/rock.c
··· 767 767 rs.cont_extent = isonum_733(rr->u.CE.extent); 768 768 rs.cont_offset = isonum_733(rr->u.CE.offset); 769 769 rs.cont_size = isonum_733(rr->u.CE.size); 770 + break; 770 771 default: 771 772 break; 772 773 }
-7
fs/nfs/dir.c
··· 3004 3004 goto out; 3005 3005 } 3006 3006 EXPORT_SYMBOL_GPL(nfs_permission); 3007 - 3008 - /* 3009 - * Local variables: 3010 - * version-control: t 3011 - * kept-new-versions: 5 3012 - * End: 3013 - */
-6
fs/nfs/nfs4proc.c
··· 10427 10427 #endif 10428 10428 NULL 10429 10429 }; 10430 - 10431 - /* 10432 - * Local variables: 10433 - * c-basic-offset: 8 10434 - * End: 10435 - */
-6
fs/nfs/nfs4renewd.c
··· 149 149 /* Cap maximum reconnect timeout at 1/2 lease period */ 150 150 rpc_set_connect_timeout(clp->cl_rpcclient, lease, lease >> 1); 151 151 } 152 - 153 - /* 154 - * Local variables: 155 - * c-basic-offset: 8 156 - * End: 157 - */
-6
fs/nfs/nfs4state.c
··· 2695 2695 module_put_and_exit(0); 2696 2696 return 0; 2697 2697 } 2698 - 2699 - /* 2700 - * Local variables: 2701 - * c-basic-offset: 8 2702 - * End: 2703 - */
-6
fs/nfs/nfs4xdr.c
··· 7629 7629 .procs = nfs4_procedures, 7630 7630 .counts = nfs_version4_counts, 7631 7631 }; 7632 - 7633 - /* 7634 - * Local variables: 7635 - * c-basic-offset: 8 7636 - * End: 7637 - */
-6
fs/nfsd/nfs4proc.c
··· 3317 3317 .vs_rpcb_optnl = true, 3318 3318 .vs_need_cong_ctrl = true, 3319 3319 }; 3320 - 3321 - /* 3322 - * Local variables: 3323 - * c-basic-offset: 8 3324 - * End: 3325 - */
-6
fs/nfsd/nfs4xdr.c
··· 5448 5448 nfsd4_sequence_done(resp); 5449 5449 return 1; 5450 5450 } 5451 - 5452 - /* 5453 - * Local variables: 5454 - * c-basic-offset: 8 5455 - * End: 5456 - */
-6
fs/nfsd/xdr4.h
··· 866 866 867 867 868 868 #endif 869 - 870 - /* 871 - * Local variables: 872 - * c-basic-offset: 8 873 - * End: 874 - */
+1 -1
fs/nilfs2/cpfile.c
··· 293 293 * nilfs_cpfile_delete_checkpoints - delete checkpoints 294 294 * @cpfile: inode of checkpoint file 295 295 * @start: start checkpoint number 296 - * @end: end checkpoint numer 296 + * @end: end checkpoint number 297 297 * 298 298 * Description: nilfs_cpfile_delete_checkpoints() deletes the checkpoints in 299 299 * the period from @start to @end, excluding @end itself. The checkpoints
+2 -2
fs/nilfs2/ioctl.c
··· 1043 1043 * @inode: inode object 1044 1044 * @argp: pointer on argument from userspace 1045 1045 * 1046 - * Decription: nilfs_ioctl_trim_fs is the FITRIM ioctl handle function. It 1046 + * Description: nilfs_ioctl_trim_fs is the FITRIM ioctl handle function. It 1047 1047 * checks the arguments from userspace and calls nilfs_sufile_trim_fs, which 1048 1048 * performs the actual trim operation. 1049 1049 * ··· 1085 1085 * @inode: inode object 1086 1086 * @argp: pointer on argument from userspace 1087 1087 * 1088 - * Decription: nilfs_ioctl_set_alloc_range() function defines lower limit 1088 + * Description: nilfs_ioctl_set_alloc_range() function defines lower limit 1089 1089 * of segments in bytes and upper limit of segments in bytes. 1090 1090 * The NILFS_IOCTL_SET_ALLOC_RANGE is used by nilfs_resize utility. 1091 1091 *
+2 -2
fs/nilfs2/segment.c
··· 2214 2214 * nilfs_construct_segment - construct a logical segment 2215 2215 * @sb: super block 2216 2216 * 2217 - * Return Value: On success, 0 is retured. On errors, one of the following 2217 + * Return Value: On success, 0 is returned. On errors, one of the following 2218 2218 * negative error code is returned. 2219 2219 * 2220 2220 * %-EROFS - Read only filesystem. ··· 2251 2251 * @start: start byte offset 2252 2252 * @end: end byte offset (inclusive) 2253 2253 * 2254 - * Return Value: On success, 0 is retured. On errors, one of the following 2254 + * Return Value: On success, 0 is returned. On errors, one of the following 2255 2255 * negative error code is returned. 2256 2256 * 2257 2257 * %-EROFS - Read only filesystem.
+1 -1
fs/nilfs2/the_nilfs.c
··· 195 195 /** 196 196 * load_nilfs - load and recover the nilfs 197 197 * @nilfs: the_nilfs structure to be released 198 - * @sb: super block isntance used to recover past segment 198 + * @sb: super block instance used to recover past segment 199 199 * 200 200 * load_nilfs() searches and load the latest super root, 201 201 * attaches the last segment, and does recovery if needed.
+1 -3
fs/ocfs2/acl.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * acl.c 6 4 * 7 5 * Copyright (C) 2004, 2008 Oracle. All rights reserved.
+1 -3
fs/ocfs2/acl.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * acl.h 6 4 * 7 5 * Copyright (C) 2004, 2008 Oracle. All rights reserved.
+1 -3
fs/ocfs2/alloc.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * alloc.c 6 4 * 7 5 * Extent allocs and frees
+1 -3
fs/ocfs2/alloc.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * alloc.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/aops.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * Copyright (C) 2002, 2004 Oracle. All rights reserved. 6 4 */ 7 5
+1 -3
fs/ocfs2/aops.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * Copyright (C) 2002, 2004, 2005 Oracle. All rights reserved. 6 4 */ 7 5
+1 -3
fs/ocfs2/blockcheck.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * blockcheck.c 6 4 * 7 5 * Checksum and ECC codes for the OCFS2 userspace library.
+1 -3
fs/ocfs2/blockcheck.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * blockcheck.h 6 4 * 7 5 * Checksum and ECC codes for the OCFS2 userspace library.
+1 -3
fs/ocfs2/buffer_head_io.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * io.c 6 4 * 7 5 * Buffer cache handling
+1 -3
fs/ocfs2/buffer_head_io.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * ocfs2_buffer_head.h 6 4 * 7 5 * Buffer cache handling functions defined
+1 -3
fs/ocfs2/cluster/heartbeat.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * Copyright (C) 2004, 2005 Oracle. All rights reserved. 6 4 */ 7 5
+1 -3
fs/ocfs2/cluster/heartbeat.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * heartbeat.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/cluster/masklog.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * Copyright (C) 2004, 2005 Oracle. All rights reserved. 6 4 */ 7 5
+1 -3
fs/ocfs2/cluster/masklog.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * Copyright (C) 2005 Oracle. All rights reserved. 6 4 */ 7 5
+1 -3
fs/ocfs2/cluster/netdebug.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * netdebug.c 6 4 * 7 5 * debug functionality for o2net
+1 -3
fs/ocfs2/cluster/nodemanager.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * Copyright (C) 2004, 2005 Oracle. All rights reserved. 6 4 */ 7 5
+1 -3
fs/ocfs2/cluster/nodemanager.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * nodemanager.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/cluster/ocfs2_heartbeat.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * ocfs2_heartbeat.h 6 4 * 7 5 * On-disk structures for ocfs2_heartbeat
+1 -3
fs/ocfs2/cluster/ocfs2_nodemanager.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * ocfs2_nodemanager.h 6 4 * 7 5 * Header describing the interface between userspace and the kernel
+1 -3
fs/ocfs2/cluster/quorum.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * 4 - * vim: noexpandtab sw=8 ts=8 sts=0: 2 + /* 5 3 * 6 4 * Copyright (C) 2005 Oracle. All rights reserved. 7 5 */
+1 -3
fs/ocfs2/cluster/quorum.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * Copyright (C) 2005 Oracle. All rights reserved. 6 4 */ 7 5
+1 -3
fs/ocfs2/cluster/sys.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * sys.c 6 4 * 7 5 * OCFS2 cluster sysfs interface
+1 -3
fs/ocfs2/cluster/sys.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * sys.h 6 4 * 7 5 * Function prototypes for o2cb sysfs interface
+1 -3
fs/ocfs2/cluster/tcp.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * 4 - * vim: noexpandtab sw=8 ts=8 sts=0: 2 + /* 5 3 * 6 4 * Copyright (C) 2004 Oracle. All rights reserved. 7 5 *
+1 -3
fs/ocfs2/cluster/tcp.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * tcp.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/cluster/tcp_internal.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * Copyright (C) 2005 Oracle. All rights reserved. 6 4 */ 7 5
+1 -3
fs/ocfs2/dcache.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dcache.c 6 4 * 7 5 * dentry cache handling code
+1 -3
fs/ocfs2/dcache.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dcache.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/dir.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dir.c 6 4 * 7 5 * Creates, reads, walks and deletes directory-nodes
+1 -3
fs/ocfs2/dir.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dir.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/dlm/dlmapi.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmapi.h 6 4 * 7 5 * externally exported dlm interfaces
+1 -3
fs/ocfs2/dlm/dlmast.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmast.c 6 4 * 7 5 * AST and BAST functionality for local and remote nodes
+1 -3
fs/ocfs2/dlm/dlmcommon.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmcommon.h 6 4 * 7 5 * Copyright (C) 2004 Oracle. All rights reserved.
+1 -3
fs/ocfs2/dlm/dlmconvert.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmconvert.c 6 4 * 7 5 * underlying calls for lock conversion
+1 -3
fs/ocfs2/dlm/dlmconvert.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmconvert.h 6 4 * 7 5 * Copyright (C) 2004 Oracle. All rights reserved.
+1 -3
fs/ocfs2/dlm/dlmdebug.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmdebug.c 6 4 * 7 5 * debug functionality for the dlm
+1 -3
fs/ocfs2/dlm/dlmdebug.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmdebug.h 6 4 * 7 5 * Copyright (C) 2008 Oracle. All rights reserved.
+1 -3
fs/ocfs2/dlm/dlmdomain.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmdomain.c 6 4 * 7 5 * defines domain join / leave apis
+1 -3
fs/ocfs2/dlm/dlmdomain.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmdomain.h 6 4 * 7 5 * Copyright (C) 2004 Oracle. All rights reserved.
+1 -3
fs/ocfs2/dlm/dlmlock.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmlock.c 6 4 * 7 5 * underlying calls for lock creation
+1 -3
fs/ocfs2/dlm/dlmmaster.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmmod.c 6 4 * 7 5 * standalone DLM module
+1 -3
fs/ocfs2/dlm/dlmrecovery.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmrecovery.c 6 4 * 7 5 * recovery stuff
+1 -3
fs/ocfs2/dlm/dlmthread.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmthread.c 6 4 * 7 5 * standalone DLM module
+1 -3
fs/ocfs2/dlm/dlmunlock.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmunlock.c 6 4 * 7 5 * underlying calls for unlocking locks
+1 -3
fs/ocfs2/dlmfs/dlmfs.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmfs.c 6 4 * 7 5 * Code which implements the kernel side of a minimal userspace
+1 -3
fs/ocfs2/dlmfs/userdlm.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * userdlm.c 6 4 * 7 5 * Code which implements the kernel side of a minimal userspace
+1 -3
fs/ocfs2/dlmfs/userdlm.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * userdlm.h 6 4 * 7 5 * Userspace dlm defines
+1 -3
fs/ocfs2/dlmglue.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmglue.c 6 4 * 7 5 * Code which implements an OCFS2 specific interface to our DLM.
+1 -3
fs/ocfs2/dlmglue.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * dlmglue.h 6 4 * 7 5 * description here
+1 -3
fs/ocfs2/export.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * export.c 6 4 * 7 5 * Functions to facilitate NFS exporting
+1 -3
fs/ocfs2/export.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * export.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/extent_map.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * extent_map.c 6 4 * 7 5 * Block/Cluster mapping functions
+1 -3
fs/ocfs2/extent_map.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * extent_map.h 6 4 * 7 5 * In-memory file extent mappings for OCFS2.
+1 -3
fs/ocfs2/file.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * file.c 6 4 * 7 5 * File open, close, extend, truncate
+1 -3
fs/ocfs2/file.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * file.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/filecheck.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * filecheck.c 6 4 * 7 5 * Code which implements online file check.
+1 -3
fs/ocfs2/filecheck.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * filecheck.h 6 4 * 7 5 * Online file check.
+1 -3
fs/ocfs2/heartbeat.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * heartbeat.c 6 4 * 7 5 * Register ourselves with the heartbaet service, keep our node maps
+1 -3
fs/ocfs2/heartbeat.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * heartbeat.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/inode.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * inode.c 6 4 * 7 5 * vfs' aops, fops, dops and iops
+1 -3
fs/ocfs2/inode.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * inode.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/journal.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * journal.c 6 4 * 7 5 * Defines functions of journalling api
+1 -3
fs/ocfs2/journal.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * journal.h 6 4 * 7 5 * Defines journalling api and structures.
+1 -3
fs/ocfs2/localalloc.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * localalloc.c 6 4 * 7 5 * Node local data allocation
+1 -3
fs/ocfs2/localalloc.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * localalloc.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/locks.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * locks.c 6 4 * 7 5 * Userspace file locking support
+1 -3
fs/ocfs2/locks.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * locks.h 6 4 * 7 5 * Function prototypes for Userspace file locking support
+1 -3
fs/ocfs2/mmap.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * mmap.c 6 4 * 7 5 * Code to deal with the mess that is clustered mmap.
+1 -3
fs/ocfs2/move_extents.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * move_extents.c 6 4 * 7 5 * Copyright (C) 2011 Oracle. All rights reserved.
+1 -3
fs/ocfs2/move_extents.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * move_extents.h 6 4 * 7 5 * Copyright (C) 2011 Oracle. All rights reserved.
+1 -3
fs/ocfs2/namei.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * namei.c 6 4 * 7 5 * Create and rename file, directory, symlinks
+1 -3
fs/ocfs2/namei.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * namei.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/ocfs1_fs_compat.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * ocfs1_fs_compat.h 6 4 * 7 5 * OCFS1 volume header definitions. OCFS2 creates valid but unmountable
+1 -3
fs/ocfs2/ocfs2.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * ocfs2.h 6 4 * 7 5 * Defines macros and structures used in OCFS2
+1 -3
fs/ocfs2/ocfs2_fs.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * ocfs2_fs.h 6 4 * 7 5 * On-disk structures for OCFS2.
+1 -3
fs/ocfs2/ocfs2_ioctl.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * ocfs2_ioctl.h 6 4 * 7 5 * Defines OCFS2 ioctls.
+1 -3
fs/ocfs2/ocfs2_lockid.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * ocfs2_lockid.h 6 4 * 7 5 * Defines OCFS2 lockid bits.
+1 -3
fs/ocfs2/ocfs2_lockingver.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * ocfs2_lockingver.h 6 4 * 7 5 * Defines OCFS2 Locking version values.
+1 -3
fs/ocfs2/refcounttree.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * refcounttree.c 6 4 * 7 5 * Copyright (C) 2009 Oracle. All rights reserved.
+1 -3
fs/ocfs2/refcounttree.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * refcounttree.h 6 4 * 7 5 * Copyright (C) 2009 Oracle. All rights reserved.
+1 -3
fs/ocfs2/reservations.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * reservations.c 6 4 * 7 5 * Allocation reservations implementation
+1 -3
fs/ocfs2/reservations.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * reservations.h 6 4 * 7 5 * Allocation reservations function prototypes and structures.
+1 -3
fs/ocfs2/resize.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * resize.c 6 4 * 7 5 * volume resize.
+1 -3
fs/ocfs2/resize.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * resize.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/slot_map.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * slot_map.c 6 4 * 7 5 * Copyright (C) 2002, 2004 Oracle. All rights reserved.
+1 -3
fs/ocfs2/slot_map.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * slotmap.h 6 4 * 7 5 * description here
+1 -3
fs/ocfs2/stack_o2cb.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * stack_o2cb.c 6 4 * 7 5 * Code which interfaces ocfs2 with the o2cb stack.
+1 -3
fs/ocfs2/stack_user.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * stack_user.c 6 4 * 7 5 * Code which interfaces ocfs2 with fs/dlm and a userspace stack.
+1 -3
fs/ocfs2/stackglue.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * stackglue.c 6 4 * 7 5 * Code which implements an OCFS2 specific interface to underlying
+1 -3
fs/ocfs2/stackglue.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * stackglue.h 6 4 * 7 5 * Glue to the underlying cluster stack.
+1 -3
fs/ocfs2/suballoc.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * suballoc.c 6 4 * 7 5 * metadata alloc and free
+1 -3
fs/ocfs2/suballoc.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * suballoc.h 6 4 * 7 5 * Defines sub allocator api
+1 -3
fs/ocfs2/super.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * super.c 6 4 * 7 5 * load/unload driver, mount/dismount volumes
+1 -3
fs/ocfs2/super.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * super.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/symlink.c
··· 1 - /* -*- mode: c; c-basic-offset: 8; -*- 2 - * vim: noexpandtab sw=8 ts=8 sts=0: 3 - * 1 + /* 4 2 * linux/cluster/ssi/cfs/symlink.c 5 3 * 6 4 * This program is free software; you can redistribute it and/or
+1 -3
fs/ocfs2/symlink.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * symlink.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/sysfile.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * sysfile.c 6 4 * 7 5 * Initialize, read, write, etc. system files.
+1 -3
fs/ocfs2/sysfile.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * sysfile.h 6 4 * 7 5 * Function prototypes
+1 -3
fs/ocfs2/uptodate.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * uptodate.c 6 4 * 7 5 * Tracking the up-to-date-ness of a local buffer_head with respect to
+1 -3
fs/ocfs2/uptodate.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * uptodate.h 6 4 * 7 5 * Cluster uptodate tracking
+1 -3
fs/ocfs2/xattr.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * xattr.c 6 4 * 7 5 * Copyright (C) 2004, 2008 Oracle. All rights reserved.
+1 -3
fs/ocfs2/xattr.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * xattr.h 6 4 * 7 5 * Copyright (C) 2004, 2008 Oracle. All rights reserved.
+3 -10
fs/proc/generic.c
··· 166 166 const char *cp = name, *next; 167 167 struct proc_dir_entry *de; 168 168 169 - de = *ret; 170 - if (!de) 171 - de = &proc_root; 172 - 173 - while (1) { 174 - next = strchr(cp, '/'); 175 - if (!next) 176 - break; 177 - 169 + de = *ret ?: &proc_root; 170 + while ((next = strchr(cp, '/')) != NULL) { 178 171 de = pde_subdir_find(de, cp, next - cp); 179 172 if (!de) { 180 173 WARN(1, "name '%s'\n", name); ··· 749 756 while (1) { 750 757 next = pde_subdir_first(de); 751 758 if (next) { 752 - if (unlikely(pde_is_permanent(root))) { 759 + if (unlikely(pde_is_permanent(next))) { 753 760 write_unlock(&proc_subdir_lock); 754 761 WARN(1, "removing permanent /proc entry '%s/%s'", 755 762 next->parent->name, next->name);
+2 -16
fs/proc/inode.c
··· 273 273 spin_unlock(&de->pde_unload_lock); 274 274 } 275 275 276 - static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence) 277 - { 278 - typeof_member(struct proc_ops, proc_lseek) lseek; 279 - 280 - lseek = pde->proc_ops->proc_lseek; 281 - if (!lseek) 282 - lseek = default_llseek; 283 - return lseek(file, offset, whence); 284 - } 285 - 286 276 static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence) 287 277 { 288 278 struct proc_dir_entry *pde = PDE(file_inode(file)); 289 279 loff_t rv = -EINVAL; 290 280 291 281 if (pde_is_permanent(pde)) { 292 - return pde_lseek(pde, file, offset, whence); 282 + return pde->proc_ops->proc_lseek(file, offset, whence); 293 283 } else if (use_pde(pde)) { 294 - rv = pde_lseek(pde, file, offset, whence); 284 + rv = pde->proc_ops->proc_lseek(file, offset, whence); 295 285 unuse_pde(pde); 296 286 } 297 287 return rv; ··· 483 493 484 494 static int proc_reg_open(struct inode *inode, struct file *file) 485 495 { 486 - struct proc_fs_info *fs_info = proc_sb_info(inode->i_sb); 487 496 struct proc_dir_entry *pde = PDE(inode); 488 497 int rv = 0; 489 498 typeof_member(struct proc_ops, proc_open) open; ··· 495 506 rv = open(inode, file); 496 507 return rv; 497 508 } 498 - 499 - if (fs_info->pidonly == PROC_PIDONLY_ON) 500 - return -ENOENT; 501 509 502 510 /* 503 511 * Ensure that
+1 -1
fs/proc/proc_sysctl.c
··· 1563 1563 } 1564 1564 1565 1565 /** 1566 - * register_sysctl_table_path - register a sysctl table hierarchy 1566 + * register_sysctl_paths - register a sysctl table hierarchy 1567 1567 * @path: The path to the directory the sysctl table is in. 1568 1568 * @table: the top-level table structure 1569 1569 *
-10
fs/reiserfs/procfs.c
··· 488 488 * (available at http://www.namesys.com/legalese.html) 489 489 * 490 490 */ 491 - 492 - /* 493 - * Make Linus happy. 494 - * Local variables: 495 - * c-indentation-style: "K&R" 496 - * mode-name: "LC" 497 - * c-basic-offset: 8 498 - * tab-width: 8 499 - * End: 500 - */
+98 -10
include/asm-generic/bitops/find.h
··· 2 2 #ifndef _ASM_GENERIC_BITOPS_FIND_H_ 3 3 #define _ASM_GENERIC_BITOPS_FIND_H_ 4 4 5 + extern unsigned long _find_next_bit(const unsigned long *addr1, 6 + const unsigned long *addr2, unsigned long nbits, 7 + unsigned long start, unsigned long invert, unsigned long le); 8 + extern unsigned long _find_first_bit(const unsigned long *addr, unsigned long size); 9 + extern unsigned long _find_first_zero_bit(const unsigned long *addr, unsigned long size); 10 + extern unsigned long _find_last_bit(const unsigned long *addr, unsigned long size); 11 + 5 12 #ifndef find_next_bit 6 13 /** 7 14 * find_next_bit - find the next set bit in a memory region ··· 19 12 * Returns the bit number for the next set bit 20 13 * If no bits are set, returns @size. 21 14 */ 22 - extern unsigned long find_next_bit(const unsigned long *addr, unsigned long 23 - size, unsigned long offset); 15 + static inline 16 + unsigned long find_next_bit(const unsigned long *addr, unsigned long size, 17 + unsigned long offset) 18 + { 19 + if (small_const_nbits(size)) { 20 + unsigned long val; 21 + 22 + if (unlikely(offset >= size)) 23 + return size; 24 + 25 + val = *addr & GENMASK(size - 1, offset); 26 + return val ? __ffs(val) : size; 27 + } 28 + 29 + return _find_next_bit(addr, NULL, size, offset, 0UL, 0); 30 + } 24 31 #endif 25 32 26 33 #ifndef find_next_and_bit ··· 48 27 * Returns the bit number for the next set bit 49 28 * If no bits are set, returns @size. 50 29 */ 51 - extern unsigned long find_next_and_bit(const unsigned long *addr1, 30 + static inline 31 + unsigned long find_next_and_bit(const unsigned long *addr1, 52 32 const unsigned long *addr2, unsigned long size, 53 - unsigned long offset); 33 + unsigned long offset) 34 + { 35 + if (small_const_nbits(size)) { 36 + unsigned long val; 37 + 38 + if (unlikely(offset >= size)) 39 + return size; 40 + 41 + val = *addr1 & *addr2 & GENMASK(size - 1, offset); 42 + return val ? __ffs(val) : size; 43 + } 44 + 45 + return _find_next_bit(addr1, addr2, size, offset, 0UL, 0); 46 + } 54 47 #endif 55 48 56 49 #ifndef find_next_zero_bit ··· 77 42 * Returns the bit number of the next zero bit 78 43 * If no bits are zero, returns @size. 79 44 */ 80 - extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned 81 - long size, unsigned long offset); 45 + static inline 46 + unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, 47 + unsigned long offset) 48 + { 49 + if (small_const_nbits(size)) { 50 + unsigned long val; 51 + 52 + if (unlikely(offset >= size)) 53 + return size; 54 + 55 + val = *addr | ~GENMASK(size - 1, offset); 56 + return val == ~0UL ? size : ffz(val); 57 + } 58 + 59 + return _find_next_bit(addr, NULL, size, offset, ~0UL, 0); 60 + } 82 61 #endif 83 62 84 63 #ifdef CONFIG_GENERIC_FIND_FIRST_BIT ··· 105 56 * Returns the bit number of the first set bit. 106 57 * If no bits are set, returns @size. 107 58 */ 108 - extern unsigned long find_first_bit(const unsigned long *addr, 109 - unsigned long size); 59 + static inline 60 + unsigned long find_first_bit(const unsigned long *addr, unsigned long size) 61 + { 62 + if (small_const_nbits(size)) { 63 + unsigned long val = *addr & GENMASK(size - 1, 0); 64 + 65 + return val ? __ffs(val) : size; 66 + } 67 + 68 + return _find_first_bit(addr, size); 69 + } 110 70 111 71 /** 112 72 * find_first_zero_bit - find the first cleared bit in a memory region ··· 125 67 * Returns the bit number of the first cleared bit. 126 68 * If no bits are zero, returns @size. 127 69 */ 128 - extern unsigned long find_first_zero_bit(const unsigned long *addr, 129 - unsigned long size); 70 + static inline 71 + unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size) 72 + { 73 + if (small_const_nbits(size)) { 74 + unsigned long val = *addr | ~GENMASK(size - 1, 0); 75 + 76 + return val == ~0UL ? size : ffz(val); 77 + } 78 + 79 + return _find_first_zero_bit(addr, size); 80 + } 130 81 #else /* CONFIG_GENERIC_FIND_FIRST_BIT */ 131 82 132 83 #ifndef find_first_bit ··· 146 79 #endif 147 80 148 81 #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */ 82 + 83 + #ifndef find_last_bit 84 + /** 85 + * find_last_bit - find the last set bit in a memory region 86 + * @addr: The address to start the search at 87 + * @size: The number of bits to search 88 + * 89 + * Returns the bit number of the last set bit, or size. 90 + */ 91 + static inline 92 + unsigned long find_last_bit(const unsigned long *addr, unsigned long size) 93 + { 94 + if (small_const_nbits(size)) { 95 + unsigned long val = *addr & GENMASK(size - 1, 0); 96 + 97 + return val ? __fls(val) : size; 98 + } 99 + 100 + return _find_last_bit(addr, size); 101 + } 102 + #endif 149 103 150 104 /** 151 105 * find_next_clump8 - find next 8-bit clump with set bits in a memory region
+34 -4
include/asm-generic/bitops/le.h
··· 2 2 #ifndef _ASM_GENERIC_BITOPS_LE_H_ 3 3 #define _ASM_GENERIC_BITOPS_LE_H_ 4 4 5 + #include <asm-generic/bitops/find.h> 5 6 #include <asm/types.h> 6 7 #include <asm/byteorder.h> 8 + #include <linux/swab.h> 7 9 8 10 #if defined(__LITTLE_ENDIAN) 9 11 ··· 34 32 #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) 35 33 36 34 #ifndef find_next_zero_bit_le 37 - extern unsigned long find_next_zero_bit_le(const void *addr, 38 - unsigned long size, unsigned long offset); 35 + static inline 36 + unsigned long find_next_zero_bit_le(const void *addr, unsigned 37 + long size, unsigned long offset) 38 + { 39 + if (small_const_nbits(size)) { 40 + unsigned long val = *(const unsigned long *)addr; 41 + 42 + if (unlikely(offset >= size)) 43 + return size; 44 + 45 + val = swab(val) | ~GENMASK(size - 1, offset); 46 + return val == ~0UL ? size : ffz(val); 47 + } 48 + 49 + return _find_next_bit(addr, NULL, size, offset, ~0UL, 1); 50 + } 39 51 #endif 40 52 41 53 #ifndef find_next_bit_le 42 - extern unsigned long find_next_bit_le(const void *addr, 43 - unsigned long size, unsigned long offset); 54 + static inline 55 + unsigned long find_next_bit_le(const void *addr, unsigned 56 + long size, unsigned long offset) 57 + { 58 + if (small_const_nbits(size)) { 59 + unsigned long val = *(const unsigned long *)addr; 60 + 61 + if (unlikely(offset >= size)) 62 + return size; 63 + 64 + val = swab(val) & GENMASK(size - 1, offset); 65 + return val ? __ffs(val) : size; 66 + } 67 + 68 + return _find_next_bit(addr, NULL, size, offset, 0UL, 1); 69 + } 44 70 #endif 45 71 46 72 #ifndef find_first_zero_bit_le
+12
include/asm-generic/bitsperlong.h
··· 23 23 #define BITS_PER_LONG_LONG 64 24 24 #endif 25 25 26 + /* 27 + * small_const_nbits(n) is true precisely when it is known at compile-time 28 + * that BITMAP_SIZE(n) is 1, i.e. 1 <= n <= BITS_PER_LONG. This allows 29 + * various bit/bitmap APIs to provide a fast inline implementation. Bitmaps 30 + * of size 0 are very rare, and a compile-time-known-size 0 is most likely 31 + * a sign of error. They will be handled correctly by the bit/bitmap APIs, 32 + * but using the out-of-line functions, so that the inline implementations 33 + * can unconditionally dereference the pointer(s). 34 + */ 35 + #define small_const_nbits(nbits) \ 36 + (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG && (nbits) > 0) 37 + 26 38 #endif /* __ASM_GENERIC_BITS_PER_LONG */
-11
include/asm-generic/io.h
··· 1064 1064 #endif 1065 1065 #endif /* CONFIG_GENERIC_IOMAP */ 1066 1066 1067 - /* 1068 - * Convert a virtual cached pointer to an uncached pointer 1069 - */ 1070 - #ifndef xlate_dev_kmem_ptr 1071 - #define xlate_dev_kmem_ptr xlate_dev_kmem_ptr 1072 - static inline void *xlate_dev_kmem_ptr(void *addr) 1073 - { 1074 - return addr; 1075 - } 1076 - #endif 1077 - 1078 1067 #ifndef xlate_dev_mem_ptr 1079 1068 #define xlate_dev_mem_ptr xlate_dev_mem_ptr 1080 1069 static inline void *xlate_dev_mem_ptr(phys_addr_t addr)
+15
include/linux/align.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _LINUX_ALIGN_H 3 + #define _LINUX_ALIGN_H 4 + 5 + #include <linux/const.h> 6 + 7 + /* @a is a power of 2 value */ 8 + #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) 9 + #define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a)) 10 + #define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask)) 11 + #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) 12 + #define PTR_ALIGN_DOWN(p, a) ((typeof(p))ALIGN_DOWN((unsigned long)(p), (a))) 13 + #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) 14 + 15 + #endif /* _LINUX_ALIGN_H */
-1
include/linux/async.h
··· 112 112 return async_schedule_node_domain(func, dev, dev_to_node(dev), domain); 113 113 } 114 114 115 - void async_unregister_domain(struct async_domain *domain); 116 115 extern void async_synchronize_full(void); 117 116 extern void async_synchronize_full_domain(struct async_domain *domain); 118 117 extern void async_synchronize_cookie(async_cookie_t cookie);
+2 -9
include/linux/bitmap.h
··· 4 4 5 5 #ifndef __ASSEMBLY__ 6 6 7 + #include <linux/align.h> 7 8 #include <linux/bitops.h> 8 - #include <linux/kernel.h> 9 + #include <linux/limits.h> 9 10 #include <linux/string.h> 10 11 #include <linux/types.h> 11 12 ··· 229 228 230 229 #define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1))) 231 230 #define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1))) 232 - 233 - /* 234 - * The static inlines below do not handle constant nbits==0 correctly, 235 - * so make such users (should any ever turn up) call the out-of-line 236 - * versions. 237 - */ 238 - #define small_const_nbits(nbits) \ 239 - (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG && (nbits) > 0) 240 231 241 232 static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) 242 233 {
-12
include/linux/bitops.h
··· 286 286 }) 287 287 #endif 288 288 289 - #ifndef find_last_bit 290 - /** 291 - * find_last_bit - find the last set bit in a memory region 292 - * @addr: The address to start the search at 293 - * @size: The number of bits to search 294 - * 295 - * Returns the bit number of the last set bit, or size. 296 - */ 297 - extern unsigned long find_last_bit(const unsigned long *addr, 298 - unsigned long size); 299 - #endif 300 - 301 289 #endif /* __KERNEL__ */ 302 290 #endif
-1
include/linux/blkdev.h
··· 11 11 #include <linux/minmax.h> 12 12 #include <linux/timer.h> 13 13 #include <linux/workqueue.h> 14 - #include <linux/pagemap.h> 15 14 #include <linux/backing-dev-defs.h> 16 15 #include <linux/wait.h> 17 16 #include <linux/mempool.h>
-1
include/linux/compat.h
··· 75 75 __diag_push(); \ 76 76 __diag_ignore(GCC, 8, "-Wattribute-alias", \ 77 77 "Type aliasing is used to sanitize syscall arguments");\ 78 - asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ 79 78 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ 80 79 __attribute__((alias(__stringify(__se_compat_sys##name)))); \ 81 80 ALLOW_ERROR_INJECTION(compat_sys##name, ERRNO); \
+1 -3
include/linux/configfs.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* -*- mode: c; c-basic-offset: 8; -*- 3 - * vim: noexpandtab sw=8 ts=8 sts=0: 4 - * 2 + /* 5 3 * configfs.h - definitions for the device driver filesystem 6 4 * 7 5 * Based on sysfs:
+1 -1
include/linux/crc8.h
··· 96 96 * Williams, Ross N., ross<at>ross.net 97 97 * (see URL http://www.ross.net/crc/download/crc_v3.txt). 98 98 */ 99 - u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc); 99 + u8 crc8(const u8 table[CRC8_TABLE_SIZE], const u8 *pdata, size_t nbytes, u8 crc); 100 100 101 101 #endif /* __CRC8_H_ */
-1
include/linux/cred.h
··· 53 53 groups_free(group_info); \ 54 54 } while (0) 55 55 56 - extern struct group_info init_groups; 57 56 #ifdef CONFIG_MULTIUSER 58 57 extern struct group_info *groups_alloc(int); 59 58 extern void groups_free(struct group_info *);
+10 -10
include/linux/delayacct.h
··· 82 82 return 0; 83 83 } 84 84 85 - static inline void delayacct_set_flag(int flag) 85 + static inline void delayacct_set_flag(struct task_struct *p, int flag) 86 86 { 87 - if (current->delays) 88 - current->delays->flags |= flag; 87 + if (p->delays) 88 + p->delays->flags |= flag; 89 89 } 90 90 91 - static inline void delayacct_clear_flag(int flag) 91 + static inline void delayacct_clear_flag(struct task_struct *p, int flag) 92 92 { 93 - if (current->delays) 94 - current->delays->flags &= ~flag; 93 + if (p->delays) 94 + p->delays->flags &= ~flag; 95 95 } 96 96 97 97 static inline void delayacct_tsk_init(struct task_struct *tsk) ··· 114 114 115 115 static inline void delayacct_blkio_start(void) 116 116 { 117 - delayacct_set_flag(DELAYACCT_PF_BLKIO); 117 + delayacct_set_flag(current, DELAYACCT_PF_BLKIO); 118 118 if (current->delays) 119 119 __delayacct_blkio_start(); 120 120 } ··· 123 123 { 124 124 if (p->delays) 125 125 __delayacct_blkio_end(p); 126 - delayacct_clear_flag(DELAYACCT_PF_BLKIO); 126 + delayacct_clear_flag(p, DELAYACCT_PF_BLKIO); 127 127 } 128 128 129 129 static inline int delayacct_add_tsk(struct taskstats *d, ··· 166 166 } 167 167 168 168 #else 169 - static inline void delayacct_set_flag(int flag) 169 + static inline void delayacct_set_flag(struct task_struct *p, int flag) 170 170 {} 171 - static inline void delayacct_clear_flag(int flag) 171 + static inline void delayacct_clear_flag(struct task_struct *p, int flag) 172 172 {} 173 173 static inline void delayacct_init(void) 174 174 {}
+1 -1
include/linux/fs.h
··· 145 145 /* Expect random access pattern */ 146 146 #define FMODE_RANDOM ((__force fmode_t)0x1000) 147 147 148 - /* File is huge (eg. /dev/kmem): treat loff_t as unsigned */ 148 + /* File is huge (eg. /dev/mem): treat loff_t as unsigned */ 149 149 #define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000) 150 150 151 151 /* File is opened with O_PATH; almost nothing can be done with it */
-1
include/linux/genl_magic_func.h
··· 404 404 405 405 /* }}}1 */ 406 406 #endif /* GENL_MAGIC_FUNC_H */ 407 - /* vim: set foldmethod=marker foldlevel=1 nofoldenable : */
-1
include/linux/genl_magic_struct.h
··· 283 283 284 284 /* }}}1 */ 285 285 #endif /* GENL_MAGIC_STRUCT_H */ 286 - /* vim: set foldmethod=marker nofoldenable : */
+1 -1
include/linux/gfp.h
··· 490 490 491 491 /* 492 492 * We get the zone list from the current node and the gfp_mask. 493 - * This zone list contains a maximum of MAXNODES*MAX_NR_ZONES zones. 493 + * This zone list contains a maximum of MAX_NUMNODES*MAX_NR_ZONES zones. 494 494 * There are two zonelists per node, one for all zones with memory and 495 495 * one containing just zones from the node the zonelist belongs to. 496 496 *
-1
include/linux/init_task.h
··· 25 25 extern struct files_struct init_files; 26 26 extern struct fs_struct init_fs; 27 27 extern struct nsproxy init_nsproxy; 28 - extern struct group_info init_groups; 29 28 extern struct cred init_cred; 30 29 31 30 #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
+2
include/linux/initrd.h
··· 20 20 21 21 #ifdef CONFIG_BLK_DEV_INITRD 22 22 extern void __init reserve_initrd_mem(void); 23 + extern void wait_for_initramfs(void); 23 24 #else 24 25 static inline void __init reserve_initrd_mem(void) {} 26 + static inline void wait_for_initramfs(void) {} 25 27 #endif 26 28 27 29 extern phys_addr_t phys_initrd_start;
+1 -8
include/linux/kernel.h
··· 3 3 #define _LINUX_KERNEL_H 4 4 5 5 #include <stdarg.h> 6 + #include <linux/align.h> 6 7 #include <linux/limits.h> 7 8 #include <linux/linkage.h> 8 9 #include <linux/stddef.h> ··· 30 29 * NOTE: @x is not checked for > 0xff; larger values produce odd results. 31 30 */ 32 31 #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) 33 - 34 - /* @a is a power of 2 value */ 35 - #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) 36 - #define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a)) 37 - #define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask)) 38 - #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) 39 - #define PTR_ALIGN_DOWN(p, a) ((typeof(p))ALIGN_DOWN((unsigned long)(p), (a))) 40 - #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) 41 32 42 33 /* generic data direction definitions */ 43 34 #define READ 0
+1 -1
include/linux/mm.h
··· 106 106 * embedding these tags into addresses that point to these memory regions, and 107 107 * checking that the memory and the pointer tags match on memory accesses) 108 108 * redefine this macro to strip tags from pointers. 109 - * It's defined as noop for arcitectures that don't support memory tagging. 109 + * It's defined as noop for architectures that don't support memory tagging. 110 110 */ 111 111 #ifndef untagged_addr 112 112 #define untagged_addr(addr) (addr)
+1 -1
include/linux/mmzone.h
··· 55 55 * pageblocks to MIGRATE_CMA which can be done by 56 56 * __free_pageblock_cma() function. What is important though 57 57 * is that a range of pageblocks must be aligned to 58 - * MAX_ORDER_NR_PAGES should biggest page be bigger then 58 + * MAX_ORDER_NR_PAGES should biggest page be bigger than 59 59 * a single pageblock. 60 60 */ 61 61 MIGRATE_CMA,
+5 -5
include/linux/pgtable.h
··· 426 426 427 427 /* 428 428 * On some architectures hardware does not set page access bit when accessing 429 - * memory page, it is responsibilty of software setting this bit. It brings 429 + * memory page, it is responsibility of software setting this bit. It brings 430 430 * out extra page fault penalty to track page access bit. For optimization page 431 431 * access bit can be set during all page fault flow on these arches. 432 432 * To be differentiate with macro pte_mkyoung, this macro is used on platforms ··· 519 519 /* 520 520 * This is an implementation of pmdp_establish() that is only suitable for an 521 521 * architecture that doesn't have hardware dirty/accessed bits. In this case we 522 - * can't race with CPU which sets these bits and non-atomic aproach is fine. 522 + * can't race with CPU which sets these bits and non-atomic approach is fine. 523 523 */ 524 524 static inline pmd_t generic_pmdp_establish(struct vm_area_struct *vma, 525 525 unsigned long address, pmd_t *pmdp, pmd_t pmd) ··· 852 852 * updates, but to prevent any updates it may make from being lost. 853 853 * 854 854 * This does not protect against other software modifications of the 855 - * pte; the appropriate pte lock must be held over the transation. 855 + * pte; the appropriate pte lock must be held over the transaction. 856 856 * 857 857 * Note that this interface is intended to be batchable, meaning that 858 858 * ptep_modify_prot_commit may not actually update the pte, but merely ··· 1281 1281 * 1282 1282 * The complete check uses is_pmd_migration_entry() in linux/swapops.h 1283 1283 * But using that requires moving current function and pmd_trans_unstable() 1284 - * to linux/swapops.h to resovle dependency, which is too much code move. 1284 + * to linux/swapops.h to resolve dependency, which is too much code move. 1285 1285 * 1286 1286 * !pmd_present() is equivalent to is_pmd_migration_entry() currently, 1287 1287 * because !pmd_present() pages can only be under migration not swapped 1288 1288 * out. 1289 1289 * 1290 - * pmd_none() is preseved for future condition checks on pmd migration 1290 + * pmd_none() is preserved for future condition checks on pmd migration 1291 1291 * entries and not confusing with this function name, although it is 1292 1292 * redundant with !pmd_present(). 1293 1293 */
+1
include/linux/proc_fs.h
··· 32 32 ssize_t (*proc_read)(struct file *, char __user *, size_t, loff_t *); 33 33 ssize_t (*proc_read_iter)(struct kiocb *, struct iov_iter *); 34 34 ssize_t (*proc_write)(struct file *, const char __user *, size_t, loff_t *); 35 + /* mandatory unless nonseekable_open() or equivalent is used */ 35 36 loff_t (*proc_lseek)(struct file *, loff_t, int); 36 37 int (*proc_release)(struct inode *, struct file *); 37 38 __poll_t (*proc_poll)(struct file *, struct poll_table_struct *);
-3
include/linux/profile.h
··· 15 15 #define KVM_PROFILING 4 16 16 17 17 struct proc_dir_entry; 18 - struct pt_regs; 19 18 struct notifier_block; 20 19 21 20 #if defined(CONFIG_PROFILING) && defined(CONFIG_PROC_FS) ··· 82 83 83 84 int profile_event_register(enum profile_type, struct notifier_block * n); 84 85 int profile_event_unregister(enum profile_type, struct notifier_block * n); 85 - 86 - struct pt_regs; 87 86 88 87 #else 89 88
+8
include/linux/smp.h
··· 56 56 int smp_call_function_single_async(int cpu, call_single_data_t *csd); 57 57 58 58 /* 59 + * Cpus stopping functions in panic. All have default weak definitions. 60 + * Architecture-dependent code may override them. 61 + */ 62 + void panic_smp_self_stop(void); 63 + void nmi_panic_self_stop(struct pt_regs *regs); 64 + void crash_smp_send_stop(void); 65 + 66 + /* 59 67 * Call a function on all processors 60 68 */ 61 69 static inline void on_each_cpu(smp_call_func_t func, void *info, int wait)
+1
include/linux/swap.h
··· 10 10 #include <linux/sched.h> 11 11 #include <linux/node.h> 12 12 #include <linux/fs.h> 13 + #include <linux/pagemap.h> 13 14 #include <linux/atomic.h> 14 15 #include <linux/page-flags.h> 15 16 #include <uapi/linux/mempolicy.h>
+3 -4
include/linux/vmalloc.h
··· 33 33 * 34 34 * If IS_ENABLED(CONFIG_KASAN_VMALLOC), VM_KASAN is set on a vm_struct after 35 35 * shadow memory has been mapped. It's used to handle allocation errors so that 36 - * we don't try to poision shadow on free if it was never allocated. 36 + * we don't try to poison shadow on free if it was never allocated. 37 37 * 38 38 * Otherwise, VM_KASAN is set for kasan_module_alloc() allocations and used to 39 39 * determine which allocations need the module shadow freed. ··· 43 43 44 44 /* 45 45 * Maximum alignment for ioremap() regions. 46 - * Can be overriden by arch-specific value. 46 + * Can be overridden by arch-specific value. 47 47 */ 48 48 #ifndef IOREMAP_MAX_ORDER 49 49 #define IOREMAP_MAX_ORDER (7 + PAGE_SHIFT) /* 128 pages */ ··· 227 227 } 228 228 #endif 229 229 230 - /* for /dev/kmem */ 230 + /* for /proc/kcore */ 231 231 extern long vread(char *buf, char *addr, unsigned long count); 232 - extern long vwrite(char *buf, char *addr, unsigned long count); 233 232 234 233 /* 235 234 * Internals. Dont't use..
-11
include/uapi/linux/if_bonding.h
··· 153 153 #define BOND_3AD_STAT_MAX (__BOND_3AD_STAT_MAX - 1) 154 154 155 155 #endif /* _LINUX_IF_BONDING_H */ 156 - 157 - /* 158 - * Local variables: 159 - * version-control: t 160 - * kept-new-versions: 5 161 - * c-indent-level: 8 162 - * c-basic-offset: 8 163 - * tab-width: 8 164 - * End: 165 - */ 166 -
-6
include/uapi/linux/nfs4.h
··· 178 178 #define NFS4_MAX_BACK_CHANNEL_OPS 2 179 179 180 180 #endif /* _UAPI_LINUX_NFS4_H */ 181 - 182 - /* 183 - * Local variables: 184 - * c-basic-offset: 8 185 - * End: 186 - */
-10
include/xen/interface/elfnote.h
··· 208 208 #define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY 209 209 210 210 #endif /* __XEN_PUBLIC_ELFNOTE_H__ */ 211 - 212 - /* 213 - * Local variables: 214 - * mode: C 215 - * c-set-style: "BSD" 216 - * c-basic-offset: 4 217 - * tab-width: 4 218 - * indent-tabs-mode: nil 219 - * End: 220 - */
-10
include/xen/interface/hvm/hvm_vcpu.h
··· 131 131 typedef struct vcpu_hvm_context vcpu_hvm_context_t; 132 132 133 133 #endif /* __XEN_PUBLIC_HVM_HVM_VCPU_H__ */ 134 - 135 - /* 136 - * Local variables: 137 - * mode: C 138 - * c-file-style: "BSD" 139 - * c-basic-offset: 4 140 - * tab-width: 4 141 - * indent-tabs-mode: nil 142 - * End: 143 - */
-10
include/xen/interface/io/xenbus.h
··· 39 39 }; 40 40 41 41 #endif /* _XEN_PUBLIC_IO_XENBUS_H */ 42 - 43 - /* 44 - * Local variables: 45 - * c-file-style: "linux" 46 - * indent-tabs-mode: t 47 - * c-indent-level: 8 48 - * c-basic-offset: 8 49 - * tab-width: 8 50 - * End: 51 - */
+12
init/Kconfig
··· 2299 2299 2300 2300 If unsure, say N. 2301 2301 2302 + config MODPROBE_PATH 2303 + string "Path to modprobe binary" 2304 + default "/sbin/modprobe" 2305 + help 2306 + When kernel code requests a module, it does so by calling 2307 + the "modprobe" userspace utility. This option allows you to 2308 + set the path where that binary is found. This can be changed 2309 + at runtime via the sysctl file 2310 + /proc/sys/kernel/modprobe. Setting this to the empty string 2311 + removes the kernel's ability to request modules (but 2312 + userspace can still load modules explicitly). 2313 + 2302 2314 config TRIM_UNUSED_KSYMS 2303 2315 bool "Trim unused exported kernel symbols" if EXPERT 2304 2316 depends on !COMPILE_TEST
+37 -1
init/initramfs.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <linux/init.h> 3 + #include <linux/async.h> 3 4 #include <linux/fs.h> 4 5 #include <linux/slab.h> 5 6 #include <linux/types.h> ··· 542 541 __setup("keepinitrd", keepinitrd_setup); 543 542 #endif 544 543 544 + static bool __initdata initramfs_async = true; 545 + static int __init initramfs_async_setup(char *str) 546 + { 547 + strtobool(str, &initramfs_async); 548 + return 1; 549 + } 550 + __setup("initramfs_async=", initramfs_async_setup); 551 + 545 552 extern char __initramfs_start[]; 546 553 extern unsigned long __initramfs_size; 547 554 #include <linux/initrd.h> ··· 667 658 } 668 659 #endif /* CONFIG_BLK_DEV_RAM */ 669 660 670 - static int __init populate_rootfs(void) 661 + static void __init do_populate_rootfs(void *unused, async_cookie_t cookie) 671 662 { 672 663 /* Load the built in initramfs */ 673 664 char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size); ··· 702 693 initrd_end = 0; 703 694 704 695 flush_delayed_fput(); 696 + } 697 + 698 + static ASYNC_DOMAIN_EXCLUSIVE(initramfs_domain); 699 + static async_cookie_t initramfs_cookie; 700 + 701 + void wait_for_initramfs(void) 702 + { 703 + if (!initramfs_cookie) { 704 + /* 705 + * Something before rootfs_initcall wants to access 706 + * the filesystem/initramfs. Probably a bug. Make a 707 + * note, avoid deadlocking the machine, and let the 708 + * caller's access fail as it used to. 709 + */ 710 + pr_warn_once("wait_for_initramfs() called before rootfs_initcalls\n"); 711 + return; 712 + } 713 + async_synchronize_cookie_domain(initramfs_cookie + 1, &initramfs_domain); 714 + } 715 + EXPORT_SYMBOL_GPL(wait_for_initramfs); 716 + 717 + static int __init populate_rootfs(void) 718 + { 719 + initramfs_cookie = async_schedule_domain(do_populate_rootfs, NULL, 720 + &initramfs_domain); 721 + if (!initramfs_async) 722 + wait_for_initramfs(); 705 723 return 0; 706 724 } 707 725 rootfs_initcall(populate_rootfs);
+1
init/main.c
··· 1561 1561 1562 1562 kunit_run_all_tests(); 1563 1563 1564 + wait_for_initramfs(); 1564 1565 console_on_rootfs(); 1565 1566 1566 1567 /*
+6 -6
ipc/sem.c
··· 36 36 * - two Linux specific semctl() commands: SEM_STAT, SEM_INFO. 37 37 * - undo adjustments at process exit are limited to 0..SEMVMX. 38 38 * - namespace are supported. 39 - * - SEMMSL, SEMMNS, SEMOPM and SEMMNI can be configured at runtine by writing 39 + * - SEMMSL, SEMMNS, SEMOPM and SEMMNI can be configured at runtime by writing 40 40 * to /proc/sys/kernel/sem. 41 41 * - statistics about the usage are reported in /proc/sysvipc/sem. 42 42 * ··· 224 224 * Setting it to a result code is a RELEASE, this is ensured by both a 225 225 * smp_store_release() (for case a) and while holding sem_lock() 226 226 * (for case b). 227 - * The AQUIRE when reading the result code without holding sem_lock() is 227 + * The ACQUIRE when reading the result code without holding sem_lock() is 228 228 * achieved by using READ_ONCE() + smp_acquire__after_ctrl_dep(). 229 229 * (case a above). 230 230 * Reading the result code while holding sem_lock() needs no further barriers, ··· 786 786 { 787 787 get_task_struct(q->sleeper); 788 788 789 - /* see SEM_BARRIER_2 for purpuse/pairing */ 789 + /* see SEM_BARRIER_2 for purpose/pairing */ 790 790 smp_store_release(&q->status, error); 791 791 792 792 wake_q_add_safe(wake_q, q->sleeper); ··· 821 821 822 822 /* It is impossible that someone waits for the new value: 823 823 * - complex operations always restart. 824 - * - wait-for-zero are handled seperately. 824 + * - wait-for-zero are handled separately. 825 825 * - q is a previously sleeping simple operation that 826 826 * altered the array. It must be a decrement, because 827 827 * simple increments never sleep. ··· 1046 1046 * - No complex ops, thus all sleeping ops are 1047 1047 * decrease. 1048 1048 * - if we decreased the value, then any sleeping 1049 - * semaphore ops wont be able to run: If the 1049 + * semaphore ops won't be able to run: If the 1050 1050 * previous value was too small, then the new 1051 1051 * value will be too small, too. 1052 1052 */ ··· 2108 2108 queue.dupsop = dupsop; 2109 2109 2110 2110 error = perform_atomic_semop(sma, &queue); 2111 - if (error == 0) { /* non-blocking succesfull path */ 2111 + if (error == 0) { /* non-blocking successful path */ 2112 2112 DEFINE_WAKE_Q(wake_q); 2113 2113 2114 2114 /*
+20 -46
kernel/async.c
··· 78 78 79 79 static atomic_t entry_count; 80 80 81 + static long long microseconds_since(ktime_t start) 82 + { 83 + ktime_t now = ktime_get(); 84 + return ktime_to_ns(ktime_sub(now, start)) >> 10; 85 + } 86 + 81 87 static async_cookie_t lowest_in_progress(struct async_domain *domain) 82 88 { 83 89 struct async_entry *first = NULL; ··· 117 111 struct async_entry *entry = 118 112 container_of(work, struct async_entry, work); 119 113 unsigned long flags; 120 - ktime_t calltime, delta, rettime; 114 + ktime_t calltime; 121 115 122 116 /* 1) run (and print duration) */ 123 - if (initcall_debug && system_state < SYSTEM_RUNNING) { 124 - pr_debug("calling %lli_%pS @ %i\n", 125 - (long long)entry->cookie, 126 - entry->func, task_pid_nr(current)); 127 - calltime = ktime_get(); 128 - } 117 + pr_debug("calling %lli_%pS @ %i\n", (long long)entry->cookie, 118 + entry->func, task_pid_nr(current)); 119 + calltime = ktime_get(); 120 + 129 121 entry->func(entry->data, entry->cookie); 130 - if (initcall_debug && system_state < SYSTEM_RUNNING) { 131 - rettime = ktime_get(); 132 - delta = ktime_sub(rettime, calltime); 133 - pr_debug("initcall %lli_%pS returned 0 after %lld usecs\n", 134 - (long long)entry->cookie, 135 - entry->func, 136 - (long long)ktime_to_ns(delta) >> 10); 137 - } 122 + 123 + pr_debug("initcall %lli_%pS returned after %lld usecs\n", 124 + (long long)entry->cookie, entry->func, 125 + microseconds_since(calltime)); 138 126 139 127 /* 2) remove self from the pending queues */ 140 128 spin_lock_irqsave(&async_lock, flags); ··· 246 246 EXPORT_SYMBOL_GPL(async_synchronize_full); 247 247 248 248 /** 249 - * async_unregister_domain - ensure no more anonymous waiters on this domain 250 - * @domain: idle domain to flush out of any async_synchronize_full instances 251 - * 252 - * async_synchronize_{cookie|full}_domain() are not flushed since callers 253 - * of these routines should know the lifetime of @domain 254 - * 255 - * Prefer ASYNC_DOMAIN_EXCLUSIVE() declarations over flushing 256 - */ 257 - void async_unregister_domain(struct async_domain *domain) 258 - { 259 - spin_lock_irq(&async_lock); 260 - WARN_ON(!domain->registered || !list_empty(&domain->pending)); 261 - domain->registered = 0; 262 - spin_unlock_irq(&async_lock); 263 - } 264 - EXPORT_SYMBOL_GPL(async_unregister_domain); 265 - 266 - /** 267 249 * async_synchronize_full_domain - synchronize all asynchronous function within a certain domain 268 250 * @domain: the domain to synchronize 269 251 * ··· 269 287 */ 270 288 void async_synchronize_cookie_domain(async_cookie_t cookie, struct async_domain *domain) 271 289 { 272 - ktime_t starttime, delta, endtime; 290 + ktime_t starttime; 273 291 274 - if (initcall_debug && system_state < SYSTEM_RUNNING) { 275 - pr_debug("async_waiting @ %i\n", task_pid_nr(current)); 276 - starttime = ktime_get(); 277 - } 292 + pr_debug("async_waiting @ %i\n", task_pid_nr(current)); 293 + starttime = ktime_get(); 278 294 279 295 wait_event(async_done, lowest_in_progress(domain) >= cookie); 280 296 281 - if (initcall_debug && system_state < SYSTEM_RUNNING) { 282 - endtime = ktime_get(); 283 - delta = ktime_sub(endtime, starttime); 284 - 285 - pr_debug("async_continuing @ %i after %lli usec\n", 286 - task_pid_nr(current), 287 - (long long)ktime_to_ns(delta) >> 10); 288 - } 297 + pr_debug("async_continuing @ %i after %lli usec\n", task_pid_nr(current), 298 + microseconds_since(starttime)); 289 299 } 290 300 EXPORT_SYMBOL_GPL(async_synchronize_cookie_domain); 291 301
-1
kernel/configs/android-base.config
··· 1 1 # KEEP ALPHABETICALLY SORTED 2 - # CONFIG_DEVKMEM is not set 3 2 # CONFIG_DEVMEM is not set 4 3 # CONFIG_FHANDLE is not set 5 4 # CONFIG_INET_LRO is not set
+1 -1
kernel/cred.c
··· 33 33 static struct kmem_cache *cred_jar; 34 34 35 35 /* init to 2 - one for init_task, one to ensure it is never freed */ 36 - struct group_info init_groups = { .usage = ATOMIC_INIT(2) }; 36 + static struct group_info init_groups = { .usage = ATOMIC_INIT(2) }; 37 37 38 38 /* 39 39 * The initial credentials for the initial task
+57 -10
kernel/exit.c
··· 1440 1440 TASK_INTERRUPTIBLE, p); 1441 1441 } 1442 1442 1443 + static bool is_effectively_child(struct wait_opts *wo, bool ptrace, 1444 + struct task_struct *target) 1445 + { 1446 + struct task_struct *parent = 1447 + !ptrace ? target->real_parent : target->parent; 1448 + 1449 + return current == parent || (!(wo->wo_flags & __WNOTHREAD) && 1450 + same_thread_group(current, parent)); 1451 + } 1452 + 1453 + /* 1454 + * Optimization for waiting on PIDTYPE_PID. No need to iterate through child 1455 + * and tracee lists to find the target task. 1456 + */ 1457 + static int do_wait_pid(struct wait_opts *wo) 1458 + { 1459 + bool ptrace; 1460 + struct task_struct *target; 1461 + int retval; 1462 + 1463 + ptrace = false; 1464 + target = pid_task(wo->wo_pid, PIDTYPE_TGID); 1465 + if (target && is_effectively_child(wo, ptrace, target)) { 1466 + retval = wait_consider_task(wo, ptrace, target); 1467 + if (retval) 1468 + return retval; 1469 + } 1470 + 1471 + ptrace = true; 1472 + target = pid_task(wo->wo_pid, PIDTYPE_PID); 1473 + if (target && target->ptrace && 1474 + is_effectively_child(wo, ptrace, target)) { 1475 + retval = wait_consider_task(wo, ptrace, target); 1476 + if (retval) 1477 + return retval; 1478 + } 1479 + 1480 + return 0; 1481 + } 1482 + 1443 1483 static long do_wait(struct wait_opts *wo) 1444 1484 { 1445 - struct task_struct *tsk; 1446 1485 int retval; 1447 1486 1448 1487 trace_sched_process_wait(wo->wo_pid); ··· 1503 1464 1504 1465 set_current_state(TASK_INTERRUPTIBLE); 1505 1466 read_lock(&tasklist_lock); 1506 - tsk = current; 1507 - do { 1508 - retval = do_wait_thread(wo, tsk); 1467 + 1468 + if (wo->wo_type == PIDTYPE_PID) { 1469 + retval = do_wait_pid(wo); 1509 1470 if (retval) 1510 1471 goto end; 1472 + } else { 1473 + struct task_struct *tsk = current; 1511 1474 1512 - retval = ptrace_do_wait(wo, tsk); 1513 - if (retval) 1514 - goto end; 1475 + do { 1476 + retval = do_wait_thread(wo, tsk); 1477 + if (retval) 1478 + goto end; 1515 1479 1516 - if (wo->wo_flags & __WNOTHREAD) 1517 - break; 1518 - } while_each_thread(current, tsk); 1480 + retval = ptrace_do_wait(wo, tsk); 1481 + if (retval) 1482 + goto end; 1483 + 1484 + if (wo->wo_flags & __WNOTHREAD) 1485 + break; 1486 + } while_each_thread(current, tsk); 1487 + } 1519 1488 read_unlock(&tasklist_lock); 1520 1489 1521 1490 notask:
+8 -15
kernel/fork.c
··· 1145 1145 * invocations: in mmput() nobody alive left, in execve task is single 1146 1146 * threaded. sys_prctl(PR_SET_MM_MAP/EXE_FILE) also needs to set the 1147 1147 * mm->exe_file, but does so without using set_mm_exe_file() in order 1148 - * to do avoid the need for any locks. 1148 + * to avoid the need for any locks. 1149 1149 */ 1150 1150 void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file) 1151 1151 { ··· 1396 1396 static int copy_mm(unsigned long clone_flags, struct task_struct *tsk) 1397 1397 { 1398 1398 struct mm_struct *mm, *oldmm; 1399 - int retval; 1400 1399 1401 1400 tsk->min_flt = tsk->maj_flt = 0; 1402 1401 tsk->nvcsw = tsk->nivcsw = 0; ··· 1422 1423 if (clone_flags & CLONE_VM) { 1423 1424 mmget(oldmm); 1424 1425 mm = oldmm; 1425 - goto good_mm; 1426 + } else { 1427 + mm = dup_mm(tsk, current->mm); 1428 + if (!mm) 1429 + return -ENOMEM; 1426 1430 } 1427 1431 1428 - retval = -ENOMEM; 1429 - mm = dup_mm(tsk, current->mm); 1430 - if (!mm) 1431 - goto fail_nomem; 1432 - 1433 - good_mm: 1434 1432 tsk->mm = mm; 1435 1433 tsk->active_mm = mm; 1436 1434 return 0; 1437 - 1438 - fail_nomem: 1439 - return retval; 1440 1435 } 1441 1436 1442 1437 static int copy_fs(unsigned long clone_flags, struct task_struct *tsk) ··· 1736 1743 * /proc/<pid>/status where Pid and NSpid are always shown relative to 1737 1744 * the pid namespace of the procfs instance. The difference becomes 1738 1745 * obvious when sending around a pidfd between pid namespaces from a 1739 - * different branch of the tree, i.e. where no ancestoral relation is 1746 + * different branch of the tree, i.e. where no ancestral relation is 1740 1747 * present between the pid namespaces: 1741 1748 * - create two new pid namespaces ns1 and ns2 in the initial pid 1742 1749 * namespace (also take care to create new mount namespaces in the ··· 2728 2735 return false; 2729 2736 2730 2737 /* 2731 - * - make the CLONE_DETACHED bit reuseable for clone3 2732 - * - make the CSIGNAL bits reuseable for clone3 2738 + * - make the CLONE_DETACHED bit reusable for clone3 2739 + * - make the CSIGNAL bits reusable for clone3 2733 2740 */ 2734 2741 if (kargs->flags & (CLONE_DETACHED | CSIGNAL)) 2735 2742 return false;
+1
kernel/gcov/Kconfig
··· 4 4 config GCOV_KERNEL 5 5 bool "Enable gcov-based kernel profiling" 6 6 depends on DEBUG_FS 7 + depends on !CC_IS_CLANG || CLANG_VERSION >= 110000 7 8 select CONSTRUCTORS 8 9 default n 9 10 help
+49
kernel/gcov/base.c
··· 49 49 mutex_unlock(&gcov_lock); 50 50 } 51 51 52 + /** 53 + * store_gcov_u32 - store 32 bit number in gcov format to buffer 54 + * @buffer: target buffer or NULL 55 + * @off: offset into the buffer 56 + * @v: value to be stored 57 + * 58 + * Number format defined by gcc: numbers are recorded in the 32 bit 59 + * unsigned binary form of the endianness of the machine generating the 60 + * file. Returns the number of bytes stored. If @buffer is %NULL, doesn't 61 + * store anything. 62 + */ 63 + size_t store_gcov_u32(void *buffer, size_t off, u32 v) 64 + { 65 + u32 *data; 66 + 67 + if (buffer) { 68 + data = buffer + off; 69 + *data = v; 70 + } 71 + 72 + return sizeof(*data); 73 + } 74 + 75 + /** 76 + * store_gcov_u64 - store 64 bit number in gcov format to buffer 77 + * @buffer: target buffer or NULL 78 + * @off: offset into the buffer 79 + * @v: value to be stored 80 + * 81 + * Number format defined by gcc: numbers are recorded in the 32 bit 82 + * unsigned binary form of the endianness of the machine generating the 83 + * file. 64 bit numbers are stored as two 32 bit numbers, the low part 84 + * first. Returns the number of bytes stored. If @buffer is %NULL, doesn't store 85 + * anything. 86 + */ 87 + size_t store_gcov_u64(void *buffer, size_t off, u64 v) 88 + { 89 + u32 *data; 90 + 91 + if (buffer) { 92 + data = buffer + off; 93 + 94 + data[0] = (v & 0xffffffffUL); 95 + data[1] = (v >> 32); 96 + } 97 + 98 + return sizeof(*data) * 2; 99 + } 100 + 52 101 #ifdef CONFIG_MODULES 53 102 /* Update list and generate events when modules are unloaded. */ 54 103 static int gcov_module_notifier(struct notifier_block *nb, unsigned long event,
+4 -272
kernel/gcov/clang.c
··· 48 48 #include <linux/list.h> 49 49 #include <linux/printk.h> 50 50 #include <linux/ratelimit.h> 51 - #include <linux/seq_file.h> 52 51 #include <linux/slab.h> 53 - #include <linux/vmalloc.h> 52 + #include <linux/mm.h> 54 53 #include "gcov.h" 55 54 56 55 typedef void (*llvm_gcov_callback)(void); ··· 69 70 70 71 u32 ident; 71 72 u32 checksum; 72 - #if CONFIG_CLANG_VERSION < 110000 73 - u8 use_extra_checksum; 74 - #endif 75 73 u32 cfg_checksum; 76 74 77 75 u32 num_counters; 78 76 u64 *counters; 79 - #if CONFIG_CLANG_VERSION < 110000 80 - const char *function_name; 81 - #endif 82 77 }; 83 78 84 79 static struct gcov_info *current_info; ··· 102 109 } 103 110 EXPORT_SYMBOL(llvm_gcov_init); 104 111 105 - #if CONFIG_CLANG_VERSION < 110000 106 - void llvm_gcda_start_file(const char *orig_filename, const char version[4], 107 - u32 checksum) 108 - { 109 - current_info->filename = orig_filename; 110 - memcpy(&current_info->version, version, sizeof(current_info->version)); 111 - current_info->checksum = checksum; 112 - } 113 - EXPORT_SYMBOL(llvm_gcda_start_file); 114 - #else 115 112 void llvm_gcda_start_file(const char *orig_filename, u32 version, u32 checksum) 116 113 { 117 114 current_info->filename = orig_filename; ··· 109 126 current_info->checksum = checksum; 110 127 } 111 128 EXPORT_SYMBOL(llvm_gcda_start_file); 112 - #endif 113 129 114 - #if CONFIG_CLANG_VERSION < 110000 115 - void llvm_gcda_emit_function(u32 ident, const char *function_name, 116 - u32 func_checksum, u8 use_extra_checksum, u32 cfg_checksum) 117 - { 118 - struct gcov_fn_info *info = kzalloc(sizeof(*info), GFP_KERNEL); 119 - 120 - if (!info) 121 - return; 122 - 123 - INIT_LIST_HEAD(&info->head); 124 - info->ident = ident; 125 - info->checksum = func_checksum; 126 - info->use_extra_checksum = use_extra_checksum; 127 - info->cfg_checksum = cfg_checksum; 128 - if (function_name) 129 - info->function_name = kstrdup(function_name, GFP_KERNEL); 130 - 131 - list_add_tail(&info->head, &current_info->functions); 132 - } 133 - #else 134 130 void llvm_gcda_emit_function(u32 ident, u32 func_checksum, u32 cfg_checksum) 135 131 { 136 132 struct gcov_fn_info *info = kzalloc(sizeof(*info), GFP_KERNEL); ··· 123 161 info->cfg_checksum = cfg_checksum; 124 162 list_add_tail(&info->head, &current_info->functions); 125 163 } 126 - #endif 127 164 EXPORT_SYMBOL(llvm_gcda_emit_function); 128 165 129 166 void llvm_gcda_emit_arcs(u32 num_counters, u64 *counters) ··· 253 292 !list_is_last(&fn_ptr2->head, &info2->functions)) { 254 293 if (fn_ptr1->checksum != fn_ptr2->checksum) 255 294 return false; 256 - #if CONFIG_CLANG_VERSION < 110000 257 - if (fn_ptr1->use_extra_checksum != fn_ptr2->use_extra_checksum) 258 - return false; 259 - if (fn_ptr1->use_extra_checksum && 260 - fn_ptr1->cfg_checksum != fn_ptr2->cfg_checksum) 261 - return false; 262 - #else 263 295 if (fn_ptr1->cfg_checksum != fn_ptr2->cfg_checksum) 264 296 return false; 265 - #endif 266 297 fn_ptr1 = list_next_entry(fn_ptr1, head); 267 298 fn_ptr2 = list_next_entry(fn_ptr2, head); 268 299 } ··· 283 330 } 284 331 } 285 332 286 - #if CONFIG_CLANG_VERSION < 110000 287 - static struct gcov_fn_info *gcov_fn_info_dup(struct gcov_fn_info *fn) 288 - { 289 - size_t cv_size; /* counter values size */ 290 - struct gcov_fn_info *fn_dup = kmemdup(fn, sizeof(*fn), 291 - GFP_KERNEL); 292 - if (!fn_dup) 293 - return NULL; 294 - INIT_LIST_HEAD(&fn_dup->head); 295 - 296 - fn_dup->function_name = kstrdup(fn->function_name, GFP_KERNEL); 297 - if (!fn_dup->function_name) 298 - goto err_name; 299 - 300 - cv_size = fn->num_counters * sizeof(fn->counters[0]); 301 - fn_dup->counters = vmalloc(cv_size); 302 - if (!fn_dup->counters) 303 - goto err_counters; 304 - memcpy(fn_dup->counters, fn->counters, cv_size); 305 - 306 - return fn_dup; 307 - 308 - err_counters: 309 - kfree(fn_dup->function_name); 310 - err_name: 311 - kfree(fn_dup); 312 - return NULL; 313 - } 314 - #else 315 333 static struct gcov_fn_info *gcov_fn_info_dup(struct gcov_fn_info *fn) 316 334 { 317 335 size_t cv_size; /* counter values size */ ··· 293 369 INIT_LIST_HEAD(&fn_dup->head); 294 370 295 371 cv_size = fn->num_counters * sizeof(fn->counters[0]); 296 - fn_dup->counters = vmalloc(cv_size); 372 + fn_dup->counters = kvmalloc(cv_size, GFP_KERNEL); 297 373 if (!fn_dup->counters) { 298 374 kfree(fn_dup); 299 375 return NULL; ··· 303 379 304 380 return fn_dup; 305 381 } 306 - #endif 307 382 308 383 /** 309 384 * gcov_info_dup - duplicate profiling data set ··· 343 420 * gcov_info_free - release memory for profiling data set duplicate 344 421 * @info: profiling data set duplicate to free 345 422 */ 346 - #if CONFIG_CLANG_VERSION < 110000 347 423 void gcov_info_free(struct gcov_info *info) 348 424 { 349 425 struct gcov_fn_info *fn, *tmp; 350 426 351 427 list_for_each_entry_safe(fn, tmp, &info->functions, head) { 352 - kfree(fn->function_name); 353 - vfree(fn->counters); 428 + kvfree(fn->counters); 354 429 list_del(&fn->head); 355 430 kfree(fn); 356 431 } 357 432 kfree(info->filename); 358 433 kfree(info); 359 - } 360 - #else 361 - void gcov_info_free(struct gcov_info *info) 362 - { 363 - struct gcov_fn_info *fn, *tmp; 364 - 365 - list_for_each_entry_safe(fn, tmp, &info->functions, head) { 366 - vfree(fn->counters); 367 - list_del(&fn->head); 368 - kfree(fn); 369 - } 370 - kfree(info->filename); 371 - kfree(info); 372 - } 373 - #endif 374 - 375 - #define ITER_STRIDE PAGE_SIZE 376 - 377 - /** 378 - * struct gcov_iterator - specifies current file position in logical records 379 - * @info: associated profiling data 380 - * @buffer: buffer containing file data 381 - * @size: size of buffer 382 - * @pos: current position in file 383 - */ 384 - struct gcov_iterator { 385 - struct gcov_info *info; 386 - void *buffer; 387 - size_t size; 388 - loff_t pos; 389 - }; 390 - 391 - /** 392 - * store_gcov_u32 - store 32 bit number in gcov format to buffer 393 - * @buffer: target buffer or NULL 394 - * @off: offset into the buffer 395 - * @v: value to be stored 396 - * 397 - * Number format defined by gcc: numbers are recorded in the 32 bit 398 - * unsigned binary form of the endianness of the machine generating the 399 - * file. Returns the number of bytes stored. If @buffer is %NULL, doesn't 400 - * store anything. 401 - */ 402 - static size_t store_gcov_u32(void *buffer, size_t off, u32 v) 403 - { 404 - u32 *data; 405 - 406 - if (buffer) { 407 - data = buffer + off; 408 - *data = v; 409 - } 410 - 411 - return sizeof(*data); 412 - } 413 - 414 - /** 415 - * store_gcov_u64 - store 64 bit number in gcov format to buffer 416 - * @buffer: target buffer or NULL 417 - * @off: offset into the buffer 418 - * @v: value to be stored 419 - * 420 - * Number format defined by gcc: numbers are recorded in the 32 bit 421 - * unsigned binary form of the endianness of the machine generating the 422 - * file. 64 bit numbers are stored as two 32 bit numbers, the low part 423 - * first. Returns the number of bytes stored. If @buffer is %NULL, doesn't store 424 - * anything. 425 - */ 426 - static size_t store_gcov_u64(void *buffer, size_t off, u64 v) 427 - { 428 - u32 *data; 429 - 430 - if (buffer) { 431 - data = buffer + off; 432 - 433 - data[0] = (v & 0xffffffffUL); 434 - data[1] = (v >> 32); 435 - } 436 - 437 - return sizeof(*data) * 2; 438 434 } 439 435 440 436 /** ··· 363 521 * 364 522 * Returns the number of bytes that were/would have been stored into the buffer. 365 523 */ 366 - static size_t convert_to_gcda(char *buffer, struct gcov_info *info) 524 + size_t convert_to_gcda(char *buffer, struct gcov_info *info) 367 525 { 368 526 struct gcov_fn_info *fi_ptr; 369 527 size_t pos = 0; ··· 377 535 u32 i; 378 536 379 537 pos += store_gcov_u32(buffer, pos, GCOV_TAG_FUNCTION); 380 - #if CONFIG_CLANG_VERSION < 110000 381 - pos += store_gcov_u32(buffer, pos, 382 - fi_ptr->use_extra_checksum ? 3 : 2); 383 - #else 384 538 pos += store_gcov_u32(buffer, pos, 3); 385 - #endif 386 539 pos += store_gcov_u32(buffer, pos, fi_ptr->ident); 387 540 pos += store_gcov_u32(buffer, pos, fi_ptr->checksum); 388 - #if CONFIG_CLANG_VERSION < 110000 389 - if (fi_ptr->use_extra_checksum) 390 - pos += store_gcov_u32(buffer, pos, fi_ptr->cfg_checksum); 391 - #else 392 541 pos += store_gcov_u32(buffer, pos, fi_ptr->cfg_checksum); 393 - #endif 394 - 395 542 pos += store_gcov_u32(buffer, pos, GCOV_TAG_COUNTER_BASE); 396 543 pos += store_gcov_u32(buffer, pos, fi_ptr->num_counters * 2); 397 544 for (i = 0; i < fi_ptr->num_counters; i++) ··· 388 557 } 389 558 390 559 return pos; 391 - } 392 - 393 - /** 394 - * gcov_iter_new - allocate and initialize profiling data iterator 395 - * @info: profiling data set to be iterated 396 - * 397 - * Return file iterator on success, %NULL otherwise. 398 - */ 399 - struct gcov_iterator *gcov_iter_new(struct gcov_info *info) 400 - { 401 - struct gcov_iterator *iter; 402 - 403 - iter = kzalloc(sizeof(struct gcov_iterator), GFP_KERNEL); 404 - if (!iter) 405 - goto err_free; 406 - 407 - iter->info = info; 408 - /* Dry-run to get the actual buffer size. */ 409 - iter->size = convert_to_gcda(NULL, info); 410 - iter->buffer = vmalloc(iter->size); 411 - if (!iter->buffer) 412 - goto err_free; 413 - 414 - convert_to_gcda(iter->buffer, info); 415 - 416 - return iter; 417 - 418 - err_free: 419 - kfree(iter); 420 - return NULL; 421 - } 422 - 423 - 424 - /** 425 - * gcov_iter_get_info - return profiling data set for given file iterator 426 - * @iter: file iterator 427 - */ 428 - void gcov_iter_free(struct gcov_iterator *iter) 429 - { 430 - vfree(iter->buffer); 431 - kfree(iter); 432 - } 433 - 434 - /** 435 - * gcov_iter_get_info - return profiling data set for given file iterator 436 - * @iter: file iterator 437 - */ 438 - struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter) 439 - { 440 - return iter->info; 441 - } 442 - 443 - /** 444 - * gcov_iter_start - reset file iterator to starting position 445 - * @iter: file iterator 446 - */ 447 - void gcov_iter_start(struct gcov_iterator *iter) 448 - { 449 - iter->pos = 0; 450 - } 451 - 452 - /** 453 - * gcov_iter_next - advance file iterator to next logical record 454 - * @iter: file iterator 455 - * 456 - * Return zero if new position is valid, non-zero if iterator has reached end. 457 - */ 458 - int gcov_iter_next(struct gcov_iterator *iter) 459 - { 460 - if (iter->pos < iter->size) 461 - iter->pos += ITER_STRIDE; 462 - 463 - if (iter->pos >= iter->size) 464 - return -EINVAL; 465 - 466 - return 0; 467 - } 468 - 469 - /** 470 - * gcov_iter_write - write data for current pos to seq_file 471 - * @iter: file iterator 472 - * @seq: seq_file handle 473 - * 474 - * Return zero on success, non-zero otherwise. 475 - */ 476 - int gcov_iter_write(struct gcov_iterator *iter, struct seq_file *seq) 477 - { 478 - size_t len; 479 - 480 - if (iter->pos >= iter->size) 481 - return -EINVAL; 482 - 483 - len = ITER_STRIDE; 484 - if (iter->pos + len > iter->size) 485 - len = iter->size - iter->pos; 486 - 487 - seq_write(seq, iter->buffer + iter->pos, len); 488 - 489 - return 0; 490 560 }
+110
kernel/gcov/fs.c
··· 26 26 #include <linux/slab.h> 27 27 #include <linux/mutex.h> 28 28 #include <linux/seq_file.h> 29 + #include <linux/mm.h> 29 30 #include "gcov.h" 30 31 31 32 /** ··· 85 84 return 1; 86 85 } 87 86 __setup("gcov_persist=", gcov_persist_setup); 87 + 88 + #define ITER_STRIDE PAGE_SIZE 89 + 90 + /** 91 + * struct gcov_iterator - specifies current file position in logical records 92 + * @info: associated profiling data 93 + * @buffer: buffer containing file data 94 + * @size: size of buffer 95 + * @pos: current position in file 96 + */ 97 + struct gcov_iterator { 98 + struct gcov_info *info; 99 + size_t size; 100 + loff_t pos; 101 + char buffer[]; 102 + }; 103 + 104 + /** 105 + * gcov_iter_new - allocate and initialize profiling data iterator 106 + * @info: profiling data set to be iterated 107 + * 108 + * Return file iterator on success, %NULL otherwise. 109 + */ 110 + static struct gcov_iterator *gcov_iter_new(struct gcov_info *info) 111 + { 112 + struct gcov_iterator *iter; 113 + size_t size; 114 + 115 + /* Dry-run to get the actual buffer size. */ 116 + size = convert_to_gcda(NULL, info); 117 + 118 + iter = kvmalloc(struct_size(iter, buffer, size), GFP_KERNEL); 119 + if (!iter) 120 + return NULL; 121 + 122 + iter->info = info; 123 + iter->size = size; 124 + convert_to_gcda(iter->buffer, info); 125 + 126 + return iter; 127 + } 128 + 129 + 130 + /** 131 + * gcov_iter_free - free iterator data 132 + * @iter: file iterator 133 + */ 134 + static void gcov_iter_free(struct gcov_iterator *iter) 135 + { 136 + kvfree(iter); 137 + } 138 + 139 + /** 140 + * gcov_iter_get_info - return profiling data set for given file iterator 141 + * @iter: file iterator 142 + */ 143 + static struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter) 144 + { 145 + return iter->info; 146 + } 147 + 148 + /** 149 + * gcov_iter_start - reset file iterator to starting position 150 + * @iter: file iterator 151 + */ 152 + static void gcov_iter_start(struct gcov_iterator *iter) 153 + { 154 + iter->pos = 0; 155 + } 156 + 157 + /** 158 + * gcov_iter_next - advance file iterator to next logical record 159 + * @iter: file iterator 160 + * 161 + * Return zero if new position is valid, non-zero if iterator has reached end. 162 + */ 163 + static int gcov_iter_next(struct gcov_iterator *iter) 164 + { 165 + if (iter->pos < iter->size) 166 + iter->pos += ITER_STRIDE; 167 + 168 + if (iter->pos >= iter->size) 169 + return -EINVAL; 170 + 171 + return 0; 172 + } 173 + 174 + /** 175 + * gcov_iter_write - write data for current pos to seq_file 176 + * @iter: file iterator 177 + * @seq: seq_file handle 178 + * 179 + * Return zero on success, non-zero otherwise. 180 + */ 181 + static int gcov_iter_write(struct gcov_iterator *iter, struct seq_file *seq) 182 + { 183 + size_t len; 184 + 185 + if (iter->pos >= iter->size) 186 + return -EINVAL; 187 + 188 + len = ITER_STRIDE; 189 + if (iter->pos + len > iter->size) 190 + len = iter->size - iter->pos; 191 + 192 + seq_write(seq, iter->buffer + iter->pos, len); 193 + 194 + return 0; 195 + } 88 196 89 197 /* 90 198 * seq_file.start() implementation for gcov data files. Note that the
+4 -169
kernel/gcov/gcc_4_7.c
··· 15 15 #include <linux/errno.h> 16 16 #include <linux/slab.h> 17 17 #include <linux/string.h> 18 - #include <linux/seq_file.h> 19 - #include <linux/vmalloc.h> 18 + #include <linux/mm.h> 20 19 #include "gcov.h" 21 20 22 21 #if (__GNUC__ >= 10) ··· 309 310 310 311 cv_size = sizeof(gcov_type) * sci_ptr->num; 311 312 312 - dci_ptr->values = vmalloc(cv_size); 313 + dci_ptr->values = kvmalloc(cv_size, GFP_KERNEL); 313 314 314 315 if (!dci_ptr->values) 315 316 goto err_free; ··· 351 352 ci_ptr = info->functions[fi_idx]->ctrs; 352 353 353 354 for (ct_idx = 0; ct_idx < active; ct_idx++, ci_ptr++) 354 - vfree(ci_ptr->values); 355 + kvfree(ci_ptr->values); 355 356 356 357 kfree(info->functions[fi_idx]); 357 358 } ··· 362 363 kfree(info); 363 364 } 364 365 365 - #define ITER_STRIDE PAGE_SIZE 366 - 367 - /** 368 - * struct gcov_iterator - specifies current file position in logical records 369 - * @info: associated profiling data 370 - * @buffer: buffer containing file data 371 - * @size: size of buffer 372 - * @pos: current position in file 373 - */ 374 - struct gcov_iterator { 375 - struct gcov_info *info; 376 - void *buffer; 377 - size_t size; 378 - loff_t pos; 379 - }; 380 - 381 - /** 382 - * store_gcov_u32 - store 32 bit number in gcov format to buffer 383 - * @buffer: target buffer or NULL 384 - * @off: offset into the buffer 385 - * @v: value to be stored 386 - * 387 - * Number format defined by gcc: numbers are recorded in the 32 bit 388 - * unsigned binary form of the endianness of the machine generating the 389 - * file. Returns the number of bytes stored. If @buffer is %NULL, doesn't 390 - * store anything. 391 - */ 392 - static size_t store_gcov_u32(void *buffer, size_t off, u32 v) 393 - { 394 - u32 *data; 395 - 396 - if (buffer) { 397 - data = buffer + off; 398 - *data = v; 399 - } 400 - 401 - return sizeof(*data); 402 - } 403 - 404 - /** 405 - * store_gcov_u64 - store 64 bit number in gcov format to buffer 406 - * @buffer: target buffer or NULL 407 - * @off: offset into the buffer 408 - * @v: value to be stored 409 - * 410 - * Number format defined by gcc: numbers are recorded in the 32 bit 411 - * unsigned binary form of the endianness of the machine generating the 412 - * file. 64 bit numbers are stored as two 32 bit numbers, the low part 413 - * first. Returns the number of bytes stored. If @buffer is %NULL, doesn't store 414 - * anything. 415 - */ 416 - static size_t store_gcov_u64(void *buffer, size_t off, u64 v) 417 - { 418 - u32 *data; 419 - 420 - if (buffer) { 421 - data = buffer + off; 422 - 423 - data[0] = (v & 0xffffffffUL); 424 - data[1] = (v >> 32); 425 - } 426 - 427 - return sizeof(*data) * 2; 428 - } 429 - 430 366 /** 431 367 * convert_to_gcda - convert profiling data set to gcda file format 432 368 * @buffer: the buffer to store file data or %NULL if no data should be stored ··· 369 435 * 370 436 * Returns the number of bytes that were/would have been stored into the buffer. 371 437 */ 372 - static size_t convert_to_gcda(char *buffer, struct gcov_info *info) 438 + size_t convert_to_gcda(char *buffer, struct gcov_info *info) 373 439 { 374 440 struct gcov_fn_info *fi_ptr; 375 441 struct gcov_ctr_info *ci_ptr; ··· 414 480 } 415 481 416 482 return pos; 417 - } 418 - 419 - /** 420 - * gcov_iter_new - allocate and initialize profiling data iterator 421 - * @info: profiling data set to be iterated 422 - * 423 - * Return file iterator on success, %NULL otherwise. 424 - */ 425 - struct gcov_iterator *gcov_iter_new(struct gcov_info *info) 426 - { 427 - struct gcov_iterator *iter; 428 - 429 - iter = kzalloc(sizeof(struct gcov_iterator), GFP_KERNEL); 430 - if (!iter) 431 - goto err_free; 432 - 433 - iter->info = info; 434 - /* Dry-run to get the actual buffer size. */ 435 - iter->size = convert_to_gcda(NULL, info); 436 - iter->buffer = vmalloc(iter->size); 437 - if (!iter->buffer) 438 - goto err_free; 439 - 440 - convert_to_gcda(iter->buffer, info); 441 - 442 - return iter; 443 - 444 - err_free: 445 - kfree(iter); 446 - return NULL; 447 - } 448 - 449 - 450 - /** 451 - * gcov_iter_get_info - return profiling data set for given file iterator 452 - * @iter: file iterator 453 - */ 454 - void gcov_iter_free(struct gcov_iterator *iter) 455 - { 456 - vfree(iter->buffer); 457 - kfree(iter); 458 - } 459 - 460 - /** 461 - * gcov_iter_get_info - return profiling data set for given file iterator 462 - * @iter: file iterator 463 - */ 464 - struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter) 465 - { 466 - return iter->info; 467 - } 468 - 469 - /** 470 - * gcov_iter_start - reset file iterator to starting position 471 - * @iter: file iterator 472 - */ 473 - void gcov_iter_start(struct gcov_iterator *iter) 474 - { 475 - iter->pos = 0; 476 - } 477 - 478 - /** 479 - * gcov_iter_next - advance file iterator to next logical record 480 - * @iter: file iterator 481 - * 482 - * Return zero if new position is valid, non-zero if iterator has reached end. 483 - */ 484 - int gcov_iter_next(struct gcov_iterator *iter) 485 - { 486 - if (iter->pos < iter->size) 487 - iter->pos += ITER_STRIDE; 488 - 489 - if (iter->pos >= iter->size) 490 - return -EINVAL; 491 - 492 - return 0; 493 - } 494 - 495 - /** 496 - * gcov_iter_write - write data for current pos to seq_file 497 - * @iter: file iterator 498 - * @seq: seq_file handle 499 - * 500 - * Return zero on success, non-zero otherwise. 501 - */ 502 - int gcov_iter_write(struct gcov_iterator *iter, struct seq_file *seq) 503 - { 504 - size_t len; 505 - 506 - if (iter->pos >= iter->size) 507 - return -EINVAL; 508 - 509 - len = ITER_STRIDE; 510 - if (iter->pos + len > iter->size) 511 - len = iter->size - iter->pos; 512 - 513 - seq_write(seq, iter->buffer + iter->pos, len); 514 - 515 - return 0; 516 483 }
+4 -10
kernel/gcov/gcov.h
··· 48 48 void gcov_info_link(struct gcov_info *info); 49 49 void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info); 50 50 bool gcov_info_within_module(struct gcov_info *info, struct module *mod); 51 + size_t convert_to_gcda(char *buffer, struct gcov_info *info); 51 52 52 53 /* Base interface. */ 53 54 enum gcov_action { ··· 59 58 void gcov_event(enum gcov_action action, struct gcov_info *info); 60 59 void gcov_enable_events(void); 61 60 62 - /* Iterator control. */ 63 - struct seq_file; 64 - struct gcov_iterator; 65 - 66 - struct gcov_iterator *gcov_iter_new(struct gcov_info *info); 67 - void gcov_iter_free(struct gcov_iterator *iter); 68 - void gcov_iter_start(struct gcov_iterator *iter); 69 - int gcov_iter_next(struct gcov_iterator *iter); 70 - int gcov_iter_write(struct gcov_iterator *iter, struct seq_file *seq); 71 - struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter); 61 + /* writing helpers */ 62 + size_t store_gcov_u32(void *buffer, size_t off, u32 v); 63 + size_t store_gcov_u64(void *buffer, size_t off, u64 v); 72 64 73 65 /* gcov_info control. */ 74 66 void gcov_info_reset(struct gcov_info *info);
+3 -1
kernel/kexec_core.c
··· 37 37 #include <linux/compiler.h> 38 38 #include <linux/hugetlb.h> 39 39 #include <linux/objtool.h> 40 + #include <linux/kmsg_dump.h> 40 41 41 42 #include <asm/page.h> 42 43 #include <asm/sections.h> ··· 1166 1165 #endif 1167 1166 { 1168 1167 kexec_in_progress = true; 1169 - kernel_restart_prepare(NULL); 1168 + kernel_restart_prepare("kexec reboot"); 1170 1169 migrate_to_reboot_cpu(); 1171 1170 1172 1171 /* ··· 1180 1179 machine_shutdown(); 1181 1180 } 1182 1181 1182 + kmsg_dump(KMSG_DUMP_SHUTDOWN); 1183 1183 machine_kexec(kexec_image); 1184 1184 1185 1185 #ifdef CONFIG_KEXEC_JUMP
+3 -1
kernel/kexec_file.c
··· 740 740 741 741 sha_region_sz = KEXEC_SEGMENT_MAX * sizeof(struct kexec_sha_region); 742 742 sha_regions = vzalloc(sha_region_sz); 743 - if (!sha_regions) 743 + if (!sha_regions) { 744 + ret = -ENOMEM; 744 745 goto out_free_desc; 746 + } 745 747 746 748 desc->tfm = tfm; 747 749
+1 -1
kernel/kmod.c
··· 58 58 /* 59 59 modprobe_path is set via /proc/sys. 60 60 */ 61 - char modprobe_path[KMOD_PATH_LEN] = "/sbin/modprobe"; 61 + char modprobe_path[KMOD_PATH_LEN] = CONFIG_MODPROBE_PATH; 62 62 63 63 static void free_modprobe_argv(struct subprocess_info *info) 64 64 {
+113 -81
kernel/resource.c
··· 64 64 static struct resource *bootmem_resource_free; 65 65 static DEFINE_SPINLOCK(bootmem_resource_lock); 66 66 67 - static struct resource *next_resource(struct resource *p, bool sibling_only) 67 + static struct resource *next_resource(struct resource *p) 68 68 { 69 - /* Caller wants to traverse through siblings only */ 70 - if (sibling_only) 71 - return p->sibling; 72 - 73 69 if (p->child) 74 70 return p->child; 75 71 while (!p->sibling && p->parent) ··· 77 81 { 78 82 struct resource *p = v; 79 83 (*pos)++; 80 - return (void *)next_resource(p, false); 84 + return (void *)next_resource(p); 81 85 } 82 86 83 87 #ifdef CONFIG_PROC_FS ··· 326 330 * of the resource that's within [@start..@end]; if none is found, returns 327 331 * -ENODEV. Returns -EINVAL for invalid parameters. 328 332 * 329 - * This function walks the whole tree and not just first level children 330 - * unless @first_lvl is true. 331 - * 332 333 * @start: start address of the resource searched for 333 334 * @end: end address of same resource 334 335 * @flags: flags which the resource must have 335 336 * @desc: descriptor the resource must have 336 - * @first_lvl: walk only the first level children, if set 337 337 * @res: return ptr, if resource found 338 338 * 339 339 * The caller must specify @start, @end, @flags, and @desc ··· 337 345 */ 338 346 static int find_next_iomem_res(resource_size_t start, resource_size_t end, 339 347 unsigned long flags, unsigned long desc, 340 - bool first_lvl, struct resource *res) 348 + struct resource *res) 341 349 { 342 - bool siblings_only = true; 343 350 struct resource *p; 344 351 345 352 if (!res) ··· 349 358 350 359 read_lock(&resource_lock); 351 360 352 - for (p = iomem_resource.child; p; p = next_resource(p, siblings_only)) { 361 + for (p = iomem_resource.child; p; p = next_resource(p)) { 353 362 /* If we passed the resource we are looking for, stop */ 354 363 if (p->start > end) { 355 364 p = NULL; ··· 359 368 /* Skip until we find a range that matches what we look for */ 360 369 if (p->end < start) 361 370 continue; 362 - 363 - /* 364 - * Now that we found a range that matches what we look for, 365 - * check the flags and the descriptor. If we were not asked to 366 - * use only the first level, start looking at children as well. 367 - */ 368 - siblings_only = first_lvl; 369 371 370 372 if ((p->flags & flags) != flags) 371 373 continue; ··· 386 402 387 403 static int __walk_iomem_res_desc(resource_size_t start, resource_size_t end, 388 404 unsigned long flags, unsigned long desc, 389 - bool first_lvl, void *arg, 405 + void *arg, 390 406 int (*func)(struct resource *, void *)) 391 407 { 392 408 struct resource res; 393 409 int ret = -EINVAL; 394 410 395 411 while (start < end && 396 - !find_next_iomem_res(start, end, flags, desc, first_lvl, &res)) { 412 + !find_next_iomem_res(start, end, flags, desc, &res)) { 397 413 ret = (*func)(&res, arg); 398 414 if (ret) 399 415 break; ··· 415 431 * @arg: function argument for the callback @func 416 432 * @func: callback function that is called for each qualifying resource area 417 433 * 418 - * This walks through whole tree and not just first level children. 419 434 * All the memory ranges which overlap start,end and also match flags and 420 435 * desc are valid candidates. 421 436 * ··· 424 441 int walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start, 425 442 u64 end, void *arg, int (*func)(struct resource *, void *)) 426 443 { 427 - return __walk_iomem_res_desc(start, end, flags, desc, false, arg, func); 444 + return __walk_iomem_res_desc(start, end, flags, desc, arg, func); 428 445 } 429 446 EXPORT_SYMBOL_GPL(walk_iomem_res_desc); 430 447 ··· 440 457 { 441 458 unsigned long flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; 442 459 443 - return __walk_iomem_res_desc(start, end, flags, IORES_DESC_NONE, true, 444 - arg, func); 460 + return __walk_iomem_res_desc(start, end, flags, IORES_DESC_NONE, arg, 461 + func); 445 462 } 446 463 447 464 /* ··· 453 470 { 454 471 unsigned long flags = IORESOURCE_MEM | IORESOURCE_BUSY; 455 472 456 - return __walk_iomem_res_desc(start, end, flags, IORES_DESC_NONE, true, 457 - arg, func); 473 + return __walk_iomem_res_desc(start, end, flags, IORES_DESC_NONE, arg, 474 + func); 458 475 } 459 476 460 477 /* 461 478 * This function calls the @func callback against all memory ranges of type 462 479 * System RAM which are marked as IORESOURCE_SYSTEM_RAM and IORESOUCE_BUSY. 463 480 * It is to be used only for System RAM. 464 - * 465 - * This will find System RAM ranges that are children of top-level resources 466 - * in addition to top-level System RAM resources. 467 481 */ 468 482 int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, 469 483 void *arg, int (*func)(unsigned long, unsigned long, void *)) ··· 475 495 end = ((u64)(start_pfn + nr_pages) << PAGE_SHIFT) - 1; 476 496 flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; 477 497 while (start < end && 478 - !find_next_iomem_res(start, end, flags, IORES_DESC_NONE, 479 - false, &res)) { 498 + !find_next_iomem_res(start, end, flags, IORES_DESC_NONE, &res)) { 480 499 pfn = PFN_UP(res.start); 481 500 end_pfn = PFN_DOWN(res.end + 1); 482 501 if (end_pfn > pfn) ··· 502 523 } 503 524 EXPORT_SYMBOL_GPL(page_is_ram); 504 525 526 + static int __region_intersects(resource_size_t start, size_t size, 527 + unsigned long flags, unsigned long desc) 528 + { 529 + struct resource res; 530 + int type = 0; int other = 0; 531 + struct resource *p; 532 + 533 + res.start = start; 534 + res.end = start + size - 1; 535 + 536 + for (p = iomem_resource.child; p ; p = p->sibling) { 537 + bool is_type = (((p->flags & flags) == flags) && 538 + ((desc == IORES_DESC_NONE) || 539 + (desc == p->desc))); 540 + 541 + if (resource_overlaps(p, &res)) 542 + is_type ? type++ : other++; 543 + } 544 + 545 + if (type == 0) 546 + return REGION_DISJOINT; 547 + 548 + if (other == 0) 549 + return REGION_INTERSECTS; 550 + 551 + return REGION_MIXED; 552 + } 553 + 505 554 /** 506 555 * region_intersects() - determine intersection of region with known resources 507 556 * @start: region start address ··· 553 546 int region_intersects(resource_size_t start, size_t size, unsigned long flags, 554 547 unsigned long desc) 555 548 { 556 - struct resource res; 557 - int type = 0; int other = 0; 558 - struct resource *p; 559 - 560 - res.start = start; 561 - res.end = start + size - 1; 549 + int ret; 562 550 563 551 read_lock(&resource_lock); 564 - for (p = iomem_resource.child; p ; p = p->sibling) { 565 - bool is_type = (((p->flags & flags) == flags) && 566 - ((desc == IORES_DESC_NONE) || 567 - (desc == p->desc))); 568 - 569 - if (resource_overlaps(p, &res)) 570 - is_type ? type++ : other++; 571 - } 552 + ret = __region_intersects(start, size, flags, desc); 572 553 read_unlock(&resource_lock); 573 554 574 - if (type == 0) 575 - return REGION_DISJOINT; 576 - 577 - if (other == 0) 578 - return REGION_INTERSECTS; 579 - 580 - return REGION_MIXED; 555 + return ret; 581 556 } 582 557 EXPORT_SYMBOL_GPL(region_intersects); 583 558 ··· 1160 1171 return smp_load_acquire(&iomem_inode)->i_mapping; 1161 1172 } 1162 1173 1163 - /** 1164 - * __request_region - create a new busy resource region 1165 - * @parent: parent resource descriptor 1166 - * @start: resource start address 1167 - * @n: resource region size 1168 - * @name: reserving caller's ID string 1169 - * @flags: IO resource flags 1170 - */ 1171 - struct resource * __request_region(struct resource *parent, 1174 + static int __request_region_locked(struct resource *res, struct resource *parent, 1172 1175 resource_size_t start, resource_size_t n, 1173 1176 const char *name, int flags) 1174 1177 { 1175 1178 DECLARE_WAITQUEUE(wait, current); 1176 - struct resource *res = alloc_resource(GFP_KERNEL); 1177 - struct resource *orig_parent = parent; 1178 - 1179 - if (!res) 1180 - return NULL; 1181 1179 1182 1180 res->name = name; 1183 1181 res->start = start; 1184 1182 res->end = start + n - 1; 1185 - 1186 - write_lock(&resource_lock); 1187 1183 1188 1184 for (;;) { 1189 1185 struct resource *conflict; ··· 1205 1231 continue; 1206 1232 } 1207 1233 /* Uhhuh, that didn't work out.. */ 1208 - free_resource(res); 1209 - res = NULL; 1210 - break; 1234 + return -EBUSY; 1211 1235 } 1236 + 1237 + return 0; 1238 + } 1239 + 1240 + /** 1241 + * __request_region - create a new busy resource region 1242 + * @parent: parent resource descriptor 1243 + * @start: resource start address 1244 + * @n: resource region size 1245 + * @name: reserving caller's ID string 1246 + * @flags: IO resource flags 1247 + */ 1248 + struct resource *__request_region(struct resource *parent, 1249 + resource_size_t start, resource_size_t n, 1250 + const char *name, int flags) 1251 + { 1252 + struct resource *res = alloc_resource(GFP_KERNEL); 1253 + int ret; 1254 + 1255 + if (!res) 1256 + return NULL; 1257 + 1258 + write_lock(&resource_lock); 1259 + ret = __request_region_locked(res, parent, start, n, name, flags); 1212 1260 write_unlock(&resource_lock); 1213 1261 1214 - if (res && orig_parent == &iomem_resource) 1262 + if (ret) { 1263 + free_resource(res); 1264 + return NULL; 1265 + } 1266 + 1267 + if (parent == &iomem_resource) 1215 1268 revoke_iomem(res); 1216 1269 1217 1270 return res; ··· 1780 1779 { 1781 1780 resource_size_t end, addr; 1782 1781 struct resource *res; 1782 + struct region_devres *dr = NULL; 1783 1783 1784 1784 size = ALIGN(size, 1UL << PA_SECTION_SHIFT); 1785 1785 end = min_t(unsigned long, base->end, (1UL << MAX_PHYSMEM_BITS) - 1); 1786 1786 addr = end - size + 1UL; 1787 1787 1788 + res = alloc_resource(GFP_KERNEL); 1789 + if (!res) 1790 + return ERR_PTR(-ENOMEM); 1791 + 1792 + if (dev) { 1793 + dr = devres_alloc(devm_region_release, 1794 + sizeof(struct region_devres), GFP_KERNEL); 1795 + if (!dr) { 1796 + free_resource(res); 1797 + return ERR_PTR(-ENOMEM); 1798 + } 1799 + } 1800 + 1801 + write_lock(&resource_lock); 1788 1802 for (; addr > size && addr >= base->start; addr -= size) { 1789 - if (region_intersects(addr, size, 0, IORES_DESC_NONE) != 1803 + if (__region_intersects(addr, size, 0, IORES_DESC_NONE) != 1790 1804 REGION_DISJOINT) 1791 1805 continue; 1792 1806 1793 - if (dev) 1794 - res = devm_request_mem_region(dev, addr, size, name); 1795 - else 1796 - res = request_mem_region(addr, size, name); 1797 - if (!res) 1798 - return ERR_PTR(-ENOMEM); 1807 + if (!__request_region_locked(res, &iomem_resource, addr, size, 1808 + name, 0)) 1809 + break; 1810 + 1811 + if (dev) { 1812 + dr->parent = &iomem_resource; 1813 + dr->start = addr; 1814 + dr->n = size; 1815 + devres_add(dev, dr); 1816 + } 1817 + 1799 1818 res->desc = IORES_DESC_DEVICE_PRIVATE_MEMORY; 1819 + write_unlock(&resource_lock); 1820 + 1821 + /* 1822 + * A driver is claiming this region so revoke any mappings. 1823 + */ 1824 + revoke_iomem(res); 1800 1825 return res; 1801 1826 } 1827 + write_unlock(&resource_lock); 1828 + 1829 + free_resource(res); 1830 + if (dr) 1831 + devres_free(dr); 1802 1832 1803 1833 return ERR_PTR(-ERANGE); 1804 1834 }
+7 -7
kernel/sys.c
··· 1590 1590 1591 1591 /* 1592 1592 * RLIMIT_CPU handling. Arm the posix CPU timer if the limit is not 1593 - * infite. In case of RLIM_INFINITY the posix CPU timer code 1593 + * infinite. In case of RLIM_INFINITY the posix CPU timer code 1594 1594 * ignores the rlimit. 1595 1595 */ 1596 1596 if (!retval && new_rlim && resource == RLIMIT_CPU && ··· 2029 2029 } 2030 2030 2031 2031 /* 2032 - * arg_lock protects concurent updates but we still need mmap_lock for 2032 + * arg_lock protects concurrent updates but we still need mmap_lock for 2033 2033 * read to exclude races with sys_brk. 2034 2034 */ 2035 2035 mmap_read_lock(mm); ··· 2041 2041 * output in procfs mostly, except 2042 2042 * 2043 2043 * - @start_brk/@brk which are used in do_brk_flags but kernel lookups 2044 - * for VMAs when updating these memvers so anything wrong written 2044 + * for VMAs when updating these members so anything wrong written 2045 2045 * here cause kernel to swear at userspace program but won't lead 2046 2046 * to any problem in kernel itself 2047 2047 */ ··· 2143 2143 error = -EINVAL; 2144 2144 2145 2145 /* 2146 - * arg_lock protects concurent updates of arg boundaries, we need 2146 + * arg_lock protects concurrent updates of arg boundaries, we need 2147 2147 * mmap_lock for a) concurrent sys_brk, b) finding VMA for addr 2148 2148 * validation. 2149 2149 */ ··· 2210 2210 * If command line arguments and environment 2211 2211 * are placed somewhere else on stack, we can 2212 2212 * set them up here, ARG_START/END to setup 2213 - * command line argumets and ENV_START/END 2213 + * command line arguments and ENV_START/END 2214 2214 * for environment. 2215 2215 */ 2216 2216 case PR_SET_MM_START_STACK: ··· 2258 2258 static int propagate_has_child_subreaper(struct task_struct *p, void *data) 2259 2259 { 2260 2260 /* 2261 - * If task has has_child_subreaper - all its decendants 2262 - * already have these flag too and new decendants will 2261 + * If task has has_child_subreaper - all its descendants 2262 + * already have these flag too and new descendants will 2263 2263 * inherit it on fork, skip them. 2264 2264 * 2265 2265 * If we've found child_reaper - skip descendants in
+5 -3
kernel/umh.c
··· 27 27 #include <linux/ptrace.h> 28 28 #include <linux/async.h> 29 29 #include <linux/uaccess.h> 30 + #include <linux/initrd.h> 30 31 31 32 #include <trace/events/module.h> 32 33 ··· 108 107 109 108 commit_creds(new); 110 109 110 + wait_for_initramfs(); 111 111 retval = kernel_execve(sub_info->path, 112 112 (const char *const *)sub_info->argv, 113 113 (const char *const *)sub_info->envp); ··· 338 336 * @argv: arg vector for process 339 337 * @envp: environment for process 340 338 * @gfp_mask: gfp mask for memory allocation 341 - * @cleanup: a cleanup function 342 339 * @init: an init function 340 + * @cleanup: a cleanup function 343 341 * @data: arbitrary context sensitive data 344 342 * 345 343 * Returns either %NULL on allocation failure, or a subprocess_info ··· 350 348 * exec. A non-zero return code causes the process to error out, exit, 351 349 * and return the failure to the calling process 352 350 * 353 - * The cleanup function is just before ethe subprocess_info is about to 351 + * The cleanup function is just before the subprocess_info is about to 354 352 * be freed. This can be used for freeing the argv and envp. The 355 353 * Function must be runnable in either a process context or the 356 354 * context in which call_usermodehelper_exec is called. ··· 386 384 387 385 /** 388 386 * call_usermodehelper_exec - start a usermode application 389 - * @sub_info: information about the subprocessa 387 + * @sub_info: information about the subprocess 390 388 * @wait: wait for the application to finish and return status. 391 389 * when UMH_NO_WAIT don't wait at all, but you get no useful error back 392 390 * when the program couldn't be exec'ed. This makes it safe to call
+1 -1
kernel/up.c
··· 38 38 39 39 /* 40 40 * Preemption is disabled here to make sure the cond_func is called under the 41 - * same condtions in UP and SMP. 41 + * same conditions in UP and SMP. 42 42 */ 43 43 void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func, 44 44 void *info, bool wait, const struct cpumask *mask)
+3 -3
kernel/user_namespace.c
··· 85 85 /* 86 86 * Verify that we can not violate the policy of which files 87 87 * may be accessed that is specified by the root directory, 88 - * by verifing that the root directory is at the root of the 88 + * by verifying that the root directory is at the root of the 89 89 * mount namespace which allows all files to be accessed. 90 90 */ 91 91 ret = -EPERM; ··· 1014 1014 goto out; 1015 1015 ret = -EINVAL; 1016 1016 } 1017 - /* Be very certaint the new map actually exists */ 1017 + /* Be very certain the new map actually exists */ 1018 1018 if (new_map.nr_extents == 0) 1019 1019 goto out; 1020 1020 ··· 1169 1169 1170 1170 /* Allow the specified ids if we have the appropriate capability 1171 1171 * (CAP_SETUID or CAP_SETGID) over the parent user namespace. 1172 - * And the opener of the id file also had the approprpiate capability. 1172 + * And the opener of the id file also has the appropriate capability. 1173 1173 */ 1174 1174 if (ns_capable(ns->parent, cap_setid) && 1175 1175 file_ns_capable(file, ns->parent, cap_setid))
+1 -1
lib/bch.c
··· 584 584 k = a_log(bch, a); 585 585 rows[0] = c; 586 586 587 - /* buid linear system to solve X^4+aX^2+bX+c = 0 */ 587 + /* build linear system to solve X^4+aX^2+bX+c = 0 */ 588 588 for (i = 0; i < m; i++) { 589 589 rows[i+1] = bch->a_pow_tab[4*i]^ 590 590 (a ? bch->a_pow_tab[mod_s(bch, k)] : 0)^
+1 -1
lib/crc8.c
··· 71 71 * @nbytes: number of bytes in data buffer. 72 72 * @crc: previous returned crc8 value. 73 73 */ 74 - u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc) 74 + u8 crc8(const u8 table[CRC8_TABLE_SIZE], const u8 *pdata, size_t nbytes, u8 crc) 75 75 { 76 76 /* loop over the buffer data */ 77 77 while (nbytes-- > 0)
+1 -1
lib/decompress_unlzma.c
··· 391 391 static inline int INIT process_bit1(struct writer *wr, struct rc *rc, 392 392 struct cstate *cst, uint16_t *p, 393 393 int pos_state, uint16_t *prob) { 394 - int offset; 394 + int offset; 395 395 uint16_t *prob_len; 396 396 int num_bits; 397 397 int len;
+8 -60
lib/find_bit.c
··· 29 29 * searching it for one bits. 30 30 * - The optional "addr2", which is anded with "addr1" if present. 31 31 */ 32 - static unsigned long _find_next_bit(const unsigned long *addr1, 32 + unsigned long _find_next_bit(const unsigned long *addr1, 33 33 const unsigned long *addr2, unsigned long nbits, 34 34 unsigned long start, unsigned long invert, unsigned long le) 35 35 { ··· 68 68 69 69 return min(start + __ffs(tmp), nbits); 70 70 } 71 - #endif 72 - 73 - #ifndef find_next_bit 74 - /* 75 - * Find the next set bit in a memory region. 76 - */ 77 - unsigned long find_next_bit(const unsigned long *addr, unsigned long size, 78 - unsigned long offset) 79 - { 80 - return _find_next_bit(addr, NULL, size, offset, 0UL, 0); 81 - } 82 - EXPORT_SYMBOL(find_next_bit); 83 - #endif 84 - 85 - #ifndef find_next_zero_bit 86 - unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, 87 - unsigned long offset) 88 - { 89 - return _find_next_bit(addr, NULL, size, offset, ~0UL, 0); 90 - } 91 - EXPORT_SYMBOL(find_next_zero_bit); 92 - #endif 93 - 94 - #if !defined(find_next_and_bit) 95 - unsigned long find_next_and_bit(const unsigned long *addr1, 96 - const unsigned long *addr2, unsigned long size, 97 - unsigned long offset) 98 - { 99 - return _find_next_bit(addr1, addr2, size, offset, 0UL, 0); 100 - } 101 - EXPORT_SYMBOL(find_next_and_bit); 71 + EXPORT_SYMBOL(_find_next_bit); 102 72 #endif 103 73 104 74 #ifndef find_first_bit 105 75 /* 106 76 * Find the first set bit in a memory region. 107 77 */ 108 - unsigned long find_first_bit(const unsigned long *addr, unsigned long size) 78 + unsigned long _find_first_bit(const unsigned long *addr, unsigned long size) 109 79 { 110 80 unsigned long idx; 111 81 ··· 86 116 87 117 return size; 88 118 } 89 - EXPORT_SYMBOL(find_first_bit); 119 + EXPORT_SYMBOL(_find_first_bit); 90 120 #endif 91 121 92 122 #ifndef find_first_zero_bit 93 123 /* 94 124 * Find the first cleared bit in a memory region. 95 125 */ 96 - unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size) 126 + unsigned long _find_first_zero_bit(const unsigned long *addr, unsigned long size) 97 127 { 98 128 unsigned long idx; 99 129 ··· 104 134 105 135 return size; 106 136 } 107 - EXPORT_SYMBOL(find_first_zero_bit); 137 + EXPORT_SYMBOL(_find_first_zero_bit); 108 138 #endif 109 139 110 140 #ifndef find_last_bit 111 - unsigned long find_last_bit(const unsigned long *addr, unsigned long size) 141 + unsigned long _find_last_bit(const unsigned long *addr, unsigned long size) 112 142 { 113 143 if (size) { 114 144 unsigned long val = BITMAP_LAST_WORD_MASK(size); ··· 124 154 } 125 155 return size; 126 156 } 127 - EXPORT_SYMBOL(find_last_bit); 157 + EXPORT_SYMBOL(_find_last_bit); 128 158 #endif 129 - 130 - #ifdef __BIG_ENDIAN 131 - 132 - #ifndef find_next_zero_bit_le 133 - unsigned long find_next_zero_bit_le(const void *addr, unsigned 134 - long size, unsigned long offset) 135 - { 136 - return _find_next_bit(addr, NULL, size, offset, ~0UL, 1); 137 - } 138 - EXPORT_SYMBOL(find_next_zero_bit_le); 139 - #endif 140 - 141 - #ifndef find_next_bit_le 142 - unsigned long find_next_bit_le(const void *addr, unsigned 143 - long size, unsigned long offset) 144 - { 145 - return _find_next_bit(addr, NULL, size, offset, 0UL, 1); 146 - } 147 - EXPORT_SYMBOL(find_next_bit_le); 148 - #endif 149 - 150 - #endif /* __BIG_ENDIAN */ 151 159 152 160 unsigned long find_next_clump8(unsigned long *clump, const unsigned long *addr, 153 161 unsigned long size, unsigned long offset)
+6 -1
lib/genalloc.c
··· 642 642 * @nr: The number of zeroed bits we're looking for 643 643 * @data: additional data - unused 644 644 * @pool: pool to find the fit region memory from 645 + * @start_addr: not used in this function 645 646 */ 646 647 unsigned long gen_pool_first_fit(unsigned long *map, unsigned long size, 647 648 unsigned long start, unsigned int nr, void *data, ··· 661 660 * @nr: The number of zeroed bits we're looking for 662 661 * @data: data for alignment 663 662 * @pool: pool to get order from 663 + * @start_addr: start addr of alloction chunk 664 664 */ 665 665 unsigned long gen_pool_first_fit_align(unsigned long *map, unsigned long size, 666 666 unsigned long start, unsigned int nr, void *data, ··· 689 687 * @nr: The number of zeroed bits we're looking for 690 688 * @data: data for alignment 691 689 * @pool: pool to get order from 690 + * @start_addr: not used in this function 692 691 */ 693 692 unsigned long gen_pool_fixed_alloc(unsigned long *map, unsigned long size, 694 693 unsigned long start, unsigned int nr, void *data, ··· 724 721 * @nr: The number of zeroed bits we're looking for 725 722 * @data: additional data - unused 726 723 * @pool: pool to find the fit region memory from 724 + * @start_addr: not used in this function 727 725 */ 728 726 unsigned long gen_pool_first_fit_order_align(unsigned long *map, 729 727 unsigned long size, unsigned long start, ··· 739 735 740 736 /** 741 737 * gen_pool_best_fit - find the best fitting region of memory 742 - * macthing the size requirement (no alignment constraint) 738 + * matching the size requirement (no alignment constraint) 743 739 * @map: The address to base the search on 744 740 * @size: The bitmap size in bits 745 741 * @start: The bitnumber to start searching at 746 742 * @nr: The number of zeroed bits we're looking for 747 743 * @data: additional data - unused 748 744 * @pool: pool to find the fit region memory from 745 + * @start_addr: not used in this function 749 746 * 750 747 * Iterate over the bitmap to find the smallest free region 751 748 * which we can allocate the memory.
+1 -1
lib/list_sort.c
··· 137 137 * 138 138 * 139 139 * The merging is controlled by "count", the number of elements in the 140 - * pending lists. This is beautiully simple code, but rather subtle. 140 + * pending lists. This is beautifully simple code, but rather subtle. 141 141 * 142 142 * Each time we increment "count", we set one bit (bit k) and clear 143 143 * bits k-1 .. 0. Each time this happens (except the very first time
+38 -23
lib/parser.c
··· 98 98 * locations. 99 99 * 100 100 * Description: Detects which if any of a set of token strings has been passed 101 - * to it. Tokens can include up to MAX_OPT_ARGS instances of basic c-style 101 + * to it. Tokens can include up to %MAX_OPT_ARGS instances of basic c-style 102 102 * format identifiers which will be taken into account when matching the 103 103 * tokens, and whose locations will be returned in the @args array. 104 104 */ ··· 120 120 * @base: base to use when converting string 121 121 * 122 122 * Description: Given a &substring_t and a base, attempts to parse the substring 123 - * as a number in that base. On success, sets @result to the integer represented 124 - * by the string and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 123 + * as a number in that base. 124 + * 125 + * Return: On success, sets @result to the integer represented by the 126 + * string and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 125 127 */ 126 128 static int match_number(substring_t *s, int *result, int base) 127 129 { ··· 155 153 * @base: base to use when converting string 156 154 * 157 155 * Description: Given a &substring_t and a base, attempts to parse the substring 158 - * as a number in that base. On success, sets @result to the integer represented 159 - * by the string and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 156 + * as a number in that base. 157 + * 158 + * Return: On success, sets @result to the integer represented by the 159 + * string and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 160 160 */ 161 161 static int match_u64int(substring_t *s, u64 *result, int base) 162 162 { ··· 182 178 * @s: substring_t to be scanned 183 179 * @result: resulting integer on success 184 180 * 185 - * Description: Attempts to parse the &substring_t @s as a decimal integer. On 186 - * success, sets @result to the integer represented by the string and returns 0. 187 - * Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 181 + * Description: Attempts to parse the &substring_t @s as a decimal integer. 182 + * 183 + * Return: On success, sets @result to the integer represented by the string 184 + * and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 188 185 */ 189 186 int match_int(substring_t *s, int *result) 190 187 { ··· 193 188 } 194 189 EXPORT_SYMBOL(match_int); 195 190 196 - /* 191 + /** 197 192 * match_uint - scan a decimal representation of an integer from a substring_t 198 193 * @s: substring_t to be scanned 199 194 * @result: resulting integer on success 200 195 * 201 - * Description: Attempts to parse the &substring_t @s as a decimal integer. On 202 - * success, sets @result to the integer represented by the string and returns 0. 203 - * Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 196 + * Description: Attempts to parse the &substring_t @s as a decimal integer. 197 + * 198 + * Return: On success, sets @result to the integer represented by the string 199 + * and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 204 200 */ 205 201 int match_uint(substring_t *s, unsigned int *result) 206 202 { ··· 223 217 * @result: resulting unsigned long long on success 224 218 * 225 219 * Description: Attempts to parse the &substring_t @s as a long decimal 226 - * integer. On success, sets @result to the integer represented by the 227 - * string and returns 0. 228 - * Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 220 + * integer. 221 + * 222 + * Return: On success, sets @result to the integer represented by the string 223 + * and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 229 224 */ 230 225 int match_u64(substring_t *s, u64 *result) 231 226 { ··· 239 232 * @s: substring_t to be scanned 240 233 * @result: resulting integer on success 241 234 * 242 - * Description: Attempts to parse the &substring_t @s as an octal integer. On 243 - * success, sets @result to the integer represented by the string and returns 244 - * 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 235 + * Description: Attempts to parse the &substring_t @s as an octal integer. 236 + * 237 + * Return: On success, sets @result to the integer represented by the string 238 + * and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 245 239 */ 246 240 int match_octal(substring_t *s, int *result) 247 241 { ··· 256 248 * @result: resulting integer on success 257 249 * 258 250 * Description: Attempts to parse the &substring_t @s as a hexadecimal integer. 259 - * On success, sets @result to the integer represented by the string and 260 - * returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 251 + * 252 + * Return: On success, sets @result to the integer represented by the string 253 + * and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. 261 254 */ 262 255 int match_hex(substring_t *s, int *result) 263 256 { ··· 272 263 * @str: the string to be parsed 273 264 * 274 265 * Description: Parse the string @str to check if matches wildcard 275 - * pattern @pattern. The pattern may contain two type wildcardes: 266 + * pattern @pattern. The pattern may contain two types of wildcards: 276 267 * '*' - matches zero or more characters 277 268 * '?' - matches one character 278 - * If it's matched, return true, else return false. 269 + * 270 + * Return: If the @str matches the @pattern, return true, else return false. 279 271 */ 280 272 bool match_wildcard(const char *pattern, const char *str) 281 273 { ··· 326 316 * 327 317 * Description: Copy the characters in &substring_t @src to the 328 318 * c-style string @dest. Copy no more than @size - 1 characters, plus 329 - * the terminating NUL. Return length of @src. 319 + * the terminating NUL. 320 + * 321 + * Return: length of @src. 330 322 */ 331 323 size_t match_strlcpy(char *dest, const substring_t *src, size_t size) 332 324 { ··· 350 338 * Description: Allocates and returns a string filled with the contents of 351 339 * the &substring_t @s. The caller is responsible for freeing the returned 352 340 * string with kfree(). 341 + * 342 + * Return: the address of the newly allocated NUL-terminated string or 343 + * %NULL on error. 353 344 */ 354 345 char *match_strdup(const substring_t *s) 355 346 {
+1 -1
lib/percpu_counter.c
··· 72 72 } 73 73 EXPORT_SYMBOL(percpu_counter_set); 74 74 75 - /** 75 + /* 76 76 * This function is both preempt and irq safe. The former is due to explicit 77 77 * preemption disable. The latter is guaranteed by the fact that the slow path 78 78 * is explicitly protected by an irq-safe spinlock whereas the fast patch uses
+3 -3
lib/stackdepot.c
··· 71 71 static int depot_index; 72 72 static int next_slab_inited; 73 73 static size_t depot_offset; 74 - static DEFINE_SPINLOCK(depot_lock); 74 + static DEFINE_RAW_SPINLOCK(depot_lock); 75 75 76 76 static bool init_stack_slab(void **prealloc) 77 77 { ··· 305 305 prealloc = page_address(page); 306 306 } 307 307 308 - spin_lock_irqsave(&depot_lock, flags); 308 + raw_spin_lock_irqsave(&depot_lock, flags); 309 309 310 310 found = find_stack(*bucket, entries, nr_entries, hash); 311 311 if (!found) { ··· 329 329 WARN_ON(!init_stack_slab(&prealloc)); 330 330 } 331 331 332 - spin_unlock_irqrestore(&depot_lock, flags); 332 + raw_spin_unlock_irqrestore(&depot_lock, flags); 333 333 exit: 334 334 if (prealloc) { 335 335 /* Nobody used this memory, ok to free it. */
+2 -2
mm/balloon_compaction.c
··· 58 58 /** 59 59 * balloon_page_list_dequeue() - removes pages from balloon's page list and 60 60 * returns a list of the pages. 61 - * @b_dev_info: balloon device decriptor where we will grab a page from. 61 + * @b_dev_info: balloon device descriptor where we will grab a page from. 62 62 * @pages: pointer to the list of pages that would be returned to the caller. 63 63 * @n_req_pages: number of requested pages. 64 64 * ··· 157 157 /* 158 158 * balloon_page_dequeue - removes a page from balloon's page list and returns 159 159 * its address to allow the driver to release the page. 160 - * @b_dev_info: balloon device decriptor where we will grab a page from. 160 + * @b_dev_info: balloon device descriptor where we will grab a page from. 161 161 * 162 162 * Driver must call this function to properly dequeue a previously enqueued page 163 163 * before definitively releasing it back to the guest system.
+2 -2
mm/compaction.c
··· 2012 2012 unsigned int wmark_low; 2013 2013 2014 2014 /* 2015 - * Cap the low watermak to avoid excessive compaction 2016 - * activity in case a user sets the proactivess tunable 2015 + * Cap the low watermark to avoid excessive compaction 2016 + * activity in case a user sets the proactiveness tunable 2017 2017 * close to 100 (maximum). 2018 2018 */ 2019 2019 wmark_low = max(100U - sysctl_compaction_proactiveness, 5U);
+1 -1
mm/filemap.c
··· 2755 2755 * entirely memory-based such as tmpfs, and filesystems which support 2756 2756 * unwritten extents. 2757 2757 * 2758 - * Return: The requested offset on successs, or -ENXIO if @whence specifies 2758 + * Return: The requested offset on success, or -ENXIO if @whence specifies 2759 2759 * SEEK_DATA and there is no data after @start. There is an implicit hole 2760 2760 * after @end - 1, so SEEK_HOLE returns @end if all the bytes between @start 2761 2761 * and @end contain data.
+1 -1
mm/gup.c
··· 1575 1575 * Returns NULL on any kind of failure - a hole must then be inserted into 1576 1576 * the corefile, to preserve alignment with its headers; and also returns 1577 1577 * NULL wherever the ZERO_PAGE, or an anonymous pte_none, has been found - 1578 - * allowing a hole to be left in the corefile to save diskspace. 1578 + * allowing a hole to be left in the corefile to save disk space. 1579 1579 * 1580 1580 * Called without mmap_lock (takes and releases the mmap_lock by itself). 1581 1581 */
+1 -1
mm/highmem.c
··· 519 519 520 520 /* 521 521 * Disable migration so resulting virtual address is stable 522 - * accross preemption. 522 + * across preemption. 523 523 */ 524 524 migrate_disable(); 525 525 preempt_disable();
+3 -3
mm/huge_memory.c
··· 1792 1792 /* 1793 1793 * Returns 1794 1794 * - 0 if PMD could not be locked 1795 - * - 1 if PMD was locked but protections unchange and TLB flush unnecessary 1796 - * - HPAGE_PMD_NR is protections changed and TLB flush necessary 1795 + * - 1 if PMD was locked but protections unchanged and TLB flush unnecessary 1796 + * - HPAGE_PMD_NR if protections changed and TLB flush necessary 1797 1797 */ 1798 1798 int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, 1799 1799 unsigned long addr, pgprot_t newprot, unsigned long cp_flags) ··· 2469 2469 xa_lock(&swap_cache->i_pages); 2470 2470 } 2471 2471 2472 - /* lock lru list/PageCompound, ref freezed by page_ref_freeze */ 2472 + /* lock lru list/PageCompound, ref frozen by page_ref_freeze */ 2473 2473 lruvec = lock_page_lruvec(head); 2474 2474 2475 2475 for (i = nr - 1; i >= 1; i--) {
+3 -3
mm/hugetlb.c
··· 466 466 resv->region_cache_count; 467 467 468 468 /* At this point, we should have enough entries in the cache 469 - * for all the existings adds_in_progress. We should only be 469 + * for all the existing adds_in_progress. We should only be 470 470 * needing to allocate for regions_needed. 471 471 */ 472 472 VM_BUG_ON(resv->region_cache_count < resv->adds_in_progress); ··· 5536 5536 v_end = ALIGN_DOWN(vma->vm_end, PUD_SIZE); 5537 5537 5538 5538 /* 5539 - * vma need span at least one aligned PUD size and the start,end range 5540 - * must at least partialy within it. 5539 + * vma needs to span at least one aligned PUD size, and the range 5540 + * must be at least partially within in. 5541 5541 */ 5542 5542 if (!(vma->vm_flags & VM_MAYSHARE) || !(v_end > v_start) || 5543 5543 (*end <= v_start) || (*start >= v_end))
+1 -1
mm/internal.h
··· 334 334 } 335 335 336 336 /* 337 - * Stack area - atomatically grows in one direction 337 + * Stack area - automatically grows in one direction 338 338 * 339 339 * VM_GROWSUP / VM_GROWSDOWN VMAs are always private anonymous: 340 340 * do_mmap() forbids all other combinations.
+4 -4
mm/kasan/kasan.h
··· 55 55 #define KASAN_TAG_MAX 0xFD /* maximum value for random tags */ 56 56 57 57 #ifdef CONFIG_KASAN_HW_TAGS 58 - #define KASAN_TAG_MIN 0xF0 /* mimimum value for random tags */ 58 + #define KASAN_TAG_MIN 0xF0 /* minimum value for random tags */ 59 59 #else 60 - #define KASAN_TAG_MIN 0x00 /* mimimum value for random tags */ 60 + #define KASAN_TAG_MIN 0x00 /* minimum value for random tags */ 61 61 #endif 62 62 63 63 #ifdef CONFIG_KASAN_GENERIC ··· 403 403 #else /* CONFIG_KASAN_HW_TAGS */ 404 404 405 405 /** 406 - * kasan_poison - mark the memory range as unaccessible 406 + * kasan_poison - mark the memory range as inaccessible 407 407 * @addr - range start address, must be aligned to KASAN_GRANULE_SIZE 408 408 * @size - range size, must be aligned to KASAN_GRANULE_SIZE 409 409 * @value - value that's written to metadata for the range ··· 434 434 435 435 /** 436 436 * kasan_poison_last_granule - mark the last granule of the memory range as 437 - * unaccessible 437 + * inaccessible 438 438 * @addr - range start address, must be aligned to KASAN_GRANULE_SIZE 439 439 * @size - range size 440 440 *
+2 -2
mm/kasan/quarantine.c
··· 27 27 /* Data structure and operations for quarantine queues. */ 28 28 29 29 /* 30 - * Each queue is a signle-linked list, which also stores the total size of 30 + * Each queue is a single-linked list, which also stores the total size of 31 31 * objects inside of it. 32 32 */ 33 33 struct qlist_head { ··· 138 138 local_irq_save(flags); 139 139 140 140 /* 141 - * As the object now gets freed from the quaratine, assume that its 141 + * As the object now gets freed from the quarantine, assume that its 142 142 * free track is no longer valid. 143 143 */ 144 144 *(u8 *)kasan_mem_to_shadow(object) = KASAN_KMALLOC_FREE;
+2 -2
mm/kasan/shadow.c
··· 316 316 * // rest of vmalloc process <data dependency> 317 317 * STORE p, a LOAD shadow(x+99) 318 318 * 319 - * If there is no barrier between the end of unpoisioning the shadow 319 + * If there is no barrier between the end of unpoisoning the shadow 320 320 * and the store of the result to p, the stores could be committed 321 321 * in a different order by CPU#0, and CPU#1 could erroneously observe 322 322 * poison in the shadow. ··· 384 384 * How does this work? 385 385 * ------------------- 386 386 * 387 - * We have a region that is page aligned, labelled as A. 387 + * We have a region that is page aligned, labeled as A. 388 388 * That might not map onto the shadow in a way that is page-aligned: 389 389 * 390 390 * start end
+1 -1
mm/kfence/report.c
··· 263 263 if (panic_on_warn) 264 264 panic("panic_on_warn set ...\n"); 265 265 266 - /* We encountered a memory unsafety error, taint the kernel! */ 266 + /* We encountered a memory safety error, taint the kernel! */ 267 267 add_taint(TAINT_BAD_PAGE, LOCKDEP_STILL_OK); 268 268 }
+1 -1
mm/khugepaged.c
··· 667 667 * 668 668 * The page table that maps the page has been already unlinked 669 669 * from the page table tree and this process cannot get 670 - * an additinal pin on the page. 670 + * an additional pin on the page. 671 671 * 672 672 * New pins can come later if the page is shared across fork, 673 673 * but not from this process. The other process cannot write to
+3 -3
mm/ksm.c
··· 459 459 * but taking great care only to touch a ksm page, in a VM_MERGEABLE vma, 460 460 * in case the application has unmapped and remapped mm,addr meanwhile. 461 461 * Could a ksm page appear anywhere else? Actually yes, in a VM_PFNMAP 462 - * mmap of /dev/mem or /dev/kmem, where we would not want to touch it. 462 + * mmap of /dev/mem, where we would not want to touch it. 463 463 * 464 464 * FAULT_FLAG/FOLL_REMOTE are because we do this outside the context 465 465 * of the process that owns 'vma'. We also do not want to enforce ··· 1065 1065 /* 1066 1066 * Ok this is tricky, when get_user_pages_fast() run it doesn't 1067 1067 * take any lock, therefore the check that we are going to make 1068 - * with the pagecount against the mapcount is racey and 1068 + * with the pagecount against the mapcount is racy and 1069 1069 * O_DIRECT can happen right after the check. 1070 1070 * So we clear the pte and flush the tlb before the check 1071 1071 * this assure us that no O_DIRECT can happen after the check ··· 1435 1435 */ 1436 1436 *_stable_node = found; 1437 1437 /* 1438 - * Just for robustneess as stable_node is 1438 + * Just for robustness, as stable_node is 1439 1439 * otherwise left as a stable pointer, the 1440 1440 * compiler shall optimize it away at build 1441 1441 * time.
+2 -2
mm/madvise.c
··· 799 799 if (end > vma->vm_end) { 800 800 /* 801 801 * Don't fail if end > vma->vm_end. If the old 802 - * vma was splitted while the mmap_lock was 802 + * vma was split while the mmap_lock was 803 803 * released the effect of the concurrent 804 804 * operation may not cause madvise() to 805 805 * have an undefined result. There may be an ··· 1039 1039 * MADV_DODUMP - cancel MADV_DONTDUMP: no longer exclude from core dump. 1040 1040 * MADV_COLD - the application is not expected to use this memory soon, 1041 1041 * deactivate pages in this range so that they can be reclaimed 1042 - * easily if memory pressure hanppens. 1042 + * easily if memory pressure happens. 1043 1043 * MADV_PAGEOUT - the application is not expected to use this memory soon, 1044 1044 * page out the pages in this range immediately. 1045 1045 *
+9 -9
mm/memcontrol.c
··· 215 215 #define MEMFILE_PRIVATE(x, val) ((x) << 16 | (val)) 216 216 #define MEMFILE_TYPE(val) ((val) >> 16 & 0xffff) 217 217 #define MEMFILE_ATTR(val) ((val) & 0xffff) 218 - /* Used for OOM nofiier */ 218 + /* Used for OOM notifier */ 219 219 #define OOM_CONTROL (0) 220 220 221 221 /* ··· 786 786 * __count_memcg_events - account VM events in a cgroup 787 787 * @memcg: the memory cgroup 788 788 * @idx: the event item 789 - * @count: the number of events that occured 789 + * @count: the number of events that occurred 790 790 */ 791 791 void __count_memcg_events(struct mem_cgroup *memcg, enum vm_event_item idx, 792 792 unsigned long count) ··· 904 904 rcu_read_lock(); 905 905 do { 906 906 /* 907 - * Page cache insertions can happen withou an 907 + * Page cache insertions can happen without an 908 908 * actual mm context, e.g. during disk probing 909 909 * on boot, loopback IO, acct() writes etc. 910 910 */ ··· 1712 1712 struct mem_cgroup *iter; 1713 1713 1714 1714 /* 1715 - * Be careful about under_oom underflows becase a child memcg 1715 + * Be careful about under_oom underflows because a child memcg 1716 1716 * could have been added after mem_cgroup_mark_under_oom. 1717 1717 */ 1718 1718 spin_lock(&memcg_oom_lock); ··· 1884 1884 /* 1885 1885 * There is no guarantee that an OOM-lock contender 1886 1886 * sees the wakeups triggered by the OOM kill 1887 - * uncharges. Wake any sleepers explicitely. 1887 + * uncharges. Wake any sleepers explicitly. 1888 1888 */ 1889 1889 memcg_oom_recover(memcg); 1890 1890 } ··· 4364 4364 * Foreign dirty flushing 4365 4365 * 4366 4366 * There's an inherent mismatch between memcg and writeback. The former 4367 - * trackes ownership per-page while the latter per-inode. This was a 4367 + * tracks ownership per-page while the latter per-inode. This was a 4368 4368 * deliberate design decision because honoring per-page ownership in the 4369 4369 * writeback path is complicated, may lead to higher CPU and IO overheads 4370 4370 * and deemed unnecessary given that write-sharing an inode across ··· 4379 4379 * triggering background writeback. A will be slowed down without a way to 4380 4380 * make writeback of the dirty pages happen. 4381 4381 * 4382 - * Conditions like the above can lead to a cgroup getting repatedly and 4382 + * Conditions like the above can lead to a cgroup getting repeatedly and 4383 4383 * severely throttled after making some progress after each 4384 - * dirty_expire_interval while the underyling IO device is almost 4384 + * dirty_expire_interval while the underlying IO device is almost 4385 4385 * completely idle. 4386 4386 * 4387 4387 * Solving this problem completely requires matching the ownership tracking ··· 5774 5774 return 0; 5775 5775 5776 5776 /* 5777 - * We are now commited to this value whatever it is. Changes in this 5777 + * We are now committed to this value whatever it is. Changes in this 5778 5778 * tunable will only affect upcoming migrations, not the current one. 5779 5779 * So we need to save it, and keep it going. 5780 5780 */
+1 -1
mm/memory-failure.c
··· 75 75 if (dissolve_free_huge_page(page) || !take_page_off_buddy(page)) 76 76 /* 77 77 * We could fail to take off the target page from buddy 78 - * for example due to racy page allocaiton, but that's 78 + * for example due to racy page allocation, but that's 79 79 * acceptable because soft-offlined page is not broken 80 80 * and if someone really want to use it, they should 81 81 * take it.
+9 -9
mm/memory.c
··· 3339 3339 } 3340 3340 3341 3341 3342 - delayacct_set_flag(DELAYACCT_PF_SWAPIN); 3342 + delayacct_set_flag(current, DELAYACCT_PF_SWAPIN); 3343 3343 page = lookup_swap_cache(entry, vma, vmf->address); 3344 3344 swapcache = page; 3345 3345 ··· 3388 3388 vmf->address, &vmf->ptl); 3389 3389 if (likely(pte_same(*vmf->pte, vmf->orig_pte))) 3390 3390 ret = VM_FAULT_OOM; 3391 - delayacct_clear_flag(DELAYACCT_PF_SWAPIN); 3391 + delayacct_clear_flag(current, DELAYACCT_PF_SWAPIN); 3392 3392 goto unlock; 3393 3393 } 3394 3394 ··· 3402 3402 * owner processes (which may be unknown at hwpoison time) 3403 3403 */ 3404 3404 ret = VM_FAULT_HWPOISON; 3405 - delayacct_clear_flag(DELAYACCT_PF_SWAPIN); 3405 + delayacct_clear_flag(current, DELAYACCT_PF_SWAPIN); 3406 3406 goto out_release; 3407 3407 } 3408 3408 3409 3409 locked = lock_page_or_retry(page, vma->vm_mm, vmf->flags); 3410 3410 3411 - delayacct_clear_flag(DELAYACCT_PF_SWAPIN); 3411 + delayacct_clear_flag(current, DELAYACCT_PF_SWAPIN); 3412 3412 if (!locked) { 3413 3413 ret |= VM_FAULT_RETRY; 3414 3414 goto out_release; ··· 3727 3727 return ret; 3728 3728 3729 3729 /* 3730 - * Archs like ppc64 need additonal space to store information 3730 + * Archs like ppc64 need additional space to store information 3731 3731 * related to pte entry. Use the preallocated table for that. 3732 3732 */ 3733 3733 if (arch_needs_pgtable_deposit() && !vmf->prealloc_pte) { ··· 4503 4503 } 4504 4504 4505 4505 /** 4506 - * mm_account_fault - Do page fault accountings 4506 + * mm_account_fault - Do page fault accounting 4507 4507 * 4508 4508 * @regs: the pt_regs struct pointer. When set to NULL, will skip accounting 4509 4509 * of perf event counters, but we'll still do the per-task accounting to ··· 4512 4512 * @flags: the fault flags. 4513 4513 * @ret: the fault retcode. 4514 4514 * 4515 - * This will take care of most of the page fault accountings. Meanwhile, it 4515 + * This will take care of most of the page fault accounting. Meanwhile, it 4516 4516 * will also include the PERF_COUNT_SW_PAGE_FAULTS_[MAJ|MIN] perf counter 4517 - * updates. However note that the handling of PERF_COUNT_SW_PAGE_FAULTS should 4517 + * updates. However, note that the handling of PERF_COUNT_SW_PAGE_FAULTS should 4518 4518 * still be in per-arch page fault handlers at the entry of page fault. 4519 4519 */ 4520 4520 static inline void mm_account_fault(struct pt_regs *regs, ··· 4848 4848 /** 4849 4849 * generic_access_phys - generic implementation for iomem mmap access 4850 4850 * @vma: the vma to access 4851 - * @addr: userspace addres, not relative offset within @vma 4851 + * @addr: userspace address, not relative offset within @vma 4852 4852 * @buf: buffer to read/write 4853 4853 * @len: length of transfer 4854 4854 * @write: set to FOLL_WRITE when writing, otherwise reading
+3 -3
mm/mempolicy.c
··· 994 994 if (flags & MPOL_F_ADDR) { 995 995 /* 996 996 * Take a refcount on the mpol, lookup_node() 997 - * wil drop the mmap_lock, so after calling 997 + * will drop the mmap_lock, so after calling 998 998 * lookup_node() only "pol" remains valid, "vma" 999 999 * is stale. 1000 1000 */ ··· 1867 1867 * we apply policy when gfp_zone(gfp) = ZONE_MOVABLE only. 1868 1868 * 1869 1869 * policy->v.nodes is intersect with node_states[N_MEMORY]. 1870 - * so if the following test faile, it implies 1870 + * so if the following test fails, it implies 1871 1871 * policy->v.nodes has movable memory only. 1872 1872 */ 1873 1873 if (!nodes_intersects(policy->v.nodes, node_states[N_HIGH_MEMORY])) ··· 2098 2098 * 2099 2099 * If tsk's mempolicy is "default" [NULL], return 'true' to indicate default 2100 2100 * policy. Otherwise, check for intersection between mask and the policy 2101 - * nodemask for 'bind' or 'interleave' policy. For 'perferred' or 'local' 2101 + * nodemask for 'bind' or 'interleave' policy. For 'preferred' or 'local' 2102 2102 * policy, always return true since it may allocate elsewhere on fallback. 2103 2103 * 2104 2104 * Takes task_lock(tsk) to prevent freeing of its mempolicy.
+4 -4
mm/migrate.c
··· 2779 2779 * 2780 2780 * For empty entries inside CPU page table (pte_none() or pmd_none() is true) we 2781 2781 * do set MIGRATE_PFN_MIGRATE flag inside the corresponding source array thus 2782 - * allowing the caller to allocate device memory for those unback virtual 2783 - * address. For this the caller simply has to allocate device memory and 2782 + * allowing the caller to allocate device memory for those unbacked virtual 2783 + * addresses. For this the caller simply has to allocate device memory and 2784 2784 * properly set the destination entry like for regular migration. Note that 2785 - * this can still fails and thus inside the device driver must check if the 2786 - * migration was successful for those entries after calling migrate_vma_pages() 2785 + * this can still fail, and thus inside the device driver you must check if the 2786 + * migration was successful for those entries after calling migrate_vma_pages(), 2787 2787 * just like for regular migration. 2788 2788 * 2789 2789 * After that, the callers must call migrate_vma_pages() to go over each entry
+2 -2
mm/mmap.c
··· 612 612 unsigned long nr_pages = 0; 613 613 struct vm_area_struct *vma; 614 614 615 - /* Find first overlaping mapping */ 615 + /* Find first overlapping mapping */ 616 616 vma = find_vma_intersection(mm, addr, end); 617 617 if (!vma) 618 618 return 0; ··· 2875 2875 if (unlikely(uf)) { 2876 2876 /* 2877 2877 * If userfaultfd_unmap_prep returns an error the vmas 2878 - * will remain splitted, but userland will get a 2878 + * will remain split, but userland will get a 2879 2879 * highly unexpected error anyway. This is no 2880 2880 * different than the case where the first of the two 2881 2881 * __split_vma fails, but we don't undo the first
+1 -1
mm/mprotect.c
··· 699 699 mmap_write_unlock(current->mm); 700 700 701 701 /* 702 - * We could provie warnings or errors if any VMA still 702 + * We could provide warnings or errors if any VMA still 703 703 * has the pkey set here. 704 704 */ 705 705 return ret;
+1 -1
mm/mremap.c
··· 730 730 * So, to avoid such scenario we can pre-compute if the whole 731 731 * operation has high chances to success map-wise. 732 732 * Worst-scenario case is when both vma's (new_addr and old_addr) get 733 - * split in 3 before unmaping it. 733 + * split in 3 before unmapping it. 734 734 * That means 2 more maps (1 for each) to the ones we already hold. 735 735 * Check whether current map count plus 2 still leads us to 4 maps below 736 736 * the threshold, otherwise return -ENOMEM here to be more safe.
-10
mm/nommu.c
··· 210 210 return count; 211 211 } 212 212 213 - long vwrite(char *buf, char *addr, unsigned long count) 214 - { 215 - /* Don't allow overflow */ 216 - if ((unsigned long) addr + count < count) 217 - count = -(unsigned long) addr; 218 - 219 - memcpy(addr, buf, count); 220 - return count; 221 - } 222 - 223 213 /* 224 214 * vmalloc - allocate virtually contiguous memory 225 215 *
+1 -1
mm/oom_kill.c
··· 74 74 75 75 #ifdef CONFIG_NUMA 76 76 /** 77 - * oom_cpuset_eligible() - check task eligiblity for kill 77 + * oom_cpuset_eligible() - check task eligibility for kill 78 78 * @start: task struct of which task to consider 79 79 * @oc: pointer to struct oom_control 80 80 *
+2 -2
mm/page-writeback.c
··· 1806 1806 break; 1807 1807 1808 1808 /* 1809 - * In the case of an unresponding NFS server and the NFS dirty 1809 + * In the case of an unresponsive NFS server and the NFS dirty 1810 1810 * pages exceeds dirty_thresh, give the other good wb's a pipe 1811 1811 * to go through, so that tasks on them still remain responsive. 1812 1812 * ··· 2216 2216 * Page truncated or invalidated. We can freely skip it 2217 2217 * then, even for data integrity operations: the page 2218 2218 * has disappeared concurrently, so there could be no 2219 - * real expectation of this data interity operation 2219 + * real expectation of this data integrity operation 2220 2220 * even if there is now a new, dirty page at the same 2221 2221 * pagecache address. 2222 2222 */
+8 -8
mm/page_alloc.c
··· 893 893 return false; 894 894 895 895 /* 896 - * Do not let lower order allocations polluate a movable pageblock. 896 + * Do not let lower order allocations pollute a movable pageblock. 897 897 * This might let an unmovable request use a reclaimable pageblock 898 898 * and vice-versa but no more than normal fallback logic which can 899 899 * have trouble finding a high-order free page. ··· 2776 2776 /* 2777 2777 * In page freeing path, migratetype change is racy so 2778 2778 * we can counter several free pages in a pageblock 2779 - * in this loop althoug we changed the pageblock type 2779 + * in this loop although we changed the pageblock type 2780 2780 * from highatomic to ac->migratetype. So we should 2781 2781 * adjust the count once. 2782 2782 */ ··· 3080 3080 * drain_all_pages doesn't use proper cpu hotplug protection so 3081 3081 * we can race with cpu offline when the WQ can move this from 3082 3082 * a cpu pinned worker to an unbound one. We can operate on a different 3083 - * cpu which is allright but we also have to make sure to not move to 3083 + * cpu which is alright but we also have to make sure to not move to 3084 3084 * a different one. 3085 3085 */ 3086 3086 preempt_disable(); ··· 4173 4173 } 4174 4174 4175 4175 /* 4176 - * Maximum number of compaction retries wit a progress before OOM 4176 + * Maximum number of compaction retries with a progress before OOM 4177 4177 * killer is consider as the only way to move forward. 4178 4178 */ 4179 4179 #define MAX_COMPACT_RETRIES 16 ··· 5929 5929 static int __parse_numa_zonelist_order(char *s) 5930 5930 { 5931 5931 /* 5932 - * We used to support different zonlists modes but they turned 5932 + * We used to support different zonelists modes but they turned 5933 5933 * out to be just not useful. Let's keep the warning in place 5934 5934 * if somebody still use the cmd line parameter so that we do 5935 5935 * not fail it silently ··· 7670 7670 } 7671 7671 7672 7672 /* 7673 - * Some architecturs, e.g. ARC may have ZONE_HIGHMEM below ZONE_NORMAL. For 7673 + * Some architectures, e.g. ARC may have ZONE_HIGHMEM below ZONE_NORMAL. For 7674 7674 * such cases we allow max_zone_pfn sorted in the descending order 7675 7675 */ 7676 7676 bool __weak arch_has_descending_max_zone_pfns(void) ··· 8728 8728 * alloc_contig_range() -- tries to allocate given range of pages 8729 8729 * @start: start PFN to allocate 8730 8730 * @end: one-past-the-last PFN to allocate 8731 - * @migratetype: migratetype of the underlaying pageblocks (either 8731 + * @migratetype: migratetype of the underlying pageblocks (either 8732 8732 * #MIGRATE_MOVABLE or #MIGRATE_CMA). All pageblocks 8733 8733 * in range must have the same migratetype and it must 8734 8734 * be either of the two. ··· 8988 8988 8989 8989 /* 8990 8990 * The zone indicated has a new number of managed_pages; batch sizes and percpu 8991 - * page high values need to be recalulated. 8991 + * page high values need to be recalculated. 8992 8992 */ 8993 8993 void __meminit zone_pcp_update(struct zone *zone) 8994 8994 {
+1 -1
mm/page_owner.c
··· 233 233 /* 234 234 * We don't clear the bit on the oldpage as it's going to be freed 235 235 * after migration. Until then, the info can be useful in case of 236 - * a bug, and the overal stats will be off a bit only temporarily. 236 + * a bug, and the overall stats will be off a bit only temporarily. 237 237 * Also, migrate_misplaced_transhuge_page() can still fail the 238 238 * migration and then we want the oldpage to retain the info. But 239 239 * in that case we also don't need to explicitly clear the info from
+1 -1
mm/page_vma_mapped.c
··· 134 134 * regardless of which page table level the page is mapped at. @pvmw->pmd is 135 135 * NULL. 136 136 * 137 - * Retruns false if there are no more page table entries for the page in 137 + * Returns false if there are no more page table entries for the page in 138 138 * the vma. @pvmw->ptl is unlocked and @pvmw->pte is unmapped. 139 139 * 140 140 * If you need to stop the walk before page_vma_mapped_walk() returned false,
+1 -1
mm/percpu-internal.h
··· 170 170 u64 nr_max_alloc; /* max # of live allocations */ 171 171 u32 nr_chunks; /* current # of live chunks */ 172 172 u32 nr_max_chunks; /* max # of live chunks */ 173 - size_t min_alloc_size; /* min allocaiton size */ 173 + size_t min_alloc_size; /* min allocation size */ 174 174 size_t max_alloc_size; /* max allocation size */ 175 175 }; 176 176
+1 -1
mm/percpu.c
··· 1862 1862 pr_info("limit reached, disable warning\n"); 1863 1863 } 1864 1864 if (is_atomic) { 1865 - /* see the flag handling in pcpu_blance_workfn() */ 1865 + /* see the flag handling in pcpu_balance_workfn() */ 1866 1866 pcpu_atomic_alloc_failed = true; 1867 1867 pcpu_schedule_balance_work(); 1868 1868 } else {
+3 -3
mm/pgalloc-track.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef _LINUX_PGALLLC_TRACK_H 3 - #define _LINUX_PGALLLC_TRACK_H 2 + #ifndef _LINUX_PGALLOC_TRACK_H 3 + #define _LINUX_PGALLOC_TRACK_H 4 4 5 5 #if defined(CONFIG_MMU) 6 6 static inline p4d_t *p4d_alloc_track(struct mm_struct *mm, pgd_t *pgd, ··· 48 48 (__pte_alloc_kernel(pmd) || ({*(mask)|=PGTBL_PMD_MODIFIED;0;})))?\ 49 49 NULL: pte_offset_kernel(pmd, address)) 50 50 51 - #endif /* _LINUX_PGALLLC_TRACK_H */ 51 + #endif /* _LINUX_PGALLOC_TRACK_H */
+1 -1
mm/rmap.c
··· 257 257 * Attach the anon_vmas from src to dst. 258 258 * Returns 0 on success, -ENOMEM on failure. 259 259 * 260 - * anon_vma_clone() is called by __vma_split(), __split_vma(), copy_vma() and 260 + * anon_vma_clone() is called by __vma_adjust(), __split_vma(), copy_vma() and 261 261 * anon_vma_fork(). The first three want an exact copy of src, while the last 262 262 * one, anon_vma_fork(), may try to reuse an existing anon_vma to prevent 263 263 * endless growth of anon_vma. Since dst->anon_vma is set to NULL before call,
+4 -4
mm/slab.c
··· 259 259 260 260 #define BATCHREFILL_LIMIT 16 261 261 /* 262 - * Optimization question: fewer reaps means less probability for unnessary 262 + * Optimization question: fewer reaps means less probability for unnecessary 263 263 * cpucache drain/refill cycles. 264 264 * 265 265 * OTOH the cpuarrays can contain lots of objects, ··· 2284 2284 * Because if it is the case, that means we defer the creation of 2285 2285 * the kmalloc_{dma,}_cache of size sizeof(slab descriptor) to this point. 2286 2286 * And we eventually call down to __kmem_cache_create(), which 2287 - * in turn looks up in the kmalloc_{dma,}_caches for the disired-size one. 2287 + * in turn looks up in the kmalloc_{dma,}_caches for the desired-size one. 2288 2288 * This is a "chicken-and-egg" problem. 2289 2289 * 2290 2290 * So the off-slab slab descriptor shall come from the kmalloc_{dma,}_caches, ··· 2381 2381 }; 2382 2382 2383 2383 /* 2384 - * Initialize the state based on the randomization methode available. 2385 - * return true if the pre-computed list is available, false otherwize. 2384 + * Initialize the state based on the randomization method available. 2385 + * return true if the pre-computed list is available, false otherwise. 2386 2386 */ 2387 2387 static bool freelist_state_initialize(union freelist_init_state *state, 2388 2388 struct kmem_cache *cachep,
+1 -1
mm/slub.c
··· 3391 3391 */ 3392 3392 3393 3393 /* 3394 - * Mininum / Maximum order of slab pages. This influences locking overhead 3394 + * Minimum / Maximum order of slab pages. This influences locking overhead 3395 3395 * and slab fragmentation. A higher order reduces the number of partial slabs 3396 3396 * and increases the number of allocations possible without having to 3397 3397 * take the list_lock.
+2 -2
mm/swap.c
··· 496 496 if (unlikely(unevictable) && !TestSetPageMlocked(page)) { 497 497 int nr_pages = thp_nr_pages(page); 498 498 /* 499 - * We use the irq-unsafe __mod_zone_page_stat because this 499 + * We use the irq-unsafe __mod_zone_page_state because this 500 500 * counter is not modified from interrupt context, and the pte 501 501 * lock is held(spinlock), which implies preemption disabled. 502 502 */ ··· 808 808 * below which drains the page vectors. 809 809 * 810 810 * Let x, y, and z represent some system CPU numbers, where x < y < z. 811 - * Assume CPU #z is is in the middle of the for_each_online_cpu loop 811 + * Assume CPU #z is in the middle of the for_each_online_cpu loop 812 812 * below and has already reached CPU #y's per-cpu data. CPU #x comes 813 813 * along, adds some pages to its per-cpu vectors, then calls 814 814 * lru_add_drain_all().
+1 -1
mm/swap_slots.c
··· 16 16 * to local caches without needing to acquire swap_info 17 17 * lock. We do not reuse the returned slots directly but 18 18 * move them back to the global pool in a batch. This 19 - * allows the slots to coaellesce and reduce fragmentation. 19 + * allows the slots to coalesce and reduce fragmentation. 20 20 * 21 21 * The swap entry allocated is marked with SWAP_HAS_CACHE 22 22 * flag in map_count that prevents it from being allocated
+1 -1
mm/swap_state.c
··· 792 792 * 793 793 * Returns the struct page for entry and addr, after queueing swapin. 794 794 * 795 - * Primitive swap readahead code. We simply read in a few pages whoes 795 + * Primitive swap readahead code. We simply read in a few pages whose 796 796 * virtual addresses are around the fault address in the same vma. 797 797 * 798 798 * Caller must hold read mmap_lock if vmf->vma is not NULL.
+5 -119
mm/vmalloc.c
··· 1583 1583 static atomic_long_t vmap_lazy_nr = ATOMIC_LONG_INIT(0); 1584 1584 1585 1585 /* 1586 - * Serialize vmap purging. There is no actual criticial section protected 1586 + * Serialize vmap purging. There is no actual critical section protected 1587 1587 * by this look, but we want to avoid concurrent calls for performance 1588 1588 * reasons and to make the pcpu_get_vm_areas more deterministic. 1589 1589 */ ··· 2628 2628 * May sleep if called *not* from interrupt context. 2629 2629 * Must not be called in NMI context (strictly speaking, it could be 2630 2630 * if we have CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG, but making the calling 2631 - * conventions for vfree() arch-depenedent would be a really bad idea). 2631 + * conventions for vfree() arch-dependent would be a really bad idea). 2632 2632 */ 2633 2633 void vfree(const void *addr) 2634 2634 { ··· 3141 3141 /* 3142 3142 * To do safe access to this _mapped_ area, we need 3143 3143 * lock. But adding lock here means that we need to add 3144 - * overhead of vmalloc()/vfree() calles for this _debug_ 3144 + * overhead of vmalloc()/vfree() calls for this _debug_ 3145 3145 * interface, rarely used. Instead of that, we'll use 3146 3146 * kmap() and get small overhead in this access function. 3147 3147 */ 3148 3148 if (p) { 3149 - /* 3150 - * we can expect USER0 is not used (see vread/vwrite's 3151 - * function description) 3152 - */ 3149 + /* We can expect USER0 is not used -- see vread() */ 3153 3150 void *map = kmap_atomic(p); 3154 3151 memcpy(buf, map + offset, length); 3155 3152 kunmap_atomic(map); 3156 3153 } else 3157 3154 memset(buf, 0, length); 3158 3155 3159 - addr += length; 3160 - buf += length; 3161 - copied += length; 3162 - count -= length; 3163 - } 3164 - return copied; 3165 - } 3166 - 3167 - static int aligned_vwrite(char *buf, char *addr, unsigned long count) 3168 - { 3169 - struct page *p; 3170 - int copied = 0; 3171 - 3172 - while (count) { 3173 - unsigned long offset, length; 3174 - 3175 - offset = offset_in_page(addr); 3176 - length = PAGE_SIZE - offset; 3177 - if (length > count) 3178 - length = count; 3179 - p = vmalloc_to_page(addr); 3180 - /* 3181 - * To do safe access to this _mapped_ area, we need 3182 - * lock. But adding lock here means that we need to add 3183 - * overhead of vmalloc()/vfree() calles for this _debug_ 3184 - * interface, rarely used. Instead of that, we'll use 3185 - * kmap() and get small overhead in this access function. 3186 - */ 3187 - if (p) { 3188 - /* 3189 - * we can expect USER0 is not used (see vread/vwrite's 3190 - * function description) 3191 - */ 3192 - void *map = kmap_atomic(p); 3193 - memcpy(map + offset, buf, length); 3194 - kunmap_atomic(map); 3195 - } 3196 3156 addr += length; 3197 3157 buf += length; 3198 3158 copied += length; ··· 3179 3219 * Note: In usual ops, vread() is never necessary because the caller 3180 3220 * should know vmalloc() area is valid and can use memcpy(). 3181 3221 * This is for routines which have to access vmalloc area without 3182 - * any information, as /dev/kmem. 3222 + * any information, as /proc/kcore. 3183 3223 * 3184 3224 * Return: number of bytes for which addr and buf should be increased 3185 3225 * (same number as @count) or %0 if [addr...addr+count) doesn't ··· 3240 3280 if (buf != buf_start + buflen) 3241 3281 memset(buf, 0, buflen - (buf - buf_start)); 3242 3282 3243 - return buflen; 3244 - } 3245 - 3246 - /** 3247 - * vwrite() - write vmalloc area in a safe way. 3248 - * @buf: buffer for source data 3249 - * @addr: vm address. 3250 - * @count: number of bytes to be read. 3251 - * 3252 - * This function checks that addr is a valid vmalloc'ed area, and 3253 - * copy data from a buffer to the given addr. If specified range of 3254 - * [addr...addr+count) includes some valid address, data is copied from 3255 - * proper area of @buf. If there are memory holes, no copy to hole. 3256 - * IOREMAP area is treated as memory hole and no copy is done. 3257 - * 3258 - * If [addr...addr+count) doesn't includes any intersects with alive 3259 - * vm_struct area, returns 0. @buf should be kernel's buffer. 3260 - * 3261 - * Note: In usual ops, vwrite() is never necessary because the caller 3262 - * should know vmalloc() area is valid and can use memcpy(). 3263 - * This is for routines which have to access vmalloc area without 3264 - * any information, as /dev/kmem. 3265 - * 3266 - * Return: number of bytes for which addr and buf should be 3267 - * increased (same number as @count) or %0 if [addr...addr+count) 3268 - * doesn't include any intersection with valid vmalloc area 3269 - */ 3270 - long vwrite(char *buf, char *addr, unsigned long count) 3271 - { 3272 - struct vmap_area *va; 3273 - struct vm_struct *vm; 3274 - char *vaddr; 3275 - unsigned long n, buflen; 3276 - int copied = 0; 3277 - 3278 - /* Don't allow overflow */ 3279 - if ((unsigned long) addr + count < count) 3280 - count = -(unsigned long) addr; 3281 - buflen = count; 3282 - 3283 - spin_lock(&vmap_area_lock); 3284 - list_for_each_entry(va, &vmap_area_list, list) { 3285 - if (!count) 3286 - break; 3287 - 3288 - if (!va->vm) 3289 - continue; 3290 - 3291 - vm = va->vm; 3292 - vaddr = (char *) vm->addr; 3293 - if (addr >= vaddr + get_vm_area_size(vm)) 3294 - continue; 3295 - while (addr < vaddr) { 3296 - if (count == 0) 3297 - goto finished; 3298 - buf++; 3299 - addr++; 3300 - count--; 3301 - } 3302 - n = vaddr + get_vm_area_size(vm) - addr; 3303 - if (n > count) 3304 - n = count; 3305 - if (!(vm->flags & VM_IOREMAP)) { 3306 - aligned_vwrite(buf, addr, n); 3307 - copied++; 3308 - } 3309 - buf += n; 3310 - addr += n; 3311 - count -= n; 3312 - } 3313 - finished: 3314 - spin_unlock(&vmap_area_lock); 3315 - if (!copied) 3316 - return 0; 3317 3283 return buflen; 3318 3284 } 3319 3285
+1 -1
mm/vmstat.c
··· 934 934 935 935 /* 936 936 * this is only called if !populated_zone(zone), which implies no other users of 937 - * pset->vm_stat_diff[] exsist. 937 + * pset->vm_stat_diff[] exist. 938 938 */ 939 939 void drain_zonestat(struct zone *zone, struct per_cpu_pageset *pset) 940 940 {
+1 -1
mm/z3fold.c
··· 391 391 { 392 392 if (pool->inode) 393 393 iput(pool->inode); 394 - } 394 + } 395 395 396 396 /* Initializes the z3fold header of a newly allocated z3fold page */ 397 397 static struct z3fold_header *init_z3fold_page(struct page *page, bool headless,
+1 -1
mm/zpool.c
··· 336 336 * This may hold locks, disable interrupts, and/or preemption, 337 337 * and the zpool_unmap_handle() must be called to undo those 338 338 * actions. The code that uses the mapped handle should complete 339 - * its operatons on the mapped handle memory quickly and unmap 339 + * its operations on the mapped handle memory quickly and unmap 340 340 * as soon as possible. As the implementation may use per-cpu 341 341 * data, multiple handles should not be mapped concurrently on 342 342 * any cpu.
+3 -3
mm/zsmalloc.c
··· 61 61 #define ZSPAGE_MAGIC 0x58 62 62 63 63 /* 64 - * This must be power of 2 and greater than of equal to sizeof(link_free). 64 + * This must be power of 2 and greater than or equal to sizeof(link_free). 65 65 * These two conditions ensure that any 'struct link_free' itself doesn't 66 66 * span more than 1 page which avoids complex case of mapping 2 pages simply 67 67 * to restore link_free pointer values. ··· 530 530 * class maintains a list of zspages where each zspage is divided 531 531 * into equal sized chunks. Each allocation falls into one of these 532 532 * classes depending on its size. This function returns index of the 533 - * size class which has chunk size big enough to hold the give size. 533 + * size class which has chunk size big enough to hold the given size. 534 534 */ 535 535 static int get_size_class_index(int size) 536 536 { ··· 1227 1227 * zs_map_object - get address of allocated object from handle. 1228 1228 * @pool: pool from which the object was allocated 1229 1229 * @handle: handle returned from zs_malloc 1230 - * @mm: maping mode to use 1230 + * @mm: mapping mode to use 1231 1231 * 1232 1232 * Before using an object allocated from zs_malloc, it must be mapped using 1233 1233 * this function. When done with the object, it must be unmapped using
-2
samples/configfs/configfs_sample.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 2 /* 3 - * vim: noexpandtab ts=8 sts=0 sw=8: 4 - * 5 3 * configfs_example_macros.c - This file is a demonstration module 6 4 * containing a number of configfs subsystems. It uses the helper 7 5 * macros defined by configfs.h
+13 -2
scripts/checkpatch.pl
··· 5829 5829 next if ($arg =~ /\.\.\./); 5830 5830 next if ($arg =~ /^type$/i); 5831 5831 my $tmp_stmt = $define_stmt; 5832 - $tmp_stmt =~ s/\b(sizeof|typeof|__typeof__|__builtin\w+|typecheck\s*\(\s*$Type\s*,|\#+)\s*\(*\s*$arg\s*\)*\b//g; 5832 + $tmp_stmt =~ s/\b(__must_be_array|offsetof|sizeof|sizeof_field|__stringify|typeof|__typeof__|__builtin\w+|typecheck\s*\(\s*$Type\s*,|\#+)\s*\(*\s*$arg\s*\)*\b//g; 5833 5833 $tmp_stmt =~ s/\#+\s*$arg\b//g; 5834 5834 $tmp_stmt =~ s/\b$arg\s*\#\#//g; 5835 5835 my $use_cnt = () = $tmp_stmt =~ /\b$arg\b/g; ··· 7006 7006 } 7007 7007 7008 7008 # check for alloc argument mismatch 7009 - if ($line =~ /\b(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) { 7009 + if ($line =~ /\b((?:devm_)?(?:kcalloc|kmalloc_array))\s*\(\s*sizeof\b/) { 7010 7010 WARN("ALLOC_ARRAY_ARGS", 7011 7011 "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr); 7012 7012 } ··· 7196 7196 $line =~ /\b((?:un)?likely)\s*\(\s*$FuncArg\s*\)\s*$Compare/) { 7197 7197 WARN("LIKELY_MISUSE", 7198 7198 "Using $1 should generally have parentheses around the comparison\n" . $herecurr); 7199 + } 7200 + 7201 + # return sysfs_emit(foo, fmt, ...) fmt without newline 7202 + if ($line =~ /\breturn\s+sysfs_emit\s*\(\s*$FuncArg\s*,\s*($String)/ && 7203 + substr($rawline, $-[6], $+[6] - $-[6]) !~ /\\n"$/) { 7204 + my $offset = $+[6] - 1; 7205 + if (WARN("SYSFS_EMIT", 7206 + "return sysfs_emit(...) formats should include a terminating newline\n" . $herecurr) && 7207 + $fix) { 7208 + substr($fixed[$fixlinenr], $offset, 0) = '\\n'; 7209 + } 7199 7210 } 7200 7211 7201 7212 # nested likely/unlikely calls
+21 -2
scripts/gdb/linux/cpus.py
··· 16 16 from linux import tasks, utils 17 17 18 18 19 + task_type = utils.CachedType("struct task_struct") 20 + 21 + 19 22 MAX_CPUS = 4096 20 23 21 24 ··· 159 156 160 157 PerCpu() 161 158 159 + def get_current_task(cpu): 160 + task_ptr_type = task_type.get_type().pointer() 161 + 162 + if utils.is_target_arch("x86"): 163 + var_ptr = gdb.parse_and_eval("&current_task") 164 + return per_cpu(var_ptr, cpu).dereference() 165 + elif utils.is_target_arch("aarch64"): 166 + current_task_addr = gdb.parse_and_eval("$SP_EL0") 167 + if((current_task_addr >> 63) != 0): 168 + current_task = current_task_addr.cast(task_ptr_type) 169 + return current_task.dereference() 170 + else: 171 + raise gdb.GdbError("Sorry, obtaining the current task is not allowed " 172 + "while running in userspace(EL0)") 173 + else: 174 + raise gdb.GdbError("Sorry, obtaining the current task is not yet " 175 + "supported with this arch") 162 176 163 177 class LxCurrentFunc(gdb.Function): 164 178 """Return current task. ··· 187 167 super(LxCurrentFunc, self).__init__("lx_current") 188 168 189 169 def invoke(self, cpu=-1): 190 - var_ptr = gdb.parse_and_eval("&current_task") 191 - return per_cpu(var_ptr, cpu).dereference() 170 + return get_current_task(cpu) 192 171 193 172 194 173 LxCurrentFunc()
+2 -1
scripts/gdb/linux/symbols.py
··· 164 164 saved_state['breakpoint'].enabled = saved_state['enabled'] 165 165 166 166 def invoke(self, arg, from_tty): 167 - self.module_paths = [os.path.expanduser(p) for p in arg.split()] 167 + self.module_paths = [os.path.abspath(os.path.expanduser(p)) 168 + for p in arg.split()] 168 169 self.module_paths.append(os.getcwd()) 169 170 170 171 # enforce update
+3
scripts/spelling.txt
··· 480 480 deviece||device 481 481 devision||division 482 482 diable||disable 483 + diabled||disabled 483 484 dicline||decline 484 485 dictionnary||dictionary 485 486 didnt||didn't ··· 1028 1027 overaall||overall 1029 1028 overhread||overhead 1030 1029 overlaping||overlapping 1030 + overflw||overflow 1031 + overlfow||overflow 1031 1032 overide||override 1032 1033 overrided||overridden 1033 1034 overriden||overridden
+76 -9
tools/include/asm-generic/bitops/find.h
··· 2 2 #ifndef _TOOLS_LINUX_ASM_GENERIC_BITOPS_FIND_H_ 3 3 #define _TOOLS_LINUX_ASM_GENERIC_BITOPS_FIND_H_ 4 4 5 + extern unsigned long _find_next_bit(const unsigned long *addr1, 6 + const unsigned long *addr2, unsigned long nbits, 7 + unsigned long start, unsigned long invert, unsigned long le); 8 + extern unsigned long _find_first_bit(const unsigned long *addr, unsigned long size); 9 + extern unsigned long _find_first_zero_bit(const unsigned long *addr, unsigned long size); 10 + extern unsigned long _find_last_bit(const unsigned long *addr, unsigned long size); 11 + 5 12 #ifndef find_next_bit 6 13 /** 7 14 * find_next_bit - find the next set bit in a memory region ··· 19 12 * Returns the bit number for the next set bit 20 13 * If no bits are set, returns @size. 21 14 */ 22 - extern unsigned long find_next_bit(const unsigned long *addr, unsigned long 23 - size, unsigned long offset); 15 + static inline 16 + unsigned long find_next_bit(const unsigned long *addr, unsigned long size, 17 + unsigned long offset) 18 + { 19 + if (small_const_nbits(size)) { 20 + unsigned long val; 21 + 22 + if (unlikely(offset >= size)) 23 + return size; 24 + 25 + val = *addr & GENMASK(size - 1, offset); 26 + return val ? __ffs(val) : size; 27 + } 28 + 29 + return _find_next_bit(addr, NULL, size, offset, 0UL, 0); 30 + } 24 31 #endif 25 32 26 33 #ifndef find_next_and_bit ··· 48 27 * Returns the bit number for the next set bit 49 28 * If no bits are set, returns @size. 50 29 */ 51 - extern unsigned long find_next_and_bit(const unsigned long *addr1, 30 + static inline 31 + unsigned long find_next_and_bit(const unsigned long *addr1, 52 32 const unsigned long *addr2, unsigned long size, 53 - unsigned long offset); 33 + unsigned long offset) 34 + { 35 + if (small_const_nbits(size)) { 36 + unsigned long val; 37 + 38 + if (unlikely(offset >= size)) 39 + return size; 40 + 41 + val = *addr1 & *addr2 & GENMASK(size - 1, offset); 42 + return val ? __ffs(val) : size; 43 + } 44 + 45 + return _find_next_bit(addr1, addr2, size, offset, 0UL, 0); 46 + } 54 47 #endif 55 48 56 49 #ifndef find_next_zero_bit 57 - 58 50 /** 59 51 * find_next_zero_bit - find the next cleared bit in a memory region 60 52 * @addr: The address to base the search on ··· 77 43 * Returns the bit number of the next zero bit 78 44 * If no bits are zero, returns @size. 79 45 */ 46 + static inline 80 47 unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, 81 - unsigned long offset); 48 + unsigned long offset) 49 + { 50 + if (small_const_nbits(size)) { 51 + unsigned long val; 52 + 53 + if (unlikely(offset >= size)) 54 + return size; 55 + 56 + val = *addr | ~GENMASK(size - 1, offset); 57 + return val == ~0UL ? size : ffz(val); 58 + } 59 + 60 + return _find_next_bit(addr, NULL, size, offset, ~0UL, 0); 61 + } 82 62 #endif 83 63 84 64 #ifndef find_first_bit ··· 105 57 * Returns the bit number of the first set bit. 106 58 * If no bits are set, returns @size. 107 59 */ 108 - extern unsigned long find_first_bit(const unsigned long *addr, 109 - unsigned long size); 60 + static inline 61 + unsigned long find_first_bit(const unsigned long *addr, unsigned long size) 62 + { 63 + if (small_const_nbits(size)) { 64 + unsigned long val = *addr & GENMASK(size - 1, 0); 65 + 66 + return val ? __ffs(val) : size; 67 + } 68 + 69 + return _find_first_bit(addr, size); 70 + } 110 71 111 72 #endif /* find_first_bit */ 112 73 ··· 129 72 * Returns the bit number of the first cleared bit. 130 73 * If no bits are zero, returns @size. 131 74 */ 132 - unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size); 75 + static inline 76 + unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size) 77 + { 78 + if (small_const_nbits(size)) { 79 + unsigned long val = *addr | ~GENMASK(size - 1, 0); 80 + 81 + return val == ~0UL ? size : ffz(val); 82 + } 83 + 84 + return _find_first_zero_bit(addr, size); 85 + } 133 86 #endif 134 87 135 88 #endif /*_TOOLS_LINUX_ASM_GENERIC_BITOPS_FIND_H_ */
+3
tools/include/asm-generic/bitsperlong.h
··· 18 18 #define BITS_PER_LONG_LONG 64 19 19 #endif 20 20 21 + #define small_const_nbits(nbits) \ 22 + (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG && (nbits) > 0) 23 + 21 24 #endif /* __ASM_GENERIC_BITS_PER_LONG */
+5 -13
tools/include/linux/bitmap.h
··· 20 20 void bitmap_clear(unsigned long *map, unsigned int start, int len); 21 21 22 22 #define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1))) 23 + #define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1))) 23 24 24 - #define BITMAP_LAST_WORD_MASK(nbits) \ 25 - ( \ 26 - ((nbits) % BITS_PER_LONG) ? \ 27 - (1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL \ 28 - ) 29 - 30 - #define small_const_nbits(nbits) \ 31 - (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) 32 - 33 - static inline void bitmap_zero(unsigned long *dst, int nbits) 25 + static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) 34 26 { 35 27 if (small_const_nbits(nbits)) 36 28 *dst = 0UL; ··· 58 66 return find_first_zero_bit(src, nbits) == nbits; 59 67 } 60 68 61 - static inline int bitmap_weight(const unsigned long *src, int nbits) 69 + static inline int bitmap_weight(const unsigned long *src, unsigned int nbits) 62 70 { 63 71 if (small_const_nbits(nbits)) 64 72 return hweight_long(*src & BITMAP_LAST_WORD_MASK(nbits)); ··· 66 74 } 67 75 68 76 static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, 69 - const unsigned long *src2, int nbits) 77 + const unsigned long *src2, unsigned int nbits) 70 78 { 71 79 if (small_const_nbits(nbits)) 72 80 *dst = *src1 | *src2; ··· 133 141 * @buf: buffer to store output 134 142 * @size: size of @buf 135 143 */ 136 - size_t bitmap_scnprintf(unsigned long *bitmap, int nbits, 144 + size_t bitmap_scnprintf(unsigned long *bitmap, unsigned int nbits, 137 145 char *buf, size_t size); 138 146 139 147 /**
+2 -2
tools/lib/bitmap.c
··· 28 28 dst[k] = bitmap1[k] | bitmap2[k]; 29 29 } 30 30 31 - size_t bitmap_scnprintf(unsigned long *bitmap, int nbits, 31 + size_t bitmap_scnprintf(unsigned long *bitmap, unsigned int nbits, 32 32 char *buf, size_t size) 33 33 { 34 34 /* current bit is 'cur', most recently seen range is [rbot, rtop] */ 35 - int cur, rbot, rtop; 35 + unsigned int cur, rbot, rtop; 36 36 bool first = true; 37 37 size_t ret = 0; 38 38
+23 -33
tools/lib/find_bit.c
··· 28 28 * searching it for one bits. 29 29 * - The optional "addr2", which is anded with "addr1" if present. 30 30 */ 31 - static inline unsigned long _find_next_bit(const unsigned long *addr1, 31 + unsigned long _find_next_bit(const unsigned long *addr1, 32 32 const unsigned long *addr2, unsigned long nbits, 33 - unsigned long start, unsigned long invert) 33 + unsigned long start, unsigned long invert, unsigned long le) 34 34 { 35 - unsigned long tmp; 35 + unsigned long tmp, mask; 36 + (void) le; 36 37 37 38 if (unlikely(start >= nbits)) 38 39 return nbits; ··· 44 43 tmp ^= invert; 45 44 46 45 /* Handle 1st word. */ 47 - tmp &= BITMAP_FIRST_WORD_MASK(start); 46 + mask = BITMAP_FIRST_WORD_MASK(start); 47 + 48 + /* 49 + * Due to the lack of swab() in tools, and the fact that it doesn't 50 + * need little-endian support, just comment it out 51 + */ 52 + #if (0) 53 + if (le) 54 + mask = swab(mask); 55 + #endif 56 + 57 + tmp &= mask; 58 + 48 59 start = round_down(start, BITS_PER_LONG); 49 60 50 61 while (!tmp) { ··· 70 57 tmp ^= invert; 71 58 } 72 59 73 - return min(start + __ffs(tmp), nbits); 74 - } 60 + #if (0) 61 + if (le) 62 + tmp = swab(tmp); 75 63 #endif 76 64 77 - #ifndef find_next_bit 78 - /* 79 - * Find the next set bit in a memory region. 80 - */ 81 - unsigned long find_next_bit(const unsigned long *addr, unsigned long size, 82 - unsigned long offset) 83 - { 84 - return _find_next_bit(addr, NULL, size, offset, 0UL); 65 + return min(start + __ffs(tmp), nbits); 85 66 } 86 67 #endif 87 68 ··· 83 76 /* 84 77 * Find the first set bit in a memory region. 85 78 */ 86 - unsigned long find_first_bit(const unsigned long *addr, unsigned long size) 79 + unsigned long _find_first_bit(const unsigned long *addr, unsigned long size) 87 80 { 88 81 unsigned long idx; 89 82 ··· 100 93 /* 101 94 * Find the first cleared bit in a memory region. 102 95 */ 103 - unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size) 96 + unsigned long _find_first_zero_bit(const unsigned long *addr, unsigned long size) 104 97 { 105 98 unsigned long idx; 106 99 ··· 110 103 } 111 104 112 105 return size; 113 - } 114 - #endif 115 - 116 - #ifndef find_next_zero_bit 117 - unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, 118 - unsigned long offset) 119 - { 120 - return _find_next_bit(addr, NULL, size, offset, ~0UL); 121 - } 122 - #endif 123 - 124 - #ifndef find_next_and_bit 125 - unsigned long find_next_and_bit(const unsigned long *addr1, 126 - const unsigned long *addr2, unsigned long size, 127 - unsigned long offset) 128 - { 129 - return _find_next_bit(addr1, addr2, size, offset, 0UL); 130 106 } 131 107 #endif
+1
tools/scripts/Makefile.include
··· 38 38 EXTRA_WARNINGS += -Wundef 39 39 EXTRA_WARNINGS += -Wwrite-strings 40 40 EXTRA_WARNINGS += -Wformat 41 + EXTRA_WARNINGS += -Wno-type-limits 41 42 42 43 # Makefiles suck: This macro sets a default value of $(2) for the 43 44 # variable named by $(1), unless the variable has been set by
+44
tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c
··· 3449 3449 close(sfd[1]); 3450 3450 } 3451 3451 3452 + /* 3453 + * t0 t1 3454 + * (ew) \ / (ew) 3455 + * e0 3456 + * | (lt) 3457 + * s0 3458 + */ 3459 + TEST(epoll64) 3460 + { 3461 + pthread_t waiter[2]; 3462 + struct epoll_event e; 3463 + struct epoll_mtcontext ctx = { 0 }; 3464 + 3465 + signal(SIGUSR1, signal_handler); 3466 + 3467 + ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, ctx.sfd), 0); 3468 + 3469 + ctx.efd[0] = epoll_create(1); 3470 + ASSERT_GE(ctx.efd[0], 0); 3471 + 3472 + e.events = EPOLLIN; 3473 + ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); 3474 + 3475 + /* 3476 + * main will act as the emitter once both waiter threads are 3477 + * blocked and expects to both be awoken upon the ready event. 3478 + */ 3479 + ctx.main = pthread_self(); 3480 + ASSERT_EQ(pthread_create(&waiter[0], NULL, waiter_entry1a, &ctx), 0); 3481 + ASSERT_EQ(pthread_create(&waiter[1], NULL, waiter_entry1a, &ctx), 0); 3482 + 3483 + usleep(100000); 3484 + ASSERT_EQ(write(ctx.sfd[1], "w", 1), 1); 3485 + 3486 + ASSERT_EQ(pthread_join(waiter[0], NULL), 0); 3487 + ASSERT_EQ(pthread_join(waiter[1], NULL), 0); 3488 + 3489 + EXPECT_EQ(ctx.count, 2); 3490 + 3491 + close(ctx.efd[0]); 3492 + close(ctx.sfd[0]); 3493 + close(ctx.sfd[1]); 3494 + } 3495 + 3452 3496 TEST_HARNESS_MAIN
-1
tools/testing/selftests/kvm/lib/sparsebit.c
··· 1890 1890 */ 1891 1891 1892 1892 #include <stdlib.h> 1893 - #include <assert.h> 1894 1893 1895 1894 struct range { 1896 1895 sparsebit_idx_t first, last;
-1
tools/testing/selftests/mincore/mincore_selftest.c
··· 14 14 #include <sys/mman.h> 15 15 #include <string.h> 16 16 #include <fcntl.h> 17 - #include <string.h> 18 17 19 18 #include "../kselftest.h" 20 19 #include "../kselftest_harness.h"
-1
tools/testing/selftests/powerpc/mm/tlbie_test.c
··· 33 33 #include <sched.h> 34 34 #include <time.h> 35 35 #include <stdarg.h> 36 - #include <sched.h> 37 36 #include <pthread.h> 38 37 #include <signal.h> 39 38 #include <sys/prctl.h>
+1
tools/testing/selftests/proc/Makefile
··· 12 12 TEST_GEN_PROGS += proc-self-map-files-002 13 13 TEST_GEN_PROGS += proc-self-syscall 14 14 TEST_GEN_PROGS += proc-self-wchan 15 + TEST_GEN_PROGS += proc-subset-pid 15 16 TEST_GEN_PROGS += proc-uptime-001 16 17 TEST_GEN_PROGS += proc-uptime-002 17 18 TEST_GEN_PROGS += read
+121
tools/testing/selftests/proc/proc-subset-pid.c
··· 1 + /* 2 + * Copyright (c) 2021 Alexey Dobriyan <adobriyan@gmail.com> 3 + * 4 + * Permission to use, copy, modify, and distribute this software for any 5 + * purpose with or without fee is hereby granted, provided that the above 6 + * copyright notice and this permission notice appear in all copies. 7 + * 8 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 + */ 16 + /* 17 + * Test that "mount -t proc -o subset=pid" hides everything but pids, 18 + * /proc/self and /proc/thread-self. 19 + */ 20 + #undef NDEBUG 21 + #include <assert.h> 22 + #include <errno.h> 23 + #include <sched.h> 24 + #include <stdbool.h> 25 + #include <stdlib.h> 26 + #include <string.h> 27 + #include <sys/mount.h> 28 + #include <sys/types.h> 29 + #include <sys/stat.h> 30 + #include <fcntl.h> 31 + #include <dirent.h> 32 + #include <unistd.h> 33 + #include <stdio.h> 34 + 35 + static inline bool streq(const char *a, const char *b) 36 + { 37 + return strcmp(a, b) == 0; 38 + } 39 + 40 + static void make_private_proc(void) 41 + { 42 + if (unshare(CLONE_NEWNS) == -1) { 43 + if (errno == ENOSYS || errno == EPERM) { 44 + exit(4); 45 + } 46 + exit(1); 47 + } 48 + if (mount(NULL, "/", NULL, MS_PRIVATE|MS_REC, NULL) == -1) { 49 + exit(1); 50 + } 51 + if (mount(NULL, "/proc", "proc", 0, "subset=pid") == -1) { 52 + exit(1); 53 + } 54 + } 55 + 56 + static bool string_is_pid(const char *s) 57 + { 58 + while (1) { 59 + switch (*s++) { 60 + case '0':case '1':case '2':case '3':case '4': 61 + case '5':case '6':case '7':case '8':case '9': 62 + continue; 63 + 64 + case '\0': 65 + return true; 66 + 67 + default: 68 + return false; 69 + } 70 + } 71 + } 72 + 73 + int main(void) 74 + { 75 + make_private_proc(); 76 + 77 + DIR *d = opendir("/proc"); 78 + assert(d); 79 + 80 + struct dirent *de; 81 + 82 + bool dot = false; 83 + bool dot_dot = false; 84 + bool self = false; 85 + bool thread_self = false; 86 + 87 + while ((de = readdir(d))) { 88 + if (streq(de->d_name, ".")) { 89 + assert(!dot); 90 + dot = true; 91 + assert(de->d_type == DT_DIR); 92 + } else if (streq(de->d_name, "..")) { 93 + assert(!dot_dot); 94 + dot_dot = true; 95 + assert(de->d_type == DT_DIR); 96 + } else if (streq(de->d_name, "self")) { 97 + assert(!self); 98 + self = true; 99 + assert(de->d_type == DT_LNK); 100 + } else if (streq(de->d_name, "thread-self")) { 101 + assert(!thread_self); 102 + thread_self = true; 103 + assert(de->d_type == DT_LNK); 104 + } else { 105 + if (!string_is_pid(de->d_name)) { 106 + fprintf(stderr, "d_name '%s'\n", de->d_name); 107 + assert(0); 108 + } 109 + assert(de->d_type == DT_DIR); 110 + } 111 + } 112 + 113 + char c; 114 + int rv = readlink("/proc/cpuinfo", &c, 1); 115 + assert(rv == -1 && errno == ENOENT); 116 + 117 + int fd = open("/proc/cpuinfo", O_RDONLY); 118 + assert(fd == -1 && errno == ENOENT); 119 + 120 + return 0; 121 + }
+3 -1
tools/testing/selftests/proc/read.c
··· 14 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 15 */ 16 16 // Test 17 - // 1) read of every file in /proc 17 + // 1) read and lseek on every file in /proc 18 18 // 2) readlink of every symlink in /proc 19 19 // 3) recursively (1) + (2) for every directory in /proc 20 20 // 4) write to /proc/*/clear_refs and /proc/*/task/*/clear_refs ··· 45 45 fd = openat(dirfd(d), filename, O_RDONLY|O_NONBLOCK); 46 46 if (fd == -1) 47 47 return; 48 + /* struct proc_ops::proc_lseek is mandatory if file is seekable. */ 49 + (void)lseek(fd, 0, SEEK_SET); 48 50 rv = read(fd, buf, sizeof(buf)); 49 51 assert((0 <= rv && rv <= sizeof(buf)) || rv == -1); 50 52 close(fd);
-2
tools/usb/hcd-tests.sh
··· 272 272 echo '' 273 273 done 274 274 done 275 - 276 - # vim: sw=4