diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/namei.c b/fs/namei.c index c0d1abc36..37644f4a1 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -152,18 +152,10 @@ char * getname(const char * filename) * for filesystem access without changing the "normal" uids which * are used for other things.. */ -int permission(struct inode * inode,int mask) +int vfs_permission(struct inode * inode,int mask) { int mode = inode->i_mode; - if (inode->i_op && inode->i_op->permission) { - int retval; - lock_kernel(); - retval = inode->i_op->permission(inode, mask); - unlock_kernel(); - return retval; - } - if ((mask & S_IWOTH) && IS_RDONLY(inode) && (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))) return -EROFS; /* Nobody gets write access to a read-only fs */ @@ -188,6 +180,18 @@ int permission(struct inode * inode,int mask) return -EACCES; } +int permission(struct inode * inode,int mask) +{ + if (inode->i_op && inode->i_op->permission) { + int retval; + lock_kernel(); + retval = inode->i_op->permission(inode, mask); + unlock_kernel(); + return retval; + } + return vfs_permission(inode, mask); +} + /* * get_write_access() gets write permission for a file. * put_write_access() releases this write permission. |