device_cgroup.h 597 B

12345678910111213141516171819
  1. #include <linux/fs.h>
  2. #ifdef CONFIG_CGROUP_DEVICE
  3. extern int __devcgroup_inode_permission(struct inode *inode, int mask);
  4. extern int devcgroup_inode_mknod(int mode, dev_t dev);
  5. static inline int devcgroup_inode_permission(struct inode *inode, int mask)
  6. {
  7. if (likely(!inode->i_rdev))
  8. return 0;
  9. if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode))
  10. return 0;
  11. return __devcgroup_inode_permission(inode, mask);
  12. }
  13. #else
  14. static inline int devcgroup_inode_permission(struct inode *inode, int mask)
  15. { return 0; }
  16. static inline int devcgroup_inode_mknod(int mode, dev_t dev)
  17. { return 0; }
  18. #endif