diff options
author | Yan, Zheng <zyan@redhat.com> | 2016-04-27 12:32:34 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-05-26 02:15:34 +0300 |
commit | a78600e7c4fb47fb5ef34265456b731fde27a9c3 (patch) | |
tree | 724fcddad82738b0ffefc4f29740e9ea69ed0de2 /fs/ceph/dir.c | |
parent | 1cd42a429174689c0df1c37b642654a1ab4d1506 (diff) | |
download | linux-a78600e7c4fb47fb5ef34265456b731fde27a9c3.tar.xz |
ceph: simplify 'offset in frag'
don't distinguish leftmost frag from other frags. always use 2 as
first entry's offset.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r-- | fs/ceph/dir.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 734508be1526..31a2cdf39210 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -414,10 +414,7 @@ more: if (req->r_reply_info.dir_end) { kfree(fi->last_name); fi->last_name = NULL; - if (ceph_frag_is_rightmost(frag)) - fi->next_offset = 2; - else - fi->next_offset = 0; + fi->next_offset = 2; } else { err = note_last_dentry(fi, rinfo->dir_dname[rinfo->dir_nr-1], @@ -468,7 +465,7 @@ more: /* more frags? */ if (!ceph_frag_is_rightmost(frag)) { frag = ceph_frag_next(frag); - off = 0; + off = 2; ctx->pos = ceph_make_fpos(frag, off); dout("readdir next frag is %x\n", frag); goto more; @@ -511,10 +508,7 @@ static void reset_readdir(struct ceph_file_info *fi, unsigned frag) fi->last_name = NULL; fi->dir_release_count = 0; fi->readdir_cache_idx = -1; - if (ceph_frag_is_leftmost(frag)) - fi->next_offset = 2; /* compensate for . and .. */ - else - fi->next_offset = 0; + fi->next_offset = 2; /* compensate for . and .. */ fi->flags &= ~CEPH_F_ATEND; } |