Skip to content

Commit 855d976

Browse files
Alexey Dobriyantorvalds
authored andcommitted
proc: uninline proc_create()
Save some code from ~320 invocations all clearing last argument. add/remove: 3/0 grow/shrink: 0/158 up/down: 45/-702 (-657) function old new delta proc_create - 17 +17 __ksymtab_proc_create - 16 +16 __kstrtab_proc_create - 12 +12 yam_init_driver 301 298 -3 ... cifs_proc_init 249 228 -21 via_fb_pci_probe 2304 2280 -24 Link: http://lkml.kernel.org/r/20170819094702.GA27864@avx2 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>
1 parent 1240ea0 commit 855d976

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎fs/proc/generic.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,14 @@ struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
499499
}
500500
EXPORT_SYMBOL(proc_create_data);
501501

502+
struct proc_dir_entry *proc_create(const char *name, umode_t mode,
503+
struct proc_dir_entry *parent,
504+
const struct file_operations *proc_fops)
505+
{
506+
return proc_create_data(name, mode, parent, proc_fops, NULL);
507+
}
508+
EXPORT_SYMBOL(proc_create);
509+
502510
void proc_set_size(struct proc_dir_entry *de, loff_t size)
503511
{
504512
de->size = size;

‎include/linux/proc_fs.h‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@ extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
2828
const struct file_operations *,
2929
void *);
3030

31-
static inline struct proc_dir_entry *proc_create(
32-
const char *name, umode_t mode, struct proc_dir_entry *parent,
33-
const struct file_operations *proc_fops)
34-
{
35-
return proc_create_data(name, mode, parent, proc_fops, NULL);
36-
}
37-
31+
struct proc_dir_entry *proc_create(const char *name, umode_t mode, struct proc_dir_entry *parent, const struct file_operations *proc_fops);
3832
extern void proc_set_size(struct proc_dir_entry *, loff_t);
3933
extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
4034
extern void *PDE_DATA(const struct inode *);

0 commit comments

Comments
 (0)