Commit 45e3d3ee authored by Sage Weil's avatar Sage Weil

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: default avatarSage Weil <sage@newdream.net>
parent 3c454cf2
...@@ -107,8 +107,10 @@ static struct dentry *__fh_to_dentry(struct super_block *sb, ...@@ -107,8 +107,10 @@ static struct dentry *__fh_to_dentry(struct super_block *sb,
req->r_ino1 = vino; req->r_ino1 = vino;
req->r_num_caps = 1; req->r_num_caps = 1;
err = ceph_mdsc_do_request(mdsc, NULL, req); err = ceph_mdsc_do_request(mdsc, NULL, req);
inode = req->r_target_inode;
if (inode)
igrab(inode);
ceph_mdsc_put_request(req); ceph_mdsc_put_request(req);
inode = ceph_find_inode(sb, vino);
if (!inode) if (!inode)
return ERR_PTR(-ESTALE); return ERR_PTR(-ESTALE);
} }
...@@ -163,8 +165,10 @@ static struct dentry *__cfh_to_dentry(struct super_block *sb, ...@@ -163,8 +165,10 @@ static struct dentry *__cfh_to_dentry(struct super_block *sb,
snprintf(req->r_path2, 16, "%d", cfh->parent_name_hash); snprintf(req->r_path2, 16, "%d", cfh->parent_name_hash);
req->r_num_caps = 1; req->r_num_caps = 1;
err = ceph_mdsc_do_request(mdsc, NULL, req); err = ceph_mdsc_do_request(mdsc, NULL, req);
inode = req->r_target_inode;
if (inode)
igrab(inode);
ceph_mdsc_put_request(req); ceph_mdsc_put_request(req);
inode = ceph_find_inode(sb, vino);
if (!inode) if (!inode)
return ERR_PTR(err ? err : -ESTALE); return ERR_PTR(err ? err : -ESTALE);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment