Skip to content

Commit

Permalink
os/bluestore: only calculate csum when necessary
Browse files Browse the repository at this point in the history
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
  • Loading branch information
xiexingguo committed Jul 5, 2016
1 parent fa8107a commit c5e61a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/os/bluestore/BlueStore.cc
Expand Up @@ -5770,7 +5770,9 @@ void BlueStore::_do_write_small(
bdev->aio_write(offset, t,
&txc->ioc, wctx->buffered);
});
b->blob.calc_csum(b_off, padded);
if (b->blob.csum_type) {
b->blob.calc_csum(b_off, padded);
}
o->onode.punch_hole(offset, length, &wctx->lex_old);
dout(20) << __func__ << " lexold 0x" << std::hex << offset << std::dec
<< ": " << ep->second << dendl;
Expand Down

0 comments on commit c5e61a2

Please sign in to comment.