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-09-24 08:45:56 +0800
commit98335ed16817ac329c960da5a559173b9ac9310a (patch)
tree537e6c9a9d9a635cd0c5fef48ab4e612f3b112df
parentc436bd417429c5ddedf90a53580287190396d516 (diff)
downloadceph-98335ed16817ac329c960da5a559173b9ac9310a.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();