]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/bl: drop claim_append_piecewise() from bufferlist.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 19 Aug 2020 14:40:40 +0000 (16:40 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 21 Aug 2020 16:55:58 +0000 (18:55 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/common/buffer.cc
src/include/buffer.h
src/test/bufferlist.cc

index efd49b5b67115548566d60ab51bb72063d6b6b4c..8fce28ba31c05ad8ab262c5f7aea1dfb97299eb4 100644 (file)
@@ -1286,15 +1286,6 @@ static ceph::spinlock debug_lock;
     bl.clear();
   }
 
-  void buffer::list::claim_append_piecewise(list& bl)
-  {
-    // steal the other guy's buffers
-    for (const auto& node : bl.buffers()) {
-      append(node, 0, node.length());
-    }
-    bl.clear();
-  }
-
   void buffer::list::append(char c)
   {
     // put what we can into the existing append_buffer.
index 97c54d51132e36a04aa031b3d40554894c5847ba..93ef1b57f8742035f49368e480b464e91e8f79bb 100644 (file)
@@ -1091,8 +1091,6 @@ struct error_code;
     void claim_append(list&& bl) {
       claim_append(bl);
     }
-    // only for bl is bufferlist::page_aligned_appender
-    void claim_append_piecewise(list& bl);
 
     // copy with explicit volatile-sharing semantics
     void share(const list& bl)
index 4d00d576a14f394ecca9655886c6da64a0d7245b..c7dfc80c6e38fc352378798f4e144f219b84b29f 100644 (file)
@@ -1973,27 +1973,6 @@ TEST(BufferList, claim_append) {
   EXPECT_EQ((unsigned)0, from.length());
 }
 
-TEST(BufferList, claim_append_piecewise) {
-  bufferlist bl, t, dst;
-  auto a = bl.get_page_aligned_appender(4);
-  for (uint32_t i = 0; i < (CEPH_PAGE_SIZE + CEPH_PAGE_SIZE - 1333); i++)
-    a.append("x", 1);
-  a.flush();
-  const char *p = bl.c_str();
-  t.claim_append(bl);
-
-  for (uint32_t i = 0; i < (CEPH_PAGE_SIZE + 1333); i++)
-    a.append("x", 1);
-  a.flush();
-  t.claim_append(bl);
-
-  EXPECT_FALSE(t.is_aligned_size_and_memory(CEPH_PAGE_SIZE, CEPH_PAGE_SIZE));
-  dst.claim_append_piecewise(t);
-  EXPECT_TRUE(dst.is_aligned_size_and_memory(CEPH_PAGE_SIZE, CEPH_PAGE_SIZE));
-  const char *p1 = dst.c_str();
-  EXPECT_TRUE(p == p1);
-}
-
 TEST(BufferList, begin) {
   bufferlist bl;
   bl.append("ABC");