diff options
author | David Howells <dhowells@redhat.com> | 2018-06-13 21:43:19 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-06-15 07:48:57 +0300 |
commit | 24074a35c5c975c94cd9691ae962855333aac47f (patch) | |
tree | 1b59ef017c85f158edf696564fe441fa2356ca3e /fs/proc/inode.c | |
parent | de52cf922a4a17d0a4cd34d697db62a01c1bd092 (diff) | |
download | linux-24074a35c5c975c94cd9691ae962855333aac47f.tar.xz |
proc: Make inline name size calculation automatic
Make calculation of the size of the inline name in struct proc_dir_entry
automatic, rather than having to manually encode the numbers and failing to
allow for lockdep.
Require a minimum inline name size of 33+1 to allow for names that look
like two hex numbers with a dash between.
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r-- | fs/proc/inode.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 2cf3b74391ca..85ffbd27f288 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -105,9 +105,8 @@ void __init proc_init_kmemcache(void) kmem_cache_create("pde_opener", sizeof(struct pde_opener), 0, SLAB_ACCOUNT|SLAB_PANIC, NULL); proc_dir_entry_cache = kmem_cache_create_usercopy( - "proc_dir_entry", sizeof(struct proc_dir_entry), 0, SLAB_PANIC, - offsetof(struct proc_dir_entry, inline_name), - sizeof_field(struct proc_dir_entry, inline_name), NULL); + "proc_dir_entry", SIZEOF_PDE_SLOT, 0, SLAB_PANIC, + OFFSETOF_PDE_NAME, SIZEOF_PDE_INLINE_NAME, NULL); } static int proc_show_options(struct seq_file *seq, struct dentry *root) |