mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
buffer: add claim_prepend()
Steal another bufferlist's content and prepend it to our own. Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
827ad53aba
commit
36a2245d50
@ -826,6 +826,14 @@ void buffer::list::rebuild_page_aligned()
|
||||
bl.last_p = bl.begin();
|
||||
}
|
||||
|
||||
void buffer::list::claim_prepend(list& bl)
|
||||
{
|
||||
// steal the other guy's buffers
|
||||
_len += bl._len;
|
||||
_buffers.splice( _buffers.begin(), bl._buffers );
|
||||
bl._len = 0;
|
||||
bl.last_p = bl.begin();
|
||||
}
|
||||
|
||||
void buffer::list::copy(unsigned off, unsigned len, char *dest) const
|
||||
{
|
||||
|
@ -371,6 +371,7 @@ public:
|
||||
// sort-of-like-assignment-op
|
||||
void claim(list& bl);
|
||||
void claim_append(list& bl);
|
||||
void claim_prepend(list& bl);
|
||||
|
||||
iterator begin() {
|
||||
return iterator(this, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user