diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-06-21 17:47:44 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-06-21 17:47:44 +0900 |
commit | 9dd056e9eba106ef622795b566f769a9ab0a49a8 (patch) | |
tree | 390c07ea2c3b9631c2e8fe64c1a6feba0b503e8b /include/linux/device_cgroup.h | |
parent | 08ef2e427b59393d68a65b16e97e894b662a5573 (diff) | |
parent | f2b9726105824fdeea32a339e5072a358f89a25b (diff) | |
download | op-kernel-dev-9dd056e9eba106ef622795b566f769a9ab0a49a8.zip op-kernel-dev-9dd056e9eba106ef622795b566f769a9ab0a49a8.tar.gz |
Merge branch 'sh/stable-updates' into sh-latest
Diffstat (limited to 'include/linux/device_cgroup.h')
-rw-r--r-- | include/linux/device_cgroup.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/device_cgroup.h b/include/linux/device_cgroup.h index 0b0d9c3..7aad1f4 100644 --- a/include/linux/device_cgroup.h +++ b/include/linux/device_cgroup.h @@ -2,8 +2,16 @@ #include <linux/fs.h> #ifdef CONFIG_CGROUP_DEVICE -extern int devcgroup_inode_permission(struct inode *inode, int mask); +extern int __devcgroup_inode_permission(struct inode *inode, int mask); extern int devcgroup_inode_mknod(int mode, dev_t dev); +static inline int devcgroup_inode_permission(struct inode *inode, int mask) +{ + if (likely(!inode->i_rdev)) + return 0; + if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode)) + return 0; + return __devcgroup_inode_permission(inode, mask); +} #else static inline int devcgroup_inode_permission(struct inode *inode, int mask) { return 0; } |