aboutsummaryrefslogtreecommitdiff
path: root/tools/virtiofsd/fuse_lowlevel.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2018-08-15 20:26:05 +0100
committerDr. David Alan Gilbert <dgilbert@redhat.com>2020-01-23 16:41:36 +0000
commiteb49d187ef5134483a34c970bbfece28aaa686a7 (patch)
tree66f04f415d55ac4f02776dcaaa39f162c9649a5e /tools/virtiofsd/fuse_lowlevel.c
parent81bfc42dcf473bc8d3790622633410da72d8e622 (diff)
virtiofsd: Fast path for virtio read
Readv the data straight into the guests buffer. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> With fix by: Signed-off-by: Eryu Guan <eguan@linux.alibaba.com> Reviewed-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tools/virtiofsd/fuse_lowlevel.c')
-rw-r--r--tools/virtiofsd/fuse_lowlevel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
index 380d93bd01..4f4684d942 100644
--- a/tools/virtiofsd/fuse_lowlevel.c
+++ b/tools/virtiofsd/fuse_lowlevel.c
@@ -475,6 +475,11 @@ static int fuse_send_data_iov_fallback(struct fuse_session *se,
return fuse_send_msg(se, ch, iov, iov_count);
}
+ if (fuse_lowlevel_is_virtio(se) && buf->count == 1 &&
+ buf->buf[0].flags == (FUSE_BUF_IS_FD | FUSE_BUF_FD_SEEK)) {
+ return virtio_send_data_iov(se, ch, iov, iov_count, buf, len);
+ }
+
abort(); /* Will have taken vhost path */
return 0;
}