summaryrefslogtreecommitdiff
path: root/fs/orangefs/inode.c
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2016-01-30 21:46:54 +0300
committerMike Marshall <hubcap@omnibond.com>2016-02-04 22:12:37 +0300
commit933287da750edefbf0f449750fd67b4fc6c10013 (patch)
treebff11480a25729ac8adaeb25b1eb267a200b8679 /fs/orangefs/inode.c
parentfe88adc3661ff9eb2a9777277f9c3abf5909449f (diff)
downloadlinux-933287da750edefbf0f449750fd67b4fc6c10013.tar.xz
orangefs: Implement inode_operations->permission().
Thus d_revalidate is not obliged to check on as much, which will eventually lead the way to hammering the filesystem servers much less. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/inode.c')
-rw-r--r--fs/orangefs/inode.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index 040cd95b51c2..e9688f0b99d7 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -291,6 +291,24 @@ int orangefs_getattr(struct vfsmount *mnt,
return ret;
}
+int orangefs_permission(struct inode *inode, int mask)
+{
+ int ret;
+
+ if (mask & MAY_NOT_BLOCK)
+ return -ECHILD;
+
+ gossip_debug(GOSSIP_INODE_DEBUG, "%s: refreshing\n", __func__);
+
+ /* Make sure the permission (and other common attrs) are up to date. */
+ ret = orangefs_inode_getattr(inode,
+ ORANGEFS_ATTR_SYS_ALL_NOHINT_NOSIZE, 0);
+ if (ret < 0)
+ return ret;
+
+ return generic_permission(inode, mask);
+}
+
/* ORANGEDS2 implementation of VFS inode operations for files */
struct inode_operations orangefs_file_inode_operations = {
.get_acl = orangefs_get_acl,
@@ -301,6 +319,7 @@ struct inode_operations orangefs_file_inode_operations = {
.getxattr = generic_getxattr,
.listxattr = orangefs_listxattr,
.removexattr = generic_removexattr,
+ .permission = orangefs_permission,
};
static int orangefs_init_iops(struct inode *inode)