]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/filestore: simplify temp object collection check a little
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 20 May 2016 01:56:57 +0000 (09:56 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sun, 22 May 2016 06:38:36 +0000 (14:38 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/filestore/FileStore.h

index b143bdfd3a496b19a1b80aff19376ec4d8df0e65..d56113e465b36236b5cf5e586e51ae0f0c08db4c 100644 (file)
@@ -143,14 +143,12 @@ private:
   bool _need_temp_object_collection(const coll_t& cid, const ghobject_t& oid) {
     // - normal temp case: cid is pg, object is temp (pool < -1)
     // - hammer temp case: cid is pg (or already temp), object pool is -1
-    return (cid.is_pg() && (oid.hobj.pool < -1 ||
-                       oid.hobj.pool == -1));
+    return cid.is_pg() && oid.hobj.pool <= -1;
   }
   void _kludge_temp_object_collection(coll_t& cid, const ghobject_t& oid) {
     // - normal temp case: cid is pg, object is temp (pool < -1)
     // - hammer temp case: cid is pg (or already temp), object pool is -1
-    if (cid.is_pg() && (oid.hobj.pool < -1 ||
-                       oid.hobj.pool == -1))
+    if (cid.is_pg() && oid.hobj.pool <= -1)
       cid = cid.get_temp();
   }
   void init_temp_collections();