summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2013-04-12 05:48:30 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-05-02 01:29:41 +0400
commit270b5ac2151707c25d3327722c5badfbd95945bc (patch)
tree27e07d1c8f531f8a817071bdb7f8c2ae5282886c /include
parent34db8aaf0f95ffac407d39da22972b38da631db4 (diff)
downloadlinux-270b5ac2151707c25d3327722c5badfbd95945bc.tar.xz
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')
-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);
extern struct proc_dir_entry *proc_symlink(const char *,
struct proc_dir_entry *, const char *);
extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *);
+extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
+ struct proc_dir_entry *, void *);
extern struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode,
struct proc_dir_entry *parent);
@@ -82,9 +84,6 @@ static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode,
return proc_create_data(name, mode, parent, proc_fops, NULL);
}
-extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
- struct proc_dir_entry *parent);
-
extern void proc_set_size(struct proc_dir_entry *, loff_t);
extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
#else
@@ -108,6 +107,8 @@ static inline struct proc_dir_entry *proc_symlink(const char *name,
struct proc_dir_entry *parent,const char *dest) {return NULL;}
static inline struct proc_dir_entry *proc_mkdir(const char *name,
struct proc_dir_entry *parent) {return NULL;}
+static inline struct proc_dir_entry *proc_mkdir_data(const char *name,
+ umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; }
static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,
umode_t mode, struct proc_dir_entry *parent) { return NULL; }
static 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)
return PROC_I(inode)->pde->data;
}
+static inline struct proc_dir_entry *proc_net_mkdir(
+ struct net *net, const char *name, struct proc_dir_entry *parent)
+{
+ return proc_mkdir_data(name, 0, parent, net);
+}
+
#endif /* _LINUX_PROC_FS_H */