]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueStore: remove useless parameter. 16158/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Thu, 6 Jul 2017 16:34:39 +0000 (00:34 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Thu, 6 Jul 2017 16:34:39 +0000 (00:34 +0800)
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index ac47f0050a0cc71100fa98d59e686054b914e4f5..1e31067b5f0741c9327a7b6f1df868a66bc478f3 100644 (file)
@@ -9382,14 +9382,13 @@ void BlueStore::_do_write_small(
            b->get_blob().get_ondisk_length() >= b_off + b_len &&
            b->get_blob().is_unused(b_off, b_len) &&
            b->get_blob().is_allocated(b_off, b_len)) {
-         bufferlist padded;
-         _apply_padding(head_pad, tail_pad, bl, padded);
+         _apply_padding(head_pad, tail_pad, bl);
 
          dout(20) << __func__ << "  write to unused 0x" << std::hex
                   << b_off << "~" << b_len
                   << " pad 0x" << head_pad << " + 0x" << tail_pad
                   << std::dec << " of mutable " << *b << dendl;
-         _buffer_cache_write(txc, b, b_off, padded,
+         _buffer_cache_write(txc, b, b_off, bl,
                              wctx->buffered ? 0 : Buffer::FLAG_NOCACHE);
 
          if (!g_conf->bluestore_debug_omit_block_device_write) {
@@ -9404,17 +9403,17 @@ void BlueStore::_do_write_small(
                  op->extents.emplace_back(bluestore_pextent_t(offset, length));
                  return 0;
                });
-             op->data = padded;
+             op->data = bl;
            } else {
              b->get_blob().map_bl(
-               b_off, padded,
+               b_off, bl,
                [&](uint64_t offset, bufferlist& t) {
                  bdev->aio_write(offset, t,
                                  &txc->ioc, wctx->buffered);
                });
            }
          }
-         b->dirty_blob().calc_csum(b_off, padded);
+         b->dirty_blob().calc_csum(b_off, bl);
          dout(20) << __func__ << "  lex old " << *ep << dendl;
          Extent *le = o->extent_map.set_lextent(c, offset, b_off + head_pad, length,
                                                 b,
@@ -9444,8 +9443,7 @@ void BlueStore::_do_write_small(
            b_len % chunk_size == 0 &&
            b->get_blob().is_allocated(b_off, b_len)) {
 
-         bufferlist padded;
-         _apply_padding(head_pad, tail_pad, bl, padded);
+         _apply_padding(head_pad, tail_pad, bl);
 
          dout(20) << __func__ << "  reading head 0x" << std::hex << head_read
                   << " and tail 0x" << tail_read << std::dec << dendl;
@@ -9459,7 +9457,7 @@ void BlueStore::_do_write_small(
              head_bl.append_zero(zlen);
              logger->inc(l_bluestore_write_pad_bytes, zlen);
            }
-           padded.claim_prepend(head_bl);
+           bl.claim_prepend(head_bl);
            logger->inc(l_bluestore_write_penalty_read_ops);
          }
          if (tail_read) {
@@ -9472,14 +9470,14 @@ void BlueStore::_do_write_small(
              tail_bl.append_zero(zlen);
              logger->inc(l_bluestore_write_pad_bytes, zlen);
            }
-           padded.claim_append(tail_bl);
+           bl.claim_append(tail_bl);
            logger->inc(l_bluestore_write_penalty_read_ops);
          }
          logger->inc(l_bluestore_write_small_pre_read);
 
          bluestore_deferred_op_t *op = _get_deferred_op(txc, o);
          op->op = bluestore_deferred_op_t::OP_WRITE;
-         _buffer_cache_write(txc, b, b_off, padded,
+         _buffer_cache_write(txc, b, b_off, bl,
                              wctx->buffered ? 0 : Buffer::FLAG_NOCACHE);
 
          int r = b->get_blob().map(
@@ -9490,9 +9488,9 @@ void BlueStore::_do_write_small(
            });
          assert(r == 0);
          if (b->get_blob().csum_type) {
-           b->dirty_blob().calc_csum(b_off, padded);
+           b->dirty_blob().calc_csum(b_off, bl);
          }
-         op->data.claim(padded);
+         op->data.claim(bl);
          dout(20) << __func__ << "  deferred write 0x" << std::hex << b_off << "~"
                   << b_len << std::dec << " of mutable " << *b
                   << " at " << op->extents << dendl;
@@ -11385,10 +11383,8 @@ void BlueStore::flush_cache()
 
 void BlueStore::_apply_padding(uint64_t head_pad,
                               uint64_t tail_pad,
-                              bufferlist& bl,
                               bufferlist& padded)
 {
-  padded = bl;
   if (head_pad) {
     padded.prepend_zero(head_pad);
   }
index 808eaad1a77db4afd2d90805654adbc90d341f40..7f2429cb0537e33ea23b66a2a8888df6bb9ec608 100644 (file)
@@ -2081,7 +2081,6 @@ private:
 
   void _apply_padding(uint64_t head_pad,
                      uint64_t tail_pad,
-                     bufferlist& bl,
                      bufferlist& padded);
 
   // -- ondisk version ---