@Casey Bodley Thanks for your info.
I think I could use bufferlist::spice here to complete the read function here. I'll
update the code and fix some bugs in it.
B.R.
Changcheng
------------------------------------------------------------------
From:Casey Bodley <cbodley(a)redhat.com>
Sent At:2021 Jun. 28 (Mon.) 21:42
To:changcheng.liu <changcheng.liu(a)aliyun.com>
Cc:dev <dev(a)ceph.io>
Subject:Re: claim append part of bufferlist
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 to recevie the network data sent by
peer node, then append it into the cache data space(e.g. bufferlist object
recv_pending_bl).
Then I trigger the up software layer to read the received the data in
recv_pending_bl.
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