kernel-hacking-2024-linux-s.../fs/proc
David Howells 09570f9149 proc: make struct proc_dir_entry::name a terminal array rather than a pointer
Since __proc_create() appends the name it is given to the end of the PDE
structure that it allocates, there isn't a need to store a name pointer.
Instead we can just replace the name pointer with a terminal char array of
_unspecified_ length.  The compiler will simply append the string to statically
defined variables of PDE type overlapping any hole at the end of the structure
and, unlike specifying an explicitly _zero_ length array, won't give a warning
if you try to statically initialise it with a string of more than zero length.

Also, whilst we're at it:

 (1) Move namelen to end just prior to name and reduce it to a single byte
     (name shouldn't be longer than NAME_MAX).

 (2) Move pde_unload_lock two places further on so that if it's four bytes in
     size on a 64-bit machine, it won't cause an unused hole in the PDE struct.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-27 12:50:45 -07:00
..
array.c ptrace: s/tracehook_tracer_task()/ptrace_parent()/ 2011-06-22 19:26:29 +02:00
base.c proc: fix a race in do_io_accounting() 2011-07-26 16:49:43 -07:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
generic.c proc: make struct proc_dir_entry::name a terminal array rather than a pointer 2011-07-27 12:50:45 -07:00
inode.c procfs: return ENOENT on opening a being-removed proc entry 2011-07-26 16:49:43 -07:00
internal.h
interrupts.c
Kconfig
kcore.c
kmsg.c
loadavg.c
Makefile
meminfo.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
mmu.c
namespaces.c
nommu.c
page.c
proc_devtree.c
proc_net.c proc: make struct proc_dir_entry::name a terminal array rather than a pointer 2011-07-27 12:50:45 -07:00
proc_sysctl.c ->permission() sanitizing: don't pass flags to ->permission() 2011-07-20 01:43:24 -04:00
proc_tty.c
root.c proc: make struct proc_dir_entry::name a terminal array rather than a pointer 2011-07-27 12:50:45 -07:00
softirqs.c
stat.c
task_mmu.c
task_nommu.c
uptime.c
version.c
vmcore.c