diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2011-06-17 16:33:20 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-11-20 07:19:19 -0500 |
commit | 33d6dce607573b5fd7a43168e0d91221b3ca532b (patch) | |
tree | c7743ed6aab1fe2026f20e6a1ddf708a16aa1c84 /include/linux/proc_fs.h | |
parent | 4f326c0064b20b78b8041f4d2f6fe188a1129f18 (diff) |
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/linux/proc_fs.h')
-rw-r--r-- | include/linux/proc_fs.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 31447819bc5..bf1d000fbba 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, | |||
176 | extern struct file *proc_ns_fget(int fd); | 176 | extern struct file *proc_ns_fget(int fd); |
177 | extern bool proc_ns_inode(struct inode *inode); | 177 | extern bool proc_ns_inode(struct inode *inode); |
178 | 178 | ||
179 | extern int proc_alloc_inum(unsigned int *pino); | ||
180 | extern void proc_free_inum(unsigned int inum); | ||
179 | #else | 181 | #else |
180 | 182 | ||
181 | #define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; }) | 183 | #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) | |||
235 | return false; | 237 | return false; |
236 | } | 238 | } |
237 | 239 | ||
240 | static inline int proc_alloc_inum(unsigned int *inum) | ||
241 | { | ||
242 | *inum = 1; | ||
243 | return 0; | ||
244 | } | ||
245 | static inline void proc_free_inum(unsigned int inum) | ||
246 | { | ||
247 | } | ||
238 | #endif /* CONFIG_PROC_FS */ | 248 | #endif /* CONFIG_PROC_FS */ |
239 | 249 | ||
240 | #if !defined(CONFIG_PROC_KCORE) | 250 | #if !defined(CONFIG_PROC_KCORE) |