summaryrefslogtreecommitdiffstats
path: root/src/common/buffer.cc
diff options
context:
space:
mode:
authorRadoslaw Zarzynski <rzarzyns@redhat.com>2020-08-17 18:48:23 +0200
committerRadoslaw Zarzynski <rzarzyns@redhat.com>2020-08-21 17:50:44 +0200
commit445e01752600e1e20f7c9b28b04172a84b33a183 (patch)
tree31f43eb938ae807753204a789eae8a865d81d7ad /src/common/buffer.cc
parentcommon/bl: add assertion in obtain_contigous_space(). (diff)
downloadceph-445e01752600e1e20f7c9b28b04172a84b33a183.tar.xz
ceph-445e01752600e1e20f7c9b28b04172a84b33a183.zip
common/bl: multiple cleans-up for bufferlist::splice().
* clean formatting, * fix the comment in `bufferlist::splice()`, * use `->` instead of `*`. Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Diffstat (limited to 'src/common/buffer.cc')
-rw-r--r--src/common/buffer.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/common/buffer.cc b/src/common/buffer.cc
index d80b79841e5..58ef4461f7c 100644
--- a/src/common/buffer.cc
+++ b/src/common/buffer.cc
@@ -1562,7 +1562,7 @@ static ceph::spinlock debug_lock;
// partial?
if (off + len < curbuf->length()) {
//cout << "copying partial of " << *curbuf << std::endl;
- _buffers.push_back(*ptr_node::create( *curbuf, off, len ).release());
+ _buffers.push_back(*ptr_node::create(*curbuf, off, len).release());
_len += len;
_num += 1;
break;
@@ -1571,7 +1571,7 @@ static ceph::spinlock debug_lock;
// through end
//cout << "copying end (all?) of " << *curbuf << std::endl;
unsigned howmuch = curbuf->length() - off;
- _buffers.push_back(*ptr_node::create( *curbuf, off, howmuch ).release());
+ _buffers.push_back(*ptr_node::create(*curbuf, off, howmuch).release());
_len += howmuch;
_num += 1;
len -= howmuch;
@@ -1610,8 +1610,8 @@ static ceph::spinlock debug_lock;
}
if (off) {
- // add a reference to the front bit
- // insert it before curbuf (which we'll hose)
+ // add a reference to the front bit, insert it before curbuf (which
+ // we'll lose).
//cout << "keeping front " << off << " of " << *curbuf << std::endl;
_buffers.insert_after(curbuf_prev,
*ptr_node::create(*curbuf, 0, off).release());
@@ -1624,23 +1624,23 @@ static ceph::spinlock debug_lock;
while (len > 0) {
// partial?
- if (off + len < (*curbuf).length()) {
+ if (off + len < curbuf->length()) {
//cout << "keeping end of " << *curbuf << ", losing first " << off+len << std::endl;
if (claim_by)
- claim_by->append( *curbuf, off, len );
- (*curbuf).set_offset( off+len + (*curbuf).offset() ); // ignore beginning big
- (*curbuf).set_length( (*curbuf).length() - (len+off) );
+ claim_by->append(*curbuf, off, len);
+ curbuf->set_offset(off+len + curbuf->offset()); // ignore beginning big
+ curbuf->set_length(curbuf->length() - (len+off));
_len -= off+len;
//cout << " now " << *curbuf << std::endl;
break;
}
// hose though the end
- unsigned howmuch = (*curbuf).length() - off;
+ unsigned howmuch = curbuf->length() - off;
//cout << "discarding " << howmuch << " of " << *curbuf << std::endl;
if (claim_by)
- claim_by->append( *curbuf, off, howmuch );
- _len -= (*curbuf).length();
+ claim_by->append(*curbuf, off, howmuch);
+ _len -= curbuf->length();
_num -= 1;
curbuf = _buffers.erase_after_and_dispose(curbuf_prev);
len -= howmuch;