MCPcopy Create free account
hub / github.com/ceph/ceph / append_zero

Method append_zero

src/common/buffer.cc:1503–1525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1501 }
1502
1503 void buffer::list::append_zero(unsigned len)
1504 {
1505 _len += len;
1506
1507 const unsigned free_in_last = get_append_buffer_unused_tail_length();
1508 const unsigned first_round = std::min(len, free_in_last);
1509 if (first_round) {
1510 if (unlikely(_carriage != &_buffers.back())) {
1511 auto bptr = ptr_node::create(*_carriage, _carriage->length(), 0);
1512 _carriage = bptr.get();
1513 _buffers.push_back(*bptr.release());
1514 _num += 1;
1515 }
1516 _carriage->append_zeros(first_round);
1517 }
1518
1519 const unsigned second_round = len - first_round;
1520 if (second_round) {
1521 auto& new_back = refill_append_space(second_round);
1522 new_back.set_length(second_round);
1523 new_back.zero(false);
1524 }
1525 }
1526
1527
1528 /*

Callers 15

export_fileMethod · 0.45
aio_callbackMethod · 0.45
do_encodeFunction · 0.45
handle_aioMethod · 0.45
aio_callbackMethod · 0.45
readMethod · 0.45
write_log_entriesMethod · 0.45
update_pool_rootMethod · 0.45
update_pool_root_syncMethod · 0.45
remove_alignment_dataMethod · 0.45
discardMethod · 0.45

Calls 10

append_zerosMethod · 0.80
set_lengthMethod · 0.80
createFunction · 0.70
backMethod · 0.45
lengthMethod · 0.45
getMethod · 0.45
push_backMethod · 0.45
releaseMethod · 0.45
zeroMethod · 0.45

Tested by 15

TESTFunction · 0.36
truncateMethod · 0.36
zeroMethod · 0.36
TEST_FFunction · 0.36
TYPED_TESTFunction · 0.36
expect_image_readMethod · 0.36
expect_image_readMethod · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
expect_read_clusterMethod · 0.36