[OPW,kernel] proc_fs: Out of line proc_create
diff mbox

Message ID 20150116134827.GA16969@winterfell
State New, archived
Headers show

Commit Message

Iulia Manda Jan. 16, 2015, 1:48 p.m. UTC
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.manda21@gmail.com>
---
 fs/proc/generic.c       |    7 +++++++
 include/linux/proc_fs.h |    7 ++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

Comments

Josh Triplett Jan. 16, 2015, 7:58 p.m. UTC | #1
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.manda21@gmail.com>

Seems completely sensible to me.

Reviewed-by: Josh Triplett <josh@joshtriplett.org>

>  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
> 
> -- 
> 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+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Patch
diff mbox

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);