summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2011-06-17 22:33:20 +0200
committerEric W. Biederman <ebiederm@xmission.com>2012-11-20 13:19:19 +0100
commit33d6dce607573b5fd7a43168e0d91221b3ca532b (patch)
treec7743ed6aab1fe2026f20e6a1ddf708a16aa1c84 /include
parentuserns: Allow unprivilged mounts of proc and sysfs (diff)
downloadlinux-33d6dce607573b5fd7a43168e0d91221b3ca532b.tar.xz
linux-33d6dce607573b5fd7a43168e0d91221b3ca532b.zip
proc: Generalize proc inode allocation
Generalize the proc inode allocation so that it can be used without having to having to create a proc_dir_entry. This will allow namespace file descriptors to remain light weight entitities but still have the same inode number when the backing namespace is the same. Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/proc_fs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 31447819bc55..bf1d000fbba6 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -176,6 +176,8 @@ extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
extern struct file *proc_ns_fget(int fd);
extern bool proc_ns_inode(struct inode *inode);
+extern int proc_alloc_inum(unsigned int *pino);
+extern void proc_free_inum(unsigned int inum);
#else
#define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; })
@@ -235,6 +237,14 @@ static inline bool proc_ns_inode(struct inode *inode)
return false;
}
+static inline int proc_alloc_inum(unsigned int *inum)
+{
+ *inum = 1;
+ return 0;
+}
+static inline void proc_free_inum(unsigned int inum)
+{
+}
#endif /* CONFIG_PROC_FS */
#if !defined(CONFIG_PROC_KCORE)