proc: make struct proc_dir_entry::namelen unsigned int
1. namelen is declared "unsigned short" which hints for "maybe space savings".
Indeed in 2.4 struct proc_dir_entry looked like:
struct proc_dir_entry {
unsigned short low_ino;
unsigned short namelen;
Now, low_ino is "unsigned int", all savings were gone for a long time.
"struct proc_dir_entry" is not that countless to worry about it's size,
anyway.
2. converting from unsigned short to int/unsigned int can only create
problems, we better play it safe.
Space is not really conserved, because of natural alignment for the next
field. sizeof(struct proc_dir_entry) remains the same.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
fc3d8767b2
commit
312ec7e50c
2 changed files with 5 additions and 5 deletions
|
|
@ -50,7 +50,7 @@ typedef int (write_proc_t)(struct file *file, const char __user *buffer,
|
|||
|
||||
struct proc_dir_entry {
|
||||
unsigned int low_ino;
|
||||
unsigned short namelen;
|
||||
unsigned int namelen;
|
||||
const char *name;
|
||||
mode_t mode;
|
||||
nlink_t nlink;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue