]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: use dir_result_t::END as flag
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 19 Sep 2013 05:53:56 +0000 (13:53 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Sat, 5 Oct 2013 03:31:12 +0000 (11:31 +0800)
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>
src/client/Client.h

index c7c9cef0e0c2d57f5ee09d537986c7fac54f2241..62eb1ec5fa0f4307a9ab7bdc31c964ab567d9985 100644 (file)
@@ -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();