summaryrefslogtreecommitdiff
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-04-27 17:48:30 +0800
committerIlya Dryomov <idryomov@gmail.com>2016-05-26 01:15:35 +0200
commit956d39d631dbcf7b57854873a24e309047f2a7f5 (patch)
tree1a813b9bf40a2eb0db472fcccfb9932c350315c5 /fs/ceph/mds_client.c
parent2a5beea3f1b6544d6c72ea220e860a2eda2f9104 (diff)
downloadlwn-956d39d631dbcf7b57854873a24e309047f2a7f5.tar.gz
lwn-956d39d631dbcf7b57854873a24e309047f2a7f5.zip
ceph: define 'end/complete' in readdir reply as bit flags
Set a flag in readdir request, which indicates that client interprets 'end/complete' as bit flags. So that mds can reply additional flags in readdir reply. Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 6220d3caf7ab..1c2befcd24fb 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -181,8 +181,11 @@ static int parse_reply_info_dir(void **p, void *end,
ceph_decode_need(p, end, sizeof(num) + 2, bad);
num = ceph_decode_32(p);
- info->dir_end = ceph_decode_8(p);
- info->dir_complete = ceph_decode_8(p);
+ {
+ u16 flags = ceph_decode_16(p);
+ info->dir_end = !!(flags & CEPH_READDIR_FRAG_END);
+ info->dir_complete = !!(flags & CEPH_READDIR_FRAG_COMPLETE);
+ }
if (num == 0)
goto done;