From: Yan, Zheng Date: Thu, 19 Sep 2013 05:53:56 +0000 (+0800) Subject: client: use dir_result_t::END as flag X-Git-Tag: v0.72-rc1~39^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=405465128ac57f109f65b931df3db957a685cf5b;p=ceph.git client: use dir_result_t::END as flag So we don't lose the latest readdir frag and offset after marking end of readdir. Signed-off-by: Yan, Zheng --- diff --git a/src/client/Client.h b/src/client/Client.h index c7c9cef0e0c..62eb1ec5fa0 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -134,7 +134,7 @@ struct dir_result_t { return ((uint64_t)frag << SHIFT) | (uint64_t)off; } static unsigned fpos_frag(uint64_t p) { - return p >> SHIFT; + return (p & ~END) >> SHIFT; } static unsigned fpos_off(uint64_t p) { return p & MASK; @@ -173,8 +173,8 @@ struct dir_result_t { offset = (uint64_t)f << SHIFT; assert(sizeof(offset) == 8); } - void set_end() { offset = END; } - bool at_end() { return (offset == END); } + void set_end() { offset |= END; } + bool at_end() { return (offset & END); } void reset() { last_name.clear();