From 04a60da13369fef6ea11919a9b34f05bdbd3b444 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 30 Aug 2012 16:13:51 +0200 Subject: [PATCH 11/13] vfs: export __inode_permission() to modules Patch-mainline: not yet We need to be able to check inode permissions (but not filesystem implied permissions) for stackable filesystems. Expose this interface for overlayfs. Signed-off-by: Miklos Szeredi --- fs/internal.h | 5 ----- fs/namei.c | 1 + include/linux/fs.h | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) --- a/fs/internal.h +++ b/fs/internal.h @@ -42,7 +42,6 @@ static inline int __sync_blockdev(struct /* * namei.c */ -extern int __inode_permission(struct inode *, int); extern int user_path_mountpoint_at(int, const char __user *, unsigned int, struct path *); extern int vfs_path_lookup(struct dentry *, struct vfsmount *, const char *, unsigned int, struct path *); --- a/fs/namei.c +++ b/fs/namei.c @@ -402,6 +402,7 @@ int __inode_permission(struct inode *ino return security_inode_permission(inode, mask); } +EXPORT_SYMBOL(__inode_permission); /** * sb_permission - Check superblock-level permissions --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2221,6 +2221,7 @@ extern sector_t bmap(struct inode *, sec #endif extern int notify_change(struct dentry *, struct iattr *, struct inode **); extern int inode_permission(struct inode *, int); +extern int __inode_permission(struct inode *, int); extern int generic_permission(struct inode *, int); static inline bool execute_ok(struct inode *inode)