]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: drop unused _pad_* methods
authorSage Weil <sage@redhat.com>
Tue, 31 May 2016 18:33:55 +0000 (14:33 -0400)
committerSage Weil <sage@redhat.com>
Wed, 1 Jun 2016 15:40:49 +0000 (11:40 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 527338365edf3395528c9ad3524fe70f9e3ee292..587f9a723a5bad105f6bc53f75a1a474de186ed0 100644 (file)
@@ -5282,82 +5282,6 @@ void BlueStore::_pad_zeros(
   *_dout << dendl;
 }
 
-void BlueStore::_pad_zeros_head(
-  OnodeRef o,
-  bufferlist *bl, uint64_t *offset, uint64_t *length,
-  uint64_t chunk_size)
-{
-  dout(40) << "before:\n";
-  bl->hexdump(*_dout);
-  *_dout << dendl;
-  size_t front_pad = *offset % chunk_size;
-  assert(front_pad);  // or we wouldn't have been called
-  size_t front_copy = MIN(chunk_size - front_pad, *length);
-  bufferptr z;
-  if (front_copy + front_pad < chunk_size)
-    z = buffer::create(front_copy + front_pad);
-  else
-    z = buffer::create_page_aligned(chunk_size);
-  memset(z.c_str(), 0, front_pad);
-  memcpy(z.c_str() + front_pad, bl->get_contiguous(0, front_copy), front_copy);
-  bufferlist old, t;
-  old.swap(*bl);
-  bl->append(z);
-  if (front_copy < *length) {
-    t.substr_of(old, front_copy, *length - front_copy);
-    bl->claim_append(t);
-  }
-  *offset -= front_pad;
-  *length += front_pad;
-  dout(20) << __func__ << " pad 0x" << std::hex << front_pad
-          << " on front, now 0x" << *offset << "~" << *length << std::dec
-          << dendl;
-  dout(40) << "after:\n";
-  bl->hexdump(*_dout);
-  *_dout << dendl;
-}
-
-void BlueStore::_pad_zeros_tail(
-  TransContext *txc,
-  OnodeRef o,
-  bufferlist *bl, uint64_t offset, uint64_t *length,
-  uint64_t chunk_size)
-{
-  dout(40) << "before:\n";
-  bl->hexdump(*_dout);
-  *_dout << dendl;
-
-  // back
-  uint64_t end = offset + *length;
-  unsigned back_copy = end % chunk_size;
-  assert(back_copy);  // or we wouldn't have been called
-  uint64_t tail_len;
-  if (back_copy <= *length) {
-    // we start at or before the block boundary
-    tail_len = chunk_size;
-  } else {
-    // we start partway into the tail block
-    back_copy = *length;
-    tail_len = chunk_size - (offset % chunk_size);
-  }
-  uint64_t back_pad = tail_len - back_copy;
-  bufferptr tail(tail_len);
-  memcpy(tail.c_str(), bl->get_contiguous(*length - back_copy, back_copy),
-        back_copy);
-  memset(tail.c_str() + back_copy, 0, back_pad);
-  bufferlist old;
-  old.swap(*bl);
-  bl->substr_of(old, 0, *length - back_copy);
-  bl->append(tail);
-  *length += back_pad;
-  dout(20) << __func__ << " pad 0x" << std::hex << back_pad
-          << " on back, now 0x" << offset << "~" << *length << std::dec
-          << dendl;
-  dout(40) << "after:\n";
-  bl->hexdump(*_dout);
-  *_dout << dendl;
-}
-
 bool BlueStore::_can_overlay_write(OnodeRef o, uint64_t length)
 {
   return
index 29f6e50d28fdc4042eb488486e4d3eae05c9b2f9..891e40248d53958345f7185f53e5c7044901d580 100644 (file)
@@ -1287,13 +1287,6 @@ private:
   void _do_read_all_overlays(bluestore_wal_op_t& wo);
   void _pad_zeros(bufferlist *bl, uint64_t *offset, uint64_t *length,
                  uint64_t chunk_size);
-  void _pad_zeros_head(OnodeRef o, bufferlist *bl,
-                      uint64_t *offset, uint64_t *length,
-                      uint64_t chunk_size);
-  void _pad_zeros_tail(TransContext *txc,
-                      OnodeRef o, bufferlist *bl,
-                      uint64_t offset, uint64_t *length,
-                      uint64_t chunk_size);
   int _do_write(TransContext *txc,
                CollectionRef &c,
                OnodeRef o,