summaryrefslogtreecommitdiff
path: root/fs/orangefs/dcache.c
diff options
context:
space:
mode:
authorMike Marshall <hubcap@omnibond.com>2015-12-30 21:04:28 +0300
committerMike Marshall <hubcap@omnibond.com>2015-12-30 21:04:28 +0300
commitf987f4c28a0f9a1dee44ca33a29080859b70f24b (patch)
tree3c00961a8225e0773a2c36ee74d7f5fd1b03e7ac /fs/orangefs/dcache.c
parent4f20854bf7363cc28d4088f2fa954f1a63b5efce (diff)
downloadlinux-f987f4c28a0f9a1dee44ca33a29080859b70f24b.tar.xz
Orangefs: don't trigger copy_attributes_to_inode from d_revalidate.
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/dcache.c')
-rw-r--r--fs/orangefs/dcache.c50
1 files changed, 14 insertions, 36 deletions
diff --git a/fs/orangefs/dcache.c b/fs/orangefs/dcache.c
index 5dd9841df64e..0419981f773e 100644
--- a/fs/orangefs/dcache.c
+++ b/fs/orangefs/dcache.c
@@ -77,7 +77,7 @@ out_drop:
/*
* Verify that dentry is valid.
*
- * Should return 1 if dentry can still be trusted, else 0
+ * Should return 1 if dentry can still be trusted, else 0.
*/
static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
{
@@ -92,49 +92,27 @@ static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
/* find inode from dentry */
if (!dentry->d_inode) {
- gossip_debug(GOSSIP_DCACHE_DEBUG, "%s: negative dentry.\n",
+ gossip_debug(GOSSIP_DCACHE_DEBUG,
+ "%s: negative dentry.\n",
__func__);
- goto invalid_exit;
+ goto out;
}
gossip_debug(GOSSIP_DCACHE_DEBUG, "%s: inode valid.\n", __func__);
inode = dentry->d_inode;
- /*
- * first perform a lookup to make sure that the object not only
- * exists, but is still in the expected place in the name space
- */
- if (!is_root_handle(inode)) {
- if (!orangefs_revalidate_lookup(dentry))
- goto invalid_exit;
- } else {
- gossip_debug(GOSSIP_DCACHE_DEBUG,
- "%s: root handle, lookup skipped.\n",
- __func__);
+ /* skip root handle lookups. */
+ if (is_root_handle(inode)) {
+ ret = 1;
+ goto out;
}
- /* now perform getattr */
- gossip_debug(GOSSIP_DCACHE_DEBUG,
- "%s: doing getattr: inode: %p, handle: %pU\n",
- __func__,
- inode,
- get_khandle_from_ino(inode));
- ret = orangefs_inode_getattr(inode, ORANGEFS_ATTR_SYS_ALL_NOHINT);
- gossip_debug(GOSSIP_DCACHE_DEBUG,
- "%s: getattr %s (ret = %d), returning %s for dentry i_count=%d\n",
- __func__,
- (ret == 0 ? "succeeded" : "failed"),
- ret,
- (ret == 0 ? "valid" : "INVALID"),
- atomic_read(&inode->i_count));
- if (ret != 0)
- goto invalid_exit;
-
- /* dentry is valid! */
- return 1;
-
-invalid_exit:
- return 0;
+ /* lookup the object. */
+ if (orangefs_revalidate_lookup(dentry))
+ ret = 1;
+
+out:
+ return ret;
}
const struct dentry_operations orangefs_dentry_operations = {