diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-14 19:29:55 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-14 19:29:55 -0700 |
commit | e253d98f5babbec7e6ced810f7335b265a7f7e83 (patch) | |
tree | cd688c4ba8d43edb12bbeb523393879f7c212b65 /fs/ext4 | |
parent | 0f0d12728e56c94d3289c6831243b6faeae8a19d (diff) | |
parent | c35fc7a5abae9c154dd6f8c0b288462342facd45 (diff) |
Merge branch 'work.read_write' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull nowait read support from Al Viro:
"Support IOCB_NOWAIT for buffered reads and block devices"
* 'work.read_write' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
block_dev: support RFW_NOWAIT on block device nodes
fs: support RWF_NOWAIT for buffered reads
fs: support IOCB_NOWAIT in generic_file_buffered_read
fs: pass iocb to do_generic_file_read
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index da9c6948ad25..b1da660ac3bc 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -223,6 +223,8 @@ ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from) if (IS_DAX(inode)) return ext4_dax_write_iter(iocb, from); #endif + if (!o_direct && (iocb->ki_flags & IOCB_NOWAIT)) + return -EOPNOTSUPP; if (!inode_trylock(inode)) { if (iocb->ki_flags & IOCB_NOWAIT) @@ -431,9 +433,7 @@ static int ext4_file_open(struct inode * inode, struct file * filp) return ret; } - /* Set the flags to support nowait AIO */ - filp->f_mode |= FMODE_AIO_NOWAIT; - + filp->f_mode |= FMODE_NOWAIT; return dquot_file_open(inode, filp); } |