Commit 9a86962b authored by Yan, Zheng's avatar Yan, Zheng Committed by Ilya Dryomov

ceph: cleanup ceph_readdir_prepopulate()

In LSSNAP case, req->r_dentry is already set to snapdir dentry.
Signed-off-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent b74fceae
...@@ -1477,7 +1477,6 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req, ...@@ -1477,7 +1477,6 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
struct dentry *dn; struct dentry *dn;
struct inode *in; struct inode *in;
int err = 0, skipped = 0, ret, i; int err = 0, skipped = 0, ret, i;
struct inode *snapdir = NULL;
struct ceph_mds_request_head *rhead = req->r_request->front.iov_base; struct ceph_mds_request_head *rhead = req->r_request->front.iov_base;
u32 frag = le32_to_cpu(rhead->args.readdir.frag); u32 frag = le32_to_cpu(rhead->args.readdir.frag);
u32 last_hash = 0; u32 last_hash = 0;
...@@ -1510,8 +1509,6 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req, ...@@ -1510,8 +1509,6 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
} }
if (le32_to_cpu(rinfo->head->op) == CEPH_MDS_OP_LSSNAP) { if (le32_to_cpu(rinfo->head->op) == CEPH_MDS_OP_LSSNAP) {
snapdir = ceph_get_snapdir(d_inode(parent));
parent = d_find_alias(snapdir);
dout("readdir_prepopulate %d items under SNAPDIR dn %p\n", dout("readdir_prepopulate %d items under SNAPDIR dn %p\n",
rinfo->dir_nr, parent); rinfo->dir_nr, parent);
} else { } else {
...@@ -1650,10 +1647,6 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req, ...@@ -1650,10 +1647,6 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
req->r_readdir_cache_idx = cache_ctl.index; req->r_readdir_cache_idx = cache_ctl.index;
} }
ceph_readdir_cache_release(&cache_ctl); ceph_readdir_cache_release(&cache_ctl);
if (snapdir) {
iput(snapdir);
dput(parent);
}
dout("readdir_prepopulate done\n"); dout("readdir_prepopulate done\n");
return err; return err;
} }
......
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