summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-04-29 05:27:30 +0200
committerIlya Dryomov <idryomov@gmail.com>2016-05-26 01:15:36 +0200
commitf3c4ebe65ea149ec892f94474233cfebe9cbe299 (patch)
tree4a6aa1280fa6160d55935577792cd5d46e18f665 /fs/ceph/mds_client.c
parentceph: don't forbid marking directory complete after forward seek (diff)
downloadlinux-f3c4ebe65ea149ec892f94474233cfebe9cbe299.tar.xz
linux-f3c4ebe65ea149ec892f94474233cfebe9cbe299.zip
ceph: using hash value to compose dentry offset
If MDS sorts dentries in dirfrag in hash order, we use hash value to compose dentry offset. dentry offset is: (0xff << 52) | ((24 bits hash) << 28) | (the nth entry hash hash collision) This offset is stable across directory fragmentation. This alos means there is no need to reset readdir offset if directory get fragmented in the middle of readdir. Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 48def22fc7b9..7ad31283d510 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -185,6 +185,7 @@ static int parse_reply_info_dir(void **p, void *end,
u16 flags = ceph_decode_16(p);
info->dir_end = !!(flags & CEPH_READDIR_FRAG_END);
info->dir_complete = !!(flags & CEPH_READDIR_FRAG_COMPLETE);
+ info->hash_order = !!(flags & CEPH_READDIR_HASH_ORDER);
}
if (num == 0)
goto done;