diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2011-06-18 06:33:29 -0700 |
---|---|---|
committer | Eric W. Biederman <ebiederm@aristanetworks.com> | 2011-08-08 13:50:30 -0500 |
commit | 67a991a89e5b28dabf8372017b2b33e67585e6c4 (patch) | |
tree | a7ceb8802b0840852024605f8d7244363a7f1db8 | |
parent | 019eefb14e4393373df8a47aaf977d1f55f68a21 (diff) | |
download | linux-namespace-control-devel-67a991a89e5b28dabf8372017b2b33e67585e6c4.tar.gz |
proc: Add a test for proc namespace inodes
Implement a test to see if an inode is a proc
namespace inode.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
-rw-r--r-- | fs/proc/namespaces.c | 4 | ||||
-rw-r--r-- | include/linux/proc_fs.h | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c index 041b64f33178b0..fd3ca058c2a6e8 100644 --- a/fs/proc/namespaces.c +++ b/fs/proc/namespaces.c @@ -330,3 +330,7 @@ out_invalid: return ERR_PTR(-EINVAL); } +bool proc_ns_inode(struct inode *inode) +{ + return inode->i_fop == &ns_file_operations; +} diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 5ebb8d7fcc0970..2dfe699b13f0c9 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -177,6 +177,7 @@ extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, struct proc_dir_entry *parent); 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); @@ -234,6 +235,11 @@ static inline struct file *proc_ns_fget(int fd) return ERR_PTR(-EINVAL); } +static bool proc_ns_inode(struct inode *inode) +{ + return false; +} + static inline int proc_alloc_inum(unsigned int *inum) { *inum = 1; |