diff options
author | Sage Weil <sage@newdream.net> | 2011-04-06 12:35:00 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2011-05-24 14:52:06 -0400 |
commit | 45e3d3eeb6578e523e100622266945ecd71723bb (patch) | |
tree | eb902b3b7ac75a93f739d15bf94c2b29bb3dbade /fs/ceph | |
parent | 3c454cf21645bc96668e286f6352ac2c4c895fa2 (diff) |
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.c | 8 |
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, | |||
107 | req->r_ino1 = vino; | 107 | req->r_ino1 = vino; |
108 | req->r_num_caps = 1; | 108 | req->r_num_caps = 1; |
109 | err = ceph_mdsc_do_request(mdsc, NULL, req); | 109 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
110 | inode = req->r_target_inode; | ||
111 | if (inode) | ||
112 | igrab(inode); | ||
110 | ceph_mdsc_put_request(req); | 113 | ceph_mdsc_put_request(req); |
111 | inode = ceph_find_inode(sb, vino); | ||
112 | if (!inode) | 114 | if (!inode) |
113 | return ERR_PTR(-ESTALE); | 115 | return ERR_PTR(-ESTALE); |
114 | } | 116 | } |
@@ -163,8 +165,10 @@ static struct dentry *__cfh_to_dentry(struct super_block *sb, | |||
163 | snprintf(req->r_path2, 16, "%d", cfh->parent_name_hash); | 165 | snprintf(req->r_path2, 16, "%d", cfh->parent_name_hash); |
164 | req->r_num_caps = 1; | 166 | req->r_num_caps = 1; |
165 | err = ceph_mdsc_do_request(mdsc, NULL, req); | 167 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
168 | inode = req->r_target_inode; | ||
169 | if (inode) | ||
170 | igrab(inode); | ||
166 | ceph_mdsc_put_request(req); | 171 | ceph_mdsc_put_request(req); |
167 | inode = ceph_find_inode(sb, vino); | ||
168 | if (!inode) | 172 | if (!inode) |
169 | return ERR_PTR(err ? err : -ESTALE); | 173 | return ERR_PTR(err ? err : -ESTALE); |
170 | } | 174 | } |