cout << b << std::endl;
PExtentVector r;
- b.put_ref(&coll, 0, 0x1200, &r);
+ ASSERT_FALSE(b.put_ref(&coll, 0, 0x1200, &r));
ASSERT_EQ(0x4200u, b.get_referenced_bytes());
cout << " r " << r << std::endl;
cout << b << std::endl;
r.clear();
- b.put_ref(&coll, 0xae00, 0x4200, &r);
+ ASSERT_TRUE(b.put_ref(&coll, 0xae00, 0x4200, &r));
ASSERT_EQ(0u, b.get_referenced_bytes());
cout << " r " << r << std::endl;
cout << b << std::endl;
B.get_ref(coll.get(), 0, mas*2);
ASSERT_EQ(mas * 2, B.get_referenced_bytes());
ASSERT_TRUE(b.is_allocated(0, mas*2));
- B.put_ref(coll.get(), 0, mas*2, &r);
+ ASSERT_TRUE(B.put_ref(coll.get(), 0, mas*2, &r));
ASSERT_EQ(0u, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(1u, r.size());
b.allocated_test(bluestore_pextent_t(123, mas * 2));
B.get_ref(coll.get(), 0, mas*2);
ASSERT_EQ(mas * 2, B.get_referenced_bytes());
- B.put_ref(coll.get(), 0, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), 0, mas, &r));
ASSERT_EQ(mas, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*2));
- B.put_ref(coll.get(), mas, mas, &r);
+ ASSERT_TRUE(B.put_ref(coll.get(), mas, mas, &r));
ASSERT_EQ(0u, B.get_referenced_bytes());
ASSERT_EQ(0u, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
b.allocated_test(bluestore_pextent_t(4, mas));
B.get_ref(coll.get(), 0, mas*4);
ASSERT_EQ(mas * 4, B.get_referenced_bytes());
- B.put_ref(coll.get(), mas, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas, mas, &r));
ASSERT_EQ(mas * 3, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*4));
ASSERT_TRUE(b.is_allocated(mas, mas));
- B.put_ref(coll.get(), mas*2, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*2, mas, &r));
ASSERT_EQ(mas * 2, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(mas*2, mas));
ASSERT_TRUE(b.is_allocated(0, mas*4));
- B.put_ref(coll.get(), mas*3, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*3, mas, &r));
ASSERT_EQ(mas, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(2u, r.size());
b.allocated_test(bluestore_pextent_t(6, mas));
B.get_ref(coll.get(), 0, mas*6);
ASSERT_EQ(mas * 6, B.get_referenced_bytes());
- B.put_ref(coll.get(), mas, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas, mas, &r));
ASSERT_EQ(mas * 5, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*6));
- B.put_ref(coll.get(), mas*2, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*2, mas, &r));
ASSERT_EQ(mas * 4, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*6));
- B.put_ref(coll.get(), mas*3, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*3, mas, &r));
ASSERT_EQ(mas * 3, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(2u, r.size());
b.allocated_test(bluestore_pextent_t(1, mas * 6));
B.get_ref(coll.get(), 0, mas*6);
ASSERT_EQ(mas * 6, B.get_referenced_bytes());
- B.put_ref(coll.get(), mas, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas, mas, &r));
ASSERT_EQ(mas * 5, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*6));
- B.put_ref(coll.get(), mas*2, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*2, mas, &r));
ASSERT_EQ(mas * 4, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*6));
- B.put_ref(coll.get(), mas*3, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*3, mas, &r));
ASSERT_EQ(mas * 3, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(1u, r.size());
b.allocated_test(bluestore_pextent_t(3, mas * 4));
B.get_ref(coll.get(), 0, mas*12);
ASSERT_EQ(mas * 12, B.get_referenced_bytes());
- B.put_ref(coll.get(), mas, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas, mas, &r));
ASSERT_EQ(mas * 11, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*12));
- B.put_ref(coll.get(), mas*9, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*9, mas, &r));
ASSERT_EQ(mas * 10, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*12));
- B.put_ref(coll.get(), mas*2, mas*7, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*2, mas*7, &r));
ASSERT_EQ(mas * 3, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(3u, r.size());
b.allocated_test(bluestore_pextent_t(3, mas * 4));
B.get_ref(coll.get(), 0, mas*12);
ASSERT_EQ(mas * 12, B.get_referenced_bytes());
- B.put_ref(coll.get(), mas, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas, mas, &r));
ASSERT_EQ(mas * 11, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*12));
- B.put_ref(coll.get(), mas*9, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*9, mas, &r));
ASSERT_EQ(mas * 10, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*12));
- B.put_ref(coll.get(), mas*2, mas*7, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*2, mas*7, &r));
ASSERT_EQ(mas * 3, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(3u, r.size());
ASSERT_TRUE(b.get_extents()[0].is_valid());
ASSERT_FALSE(b.get_extents()[1].is_valid());
ASSERT_TRUE(b.get_extents()[2].is_valid());
- B.put_ref(coll.get(), 0, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), 0, mas, &r));
ASSERT_EQ(mas * 2, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(1u, r.size());
ASSERT_EQ(2u, b.get_extents().size());
ASSERT_FALSE(b.get_extents()[0].is_valid());
ASSERT_TRUE(b.get_extents()[1].is_valid());
- B.put_ref(coll.get(), mas*10, mas*2, &r);
+ ASSERT_TRUE(B.put_ref(coll.get(), mas*10, mas*2, &r));
ASSERT_EQ(mas * 0, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(1u, r.size());
b.allocated_test(bluestore_pextent_t(3, mas * 4));
B.get_ref(coll.get(), 0, mas*12);
ASSERT_EQ(mas * 12, B.get_referenced_bytes());
- B.put_ref(coll.get(), mas, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas, mas, &r));
ASSERT_EQ(mas * 11, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*12));
- B.put_ref(coll.get(), mas*9, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*9, mas, &r));
ASSERT_EQ(mas * 10, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*12));
- B.put_ref(coll.get(), mas*2, mas*7, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*2, mas*7, &r));
ASSERT_EQ(mas * 3, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(3u, r.size());
ASSERT_TRUE(b.get_extents()[0].is_valid());
ASSERT_FALSE(b.get_extents()[1].is_valid());
ASSERT_TRUE(b.get_extents()[2].is_valid());
- B.put_ref(coll.get(), mas*10, mas*2, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*10, mas*2, &r));
ASSERT_EQ(mas * 1, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(1u, r.size());
ASSERT_EQ(2u, b.get_extents().size());
ASSERT_TRUE(b.get_extents()[0].is_valid());
ASSERT_FALSE(b.get_extents()[1].is_valid());
- B.put_ref(coll.get(), 0, mas, &r);
+ ASSERT_TRUE(B.put_ref(coll.get(), 0, mas, &r));
ASSERT_EQ(mas * 0, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(1u, r.size());
b.allocated_test(bluestore_pextent_t(1, mas * 8));
B.get_ref(coll.get(), 0, mas*8);
ASSERT_EQ(mas * 8, B.get_referenced_bytes());
- B.put_ref(coll.get(), 0, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), 0, mas, &r));
ASSERT_EQ(mas * 7, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*8));
- B.put_ref(coll.get(), mas*7, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*7, mas, &r));
ASSERT_EQ(mas * 6, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, mas*8));
- B.put_ref(coll.get(), mas*2, mas, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*2, mas, &r));
ASSERT_EQ(mas * 5, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
ASSERT_TRUE(b.is_allocated(0, 8));
- B.put_ref(coll.get(), mas*3, mas*4, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), mas*3, mas*4, &r));
ASSERT_EQ(mas * 1, B.get_referenced_bytes());
ASSERT_EQ(1u, r.size());
ASSERT_EQ(0x2001u, r[0].offset);
ASSERT_EQ(2u, b.get_extents().size());
ASSERT_TRUE(b.get_extents()[0].is_valid());
ASSERT_FALSE(b.get_extents()[1].is_valid());
- B.put_ref(coll.get(), mas, mas, &r);
+ ASSERT_TRUE(B.put_ref(coll.get(), mas, mas, &r));
ASSERT_EQ(mas * 0, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(1u, r.size());
B.get_ref(coll.get(), 0, mas*4);
ASSERT_EQ(mas * 4, B.get_referenced_bytes());
ASSERT_TRUE(b.is_allocated(0, mas*4));
- B.put_ref(coll.get(), 0, mas*3, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), 0, mas*3, &r));
ASSERT_EQ(mas * 1, B.get_referenced_bytes());
cout << "r " << r << " " << b << std::endl;
ASSERT_EQ(0u, r.size());
cout << "before: " << B << std::endl;
PExtentVector r;
- B.put_ref(coll.get(), 0x1800, 0x2000, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), 0x1800, 0x2000, &r));
ASSERT_EQ(0x3800u + 0x6400u - 0x2000u, B.get_referenced_bytes());
cout << "after: " << B << std::endl;
cout << "r " << r << std::endl;
ASSERT_EQ(0xa000u, B.get_referenced_bytes());
cout << "before: " << B << std::endl;
PExtentVector r;
- B.put_ref(coll.get(), 0x8000, 0x2000, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), 0x8000, 0x2000, &r));
cout << "after: " << B << std::endl;
cout << "r " << r << std::endl;
ASSERT_EQ(0x8000u, B.get_referenced_bytes());
ASSERT_EQ(0xe000u, B.get_referenced_bytes());
cout << "before: " << B << std::endl;
PExtentVector r;
- B.put_ref(coll.get(), 0, 0xb000, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), 0, 0xb000, &r));
ASSERT_EQ(0x3000u, B.get_referenced_bytes());
cout << "after: " << B << std::endl;
cout << "r " << r << std::endl;
ASSERT_EQ(0xc000u, B.get_referenced_bytes());
cout << "before: " << B << std::endl;
PExtentVector r;
- B.put_ref(coll.get(), 0x2000, 0xa000, &r);
+ ASSERT_FALSE(B.put_ref(coll.get(), 0x2000, 0xa000, &r));
cout << "after: " << B << std::endl;
cout << "r " << r << std::endl;
ASSERT_EQ(0x2000u, B.get_referenced_bytes());