summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-09-19 13:53:56 +0800
committerYan, Zheng <zheng.z.yan@intel.com>2013-10-05 11:31:12 +0800
commit405465128ac57f109f65b931df3db957a685cf5b (patch)
treeee624c2c91e7755bd74b930e722e27dfe60abd11
parent5074464017eea816ff534bdd8dec446278fddd09 (diff)
downloadceph-405465128ac57f109f65b931df3db957a685cf5b.tar.gz
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 <zheng.z.yan@intel.com>
-rw-r--r--src/client/Client.h6
1 files changed, 3 insertions, 3 deletions
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();