blob: 8b64221b432b2b3258e119912f08ac475fc1727c [file] [log] [blame]
Serge E. Hallyn08ce5f12008-04-29 01:00:10 -07001#include <linux/fs.h>
2
3#ifdef CONFIG_CGROUP_DEVICE
Al Viro482e0cd2011-06-19 13:01:04 -04004extern int __devcgroup_inode_permission(struct inode *inode, int mask);
Serge E. Hallyn08ce5f12008-04-29 01:00:10 -07005extern int devcgroup_inode_mknod(int mode, dev_t dev);
Al Viro482e0cd2011-06-19 13:01:04 -04006static inline int devcgroup_inode_permission(struct inode *inode, int mask)
7{
8 if (likely(!inode->i_rdev))
9 return 0;
10 if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode))
11 return 0;
12 return __devcgroup_inode_permission(inode, mask);
13}
Serge E. Hallyn08ce5f12008-04-29 01:00:10 -070014#else
15static inline int devcgroup_inode_permission(struct inode *inode, int mask)
16{ return 0; }
17static inline int devcgroup_inode_mknod(int mode, dev_t dev)
18{ return 0; }
19#endif