From 60b9df7a54804a965850db00beec4d3a2c002536 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 1 May 2013 14:37:21 +0200 Subject: fuse: add flag to turn on async direct IO Without async DIO write requests to a single file were always serialized. With async DIO that's no longer the case. So don't turn on async DIO by default for fear of breaking backward compatibility. Signed-off-by: Miklos Szeredi --- fs/fuse/file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fs/fuse/file.c') diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 1f8e3d60dc07..6ab7ca43f9e0 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2371,14 +2371,14 @@ fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t offset, unsigned long nr_segs) { ssize_t ret = 0; - struct file *file = NULL; + struct file *file = iocb->ki_filp; + struct fuse_file *ff = file->private_data; loff_t pos = 0; struct inode *inode; loff_t i_size; size_t count = iov_length(iov, nr_segs); struct fuse_io_priv *io; - file = iocb->ki_filp; pos = offset; inode = file->f_mapping->host; i_size = i_size_read(inode); @@ -2403,9 +2403,9 @@ fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, io->file = file; /* * By default, we want to optimize all I/Os with async request - * submission to the client filesystem. + * submission to the client filesystem if supported. */ - io->async = 1; + io->async = ff->fc->async_dio; io->iocb = iocb; /* -- cgit v1.2.3