]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os: make zero values noops for set_alloc_hint() in FileStore 9452/head
authoryaoning <yaoning@unitedstack.com>
Fri, 24 Jun 2016 01:51:07 +0000 (09:51 +0800)
committeryaoning <yaoning@unitedstack.com>
Fri, 24 Jun 2016 01:51:07 +0000 (09:51 +0800)
Signed-off-by: yaoning <yaoning@unitedstack.com>
src/os/ObjectStore.h
src/os/filestore/FileStore.cc

index d48c9cca39de213b91834146a5b9ec4bb116e6a9..0176714deee935ee503458d4b1b380c2aa5c0b88 100644 (file)
@@ -1658,6 +1658,8 @@ public:
       data.ops++;
     }
 
+    /// Set allocation hint for an object
+    /// make 0 values(expected_object_size, expected_write_size) noops for all implementations
     void set_alloc_hint(
       coll_t cid,
       const ghobject_t &oid,
index 7939dfc195f911ee9055241cc3f3203d67f9d33d..861bfbd122a96c301c7d8105071c87ad5ce11862 100644 (file)
@@ -5423,7 +5423,10 @@ int FileStore::_set_alloc_hint(const coll_t& cid, const ghobject_t& oid,
   dout(15) << "set_alloc_hint " << cid << "/" << oid << " object_size " << expected_object_size << " write_size " << expected_write_size << dendl;
 
   FDRef fd;
-  int ret;
+  int ret = 0;
+
+  if (expected_object_size == 0 || expected_write_size == 0)
+    goto out;
 
   ret = lfn_open(cid, oid, false, &fd);
   if (ret < 0)