aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/proc_fs.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2013-04-11 21:48:30 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-05-01 17:29:41 -0400
commit270b5ac2151707c25d3327722c5badfbd95945bc (patch)
tree27e07d1c8f531f8a817071bdb7f8c2ae5282886c /include/linux/proc_fs.h
parent34db8aaf0f95ffac407d39da22972b38da631db4 (diff)
proc: Add proc_mkdir_data()
Add proc_mkdir_data() to allow procfs directories to be created that are annotated at the time of creation with private data rather than doing this post-creation. This means no access is then required to the proc_dir_entry struct to set this. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> cc: Neela Syam Kolli <megaraidlinux@lsi.com> cc: Jerry Chuang <jerry-chuang@realtek.com> cc: linux-scsi@vger.kernel.org cc: devel@driverdev.osuosl.org cc: linux-wireless@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/proc_fs.h')
-rw-r--r--include/linux/proc_fs.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 80d9e24a79ac..a0fb1c2f1d8e 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -73,6 +73,8 @@ extern int remove_proc_subtree(const char *name, struct proc_dir_entry *parent);
73extern struct proc_dir_entry *proc_symlink(const char *, 73extern struct proc_dir_entry *proc_symlink(const char *,
74 struct proc_dir_entry *, const char *); 74 struct proc_dir_entry *, const char *);
75extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *); 75extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *);
76extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
77 struct proc_dir_entry *, void *);
76extern struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode, 78extern struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode,
77 struct proc_dir_entry *parent); 79 struct proc_dir_entry *parent);
78 80
@@ -82,9 +84,6 @@ static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode,
82 return proc_create_data(name, mode, parent, proc_fops, NULL); 84 return proc_create_data(name, mode, parent, proc_fops, NULL);
83} 85}
84 86
85extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
86 struct proc_dir_entry *parent);
87
88extern void proc_set_size(struct proc_dir_entry *, loff_t); 87extern void proc_set_size(struct proc_dir_entry *, loff_t);
89extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t); 88extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
90#else 89#else
@@ -108,6 +107,8 @@ static inline struct proc_dir_entry *proc_symlink(const char *name,
108 struct proc_dir_entry *parent,const char *dest) {return NULL;} 107 struct proc_dir_entry *parent,const char *dest) {return NULL;}
109static inline struct proc_dir_entry *proc_mkdir(const char *name, 108static inline struct proc_dir_entry *proc_mkdir(const char *name,
110 struct proc_dir_entry *parent) {return NULL;} 109 struct proc_dir_entry *parent) {return NULL;}
110static inline struct proc_dir_entry *proc_mkdir_data(const char *name,
111 umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; }
111static inline struct proc_dir_entry *proc_mkdir_mode(const char *name, 112static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,
112 umode_t mode, struct proc_dir_entry *parent) { return NULL; } 113 umode_t mode, struct proc_dir_entry *parent) { return NULL; }
113static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {} 114static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {}
@@ -153,4 +154,10 @@ static inline void *PDE_DATA(const struct inode *inode)
153 return PROC_I(inode)->pde->data; 154 return PROC_I(inode)->pde->data;
154} 155}
155 156
157static inline struct proc_dir_entry *proc_net_mkdir(
158 struct net *net, const char *name, struct proc_dir_entry *parent)
159{
160 return proc_mkdir_data(name, 0, parent, net);
161}
162
156#endif /* _LINUX_PROC_FS_H */ 163#endif /* _LINUX_PROC_FS_H */