From: shiqi <1454927420@qq.com> Date: Wed, 29 Mar 2017 06:33:55 +0000 (+0800) Subject: os/bluestore: clean up Invalid return value judgment X-Git-Tag: v12.0.2~250^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14219%2Fhead;p=ceph.git os/bluestore: clean up Invalid return value judgment Signed-off-by: shiqi <1454927420@qq.com> --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 3c78e4a0c5fc..ae134795dacf 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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 { diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 839d47f90528..a29564ff9b84 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -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);