From: Xiubo Li Date: Tue, 28 Apr 2020 04:55:29 +0000 (-0400) Subject: ceph-fuse: switch to fuse_reply_iov to reduce the memory copy X-Git-Tag: v16.1.0~1746^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=969c575622c364395ecbc97d7b072bcbe6d50ded;p=ceph.git ceph-fuse: switch to fuse_reply_iov to reduce the memory copy Fixes: https://tracker.ceph.com/issues/45267 Signed-off-by: Xiubo Li --- diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index 3b2118bdcdd..16f4d12abd0 100644 --- a/src/client/fuse_ll.cc +++ b/src/client/fuse_ll.cc @@ -612,9 +612,12 @@ static void fuse_ll_read(fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, Fh *fh = reinterpret_cast(fi->fh); bufferlist bl; int r = cfuse->client->ll_read(fh, off, size, &bl); - if (r >= 0) - fuse_reply_buf(req, bl.c_str(), bl.length()); - else + if (r >= 0) { + vector iov; + bl.prepare_iov(&iov); + iov.insert(iov.begin(), {0}); // the first one is reserved for fuse_out_header + fuse_reply_iov(req, &iov[0], iov.size()); + } else fuse_reply_err(req, -r); }