summaryrefslogtreecommitdiff
path: root/fs/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-04-06 09:35:00 -0700
committerSage Weil <sage@newdream.net>2011-05-24 11:52:06 -0700
commit45e3d3eeb6578e523e100622266945ecd71723bb (patch)
treeeb902b3b7ac75a93f739d15bf94c2b29bb3dbade /fs/ceph
parent3c454cf21645bc96668e286f6352ac2c4c895fa2 (diff)
downloadlwn-45e3d3eeb6578e523e100622266945ecd71723bb.tar.gz
lwn-45e3d3eeb6578e523e100622266945ecd71723bb.zip
ceph: avoid inode lookup on nfs fh reconnect
If we get the inode from the MDS, we have a reference in req; don't do a fresh lookup. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/export.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index f1828af09912..a610d3d67488 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -107,8 +107,10 @@ static struct dentry *__fh_to_dentry(struct super_block *sb,
req->r_ino1 = vino;
req->r_num_caps = 1;
err = ceph_mdsc_do_request(mdsc, NULL, req);
+ inode = req->r_target_inode;
+ if (inode)
+ igrab(inode);
ceph_mdsc_put_request(req);
- inode = ceph_find_inode(sb, vino);
if (!inode)
return ERR_PTR(-ESTALE);
}
@@ -163,8 +165,10 @@ static struct dentry *__cfh_to_dentry(struct super_block *sb,
snprintf(req->r_path2, 16, "%d", cfh->parent_name_hash);
req->r_num_caps = 1;
err = ceph_mdsc_do_request(mdsc, NULL, req);
+ inode = req->r_target_inode;
+ if (inode)
+ igrab(inode);
ceph_mdsc_put_request(req);
- inode = ceph_find_inode(sb, vino);
if (!inode)
return ERR_PTR(err ? err : -ESTALE);
}