From: piaojun <piaojun@huawei.com>
To: virtio-fs@redhat.com
Subject: [Virtio-fs] [PATCH v2 2/2][RFC] use fuse_buf_writev to replace fuse_buf_write for better performance
Date: Wed, 7 Aug 2019 15:10:10 +0800 [thread overview]
Message-ID: <5D4A7952.4010707@huawei.com> (raw)
fuse_buf_writev() only handles the normal write in which src is buffer
and dest is fd. Specially if src buffer represents guest physical
address that can't be mapped by the daemon process, IO must be bounced
back to the VMM to do it by fuse_buf_copy().
Signed-off-by: Jun Piao <piaojun@huawei.com>
Suggested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
contrib/virtiofsd/passthrough_ll.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/contrib/virtiofsd/passthrough_ll.c b/contrib/virtiofsd/passthrough_ll.c
index cc9c175..c1bbc53 100644
--- a/contrib/virtiofsd/passthrough_ll.c
+++ b/contrib/virtiofsd/passthrough_ll.c
@@ -2023,7 +2023,10 @@ static void lo_write_buf(fuse_req_t req, fuse_ino_t ino,
fuse_debug("lo_write_buf(ino=%" PRIu64 ", size=%zd, off=%lu)\n",
ino, out_buf.buf[0].size, (unsigned long) off);
- res = fuse_buf_copy(req, &out_buf, in_buf, 0);
+ if (!(in_buf->buf[0].flags & FUSE_BUF_PHYS_ADDR))
+ res = fuse_buf_writev(req, &out_buf, in_buf, out_buf.buf[0].flags);
+ else
+ res = fuse_buf_copy(req, &out_buf, in_buf, 0);
if(res < 0) {
fuse_reply_err(req, -res);
} else {
--
next reply other threads:[~2019-08-07 7:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 7:10 piaojun [this message]
2019-08-07 9:21 ` [Virtio-fs] [PATCH v2 2/2][RFC] use fuse_buf_writev to replace fuse_buf_write for better performance Stefan Hajnoczi
2019-08-07 9:58 ` piaojun
2019-08-07 15:37 ` Dr. David Alan Gilbert
2019-08-08 1:26 ` piaojun
2019-08-08 8:23 ` Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5D4A7952.4010707@huawei.com \
--to=piaojun@huawei.com \
--cc=virtio-fs@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.