[PATCH] proc_fs: Out of line proc_create

28 views
Skip to first unread message

Iulia Manda

unread,
Jan 16, 2015, 8:49:20 AM1/16/15
to jo...@joshtriplett.org, opw-k...@googlegroups.com
Out of lining proc_create saves 256 bytes text.
Found using Andi Kleen's script, inline-account.py.

Bloat-o-meter output:
add/remove: 1/0 grow/shrink: 0/79 up/down: 18/-274 (-256)

Signed-off-by: Iulia Manda <iulia....@gmail.com>
---
fs/proc/generic.c | 7 +++++++
include/linux/proc_fs.h | 7 ++-----
2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 7fea132..2409b96 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -510,6 +510,13 @@ out:
}
EXPORT_SYMBOL(proc_create_data);

+struct proc_dir_entry *proc_create(
+ const char *name, umode_t mode, struct proc_dir_entry *parent,
+ const struct file_operations *proc_fops)
+{
+ return proc_create_data(name, mode, parent, proc_fops, NULL);
+}
+
void proc_set_size(struct proc_dir_entry *de, loff_t size)
{
de->size = size;
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index b97bf2e..405a822 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -27,12 +27,9 @@ extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
const struct file_operations *,
void *);

-static inline struct proc_dir_entry *proc_create(
+extern struct proc_dir_entry *proc_create(
const char *name, umode_t mode, struct proc_dir_entry *parent,
- const struct file_operations *proc_fops)
-{
- return proc_create_data(name, mode, parent, proc_fops, NULL);
-}
+ const struct file_operations *proc_fops);

extern void proc_set_size(struct proc_dir_entry *, loff_t);
extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
--
1.7.10.4

jo...@joshtriplett.org

unread,
Jan 16, 2015, 2:58:28 PM1/16/15
to Iulia Manda, opw-k...@googlegroups.com
On Fri, Jan 16, 2015 at 03:48:27PM +0200, Iulia Manda wrote:
> Out of lining proc_create saves 256 bytes text.
> Found using Andi Kleen's script, inline-account.py.
>
> Bloat-o-meter output:
> add/remove: 1/0 grow/shrink: 0/79 up/down: 18/-274 (-256)
>
> Signed-off-by: Iulia Manda <iulia....@gmail.com>

Seems completely sensible to me.

Reviewed-by: Josh Triplett <jo...@joshtriplett.org>
> --
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages