From: Wei Gong <[email protected]> Currently, indirect descriptor mode unnecessarily restricts the maximum IO size based on virtqueue vringsize. However, the indirect descriptor mechanism inherently supports larger IO operations by chaining descriptors.
This patch removes the artificial constraint, allowing indirect descriptor mode to utilize its full potential without being limited by vringsize. The maximum supported descriptors per IO is now determined by the indirect descriptor capability rather than the virtqueue size. Signed-off-by: Wei Gong <[email protected]> --- fs/fuse/virtio_fs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 76c8fd0bfc75..c0d5db7d7504 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -12,6 +12,7 @@ #include <linux/memremap.h> #include <linux/module.h> #include <linux/virtio.h> +#include <linux/virtio_ring.h> #include <linux/virtio_fs.h> #include <linux/delay.h> #include <linux/fs_context.h> @@ -1701,9 +1702,11 @@ static int virtio_fs_get_tree(struct fs_context *fsc) fc->sync_fs = true; fc->use_pages_for_kvec_io = true; - /* Tell FUSE to split requests that exceed the virtqueue's size */ - fc->max_pages_limit = min_t(unsigned int, fc->max_pages_limit, - virtqueue_size - FUSE_HEADER_OVERHEAD); + if (!virtio_has_feature(fs->vqs[VQ_REQUEST].vq->vdev, VIRTIO_RING_F_INDIRECT_DESC)) { + /* Tell FUSE to split requests that exceed the virtqueue's size */ + fc->max_pages_limit = min_t(unsigned int, fc->max_pages_limit, + virtqueue_size - FUSE_HEADER_OVERHEAD); + } fsc->s_fs_info = fm; sb = sget_fc(fsc, virtio_fs_test_super, set_anon_super_fc); -- 2.32.0
