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>
This commit is contained in:
Dr. David Alan Gilbert 2018-08-15 20:26:05 +01:00
parent 81bfc42dcf
commit eb49d187ef
3 changed files with 171 additions and 0 deletions

View file

@ -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;
}