for read(), it looks like you want:
void bufferlist::splice(unsigned off, unsigned len, list *claim_by=0);
if you don't give it a 'claim_by', it will just remove the range specified
by off/len from the current bufferlist. so you could call
recv_pending_bl.splice(0, len) after using bufferlist::iterator to copy the
data into buf
On Sun, Jun 27, 2021 at 11:35 PM changcheng.liu <changcheng.liu(a)aliyun.com>
wrote:
[Correct subject]
Hi all,
Does anyone know how to claim-append part of bufferlist? After the head
part has been claim-appended, the left part can be still cliam-appended.
I know there's bufferlist::claim_append API. However it will claim append
the whole bufferlist.
The background is:
I use one function handle_io_am_write_request
<https://github.com/changchengx/ceph/blob/ucx_msgr/src/msg/async/ucx/UCXConSktImpl.cc#L141>
to
recevie the network data
<https://github.com/changchengx/ceph/blob/ucx_msgr/src/msg/async/ucx/UCXConSktImpl.cc#L151>
sent by peer node, then append it into the cache data space
<https://github.com/changchengx/ceph/blob/ucx_msgr/src/msg/async/ucx/UCXConSktImpl.cc#L171>(e.g.
bufferlist object recv_pending_bl
<https://github.com/changchengx/ceph/blob/ucx_msgr/src/msg/async/ucx/UCXConSktImpl.cc#L171>
).
Then I trigger the up software layer to read
<https://github.com/changchengx/ceph/blob/ucx_msgr/src/msg/async/ucx/UCXConSktImpl.cc#L57>
the received the data in recv_pending_bl
<https://github.com/changchengx/ceph/blob/ucx_msgr/src/msg/async/ucx/UCXConSktImpl.cc#L57>
.
The code is below (you can also click the above link to read the
code, no more than 40 lines).
There're several bugs in below code. *I'm looking for the high
efficiency method to receive the data and trigger the up software layer to
read the data in the right way.*
*Any suggesion is welcome to supply the high efficiency method to do it.*
B.R.
Changcheng
_______________________________________________
Dev mailing list -- dev(a)ceph.io
To unsubscribe send an email to dev-leave(a)ceph.io