]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: clean up Invalid return value judgment 14219/head
authorshiqi <1454927420@qq.com>
Wed, 29 Mar 2017 06:33:55 +0000 (14:33 +0800)
committershiqi <1454927420@qq.com>
Thu, 30 Mar 2017 06:33:53 +0000 (14:33 +0800)
Signed-off-by: shiqi <1454927420@qq.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 3c78e4a0c5fc263c37fe6de61d9ff15f9450739f..ae134795dacf3129e61f8bfce8430132a359a603 100644 (file)
@@ -8269,7 +8269,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
     case Transaction::OP_TRUNCATE:
       {
         uint64_t off = op->off;
-       r = _truncate(txc, c, o, off);
+       _truncate(txc, c, o, off);
       }
       break;
 
@@ -9431,7 +9431,7 @@ int BlueStore::_do_zero(TransContext *txc,
   return r;
 }
 
-int BlueStore::_do_truncate(
+void BlueStore::_do_truncate(
   TransContext *txc, CollectionRef& c, OnodeRef o, uint64_t offset)
 {
   dout(15) << __func__ << " " << c->cid << " " << o->oid
@@ -9440,7 +9440,7 @@ int BlueStore::_do_truncate(
   _dump_onode(o, 30);
 
   if (offset == o->onode.size)
-    return 0;
+    return ;
 
   if (offset < o->onode.size) {
     WriteContext wctx;
@@ -9465,10 +9465,9 @@ int BlueStore::_do_truncate(
   o->onode.size = offset;
 
   txc->write_onode(o);
-  return 0;
 }
 
-int BlueStore::_truncate(TransContext *txc,
+void BlueStore::_truncate(TransContext *txc,
                         CollectionRef& c,
                         OnodeRef& o,
                         uint64_t offset)
@@ -9476,11 +9475,7 @@ int BlueStore::_truncate(TransContext *txc,
   dout(15) << __func__ << " " << c->cid << " " << o->oid
           << " 0x" << std::hex << offset << std::dec
           << dendl;
-  int r = _do_truncate(txc, c, o, offset);
-  dout(10) << __func__ << " " << c->cid << " " << o->oid
-          << " 0x" << std::hex << offset << std::dec
-          << " = " << r << dendl;
-  return r;
+  _do_truncate(txc, c, o, offset);
 }
 
 int BlueStore::_do_remove(
@@ -9488,9 +9483,7 @@ int BlueStore::_do_remove(
   CollectionRef& c,
   OnodeRef o)
 {
-  int r = _do_truncate(txc, c, o, 0);
-  if (r < 0)
-    return r;
+  _do_truncate(txc, c, o, 0);
   if (o->onode.has_omap()) {
     o->flush();
     _do_omap_clear(txc, o->onode.nid);
@@ -9812,9 +9805,7 @@ int BlueStore::_clone(TransContext *txc,
 
   // clone data
   oldo->flush();
-  r = _do_truncate(txc, c, newo, 0);
-  if (r < 0)
-    goto out;
+  _do_truncate(txc, c, newo, 0);
   if (cct->_conf->bluestore_clone_cow) {
     _do_clone_range(txc, c, oldo, newo, 0, oldo->onode.size, 0);
   } else {
index 839d47f90528595115b9f4c8f4bcb2f1e98ad2f0..a29564ff9b8482f5381c2afc1f58d153c5ebf217 100644 (file)
@@ -2352,11 +2352,11 @@ private:
            CollectionRef& c,
            OnodeRef& o,
            uint64_t offset, size_t len);
-  int _do_truncate(TransContext *txc,
+  void _do_truncate(TransContext *txc,
                   CollectionRef& c,
                   OnodeRef o,
                   uint64_t offset);
-  int _truncate(TransContext *txc,
+  void _truncate(TransContext *txc,
                CollectionRef& c,
                OnodeRef& o,
                uint64_t offset);