diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-15 04:29:55 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-15 04:29:55 +0200 |
commit | e253d98f5babbec7e6ced810f7335b265a7f7e83 (patch) | |
tree | cd688c4ba8d43edb12bbeb523393879f7c212b65 /fs/btrfs | |
parent | Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/vi... (diff) | |
parent | block_dev: support RFW_NOWAIT on block device nodes (diff) | |
download | linux-e253d98f5babbec7e6ced810f7335b265a7f7e83.tar.xz linux-e253d98f5babbec7e6ced810f7335b265a7f7e83.zip |
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/btrfs')
-rw-r--r-- | fs/btrfs/file.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 74fd7756cff3..aafcc785f840 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1886,6 +1886,10 @@ static ssize_t btrfs_file_write_iter(struct kiocb *iocb, loff_t oldsize; int clean_page = 0; + if (!(iocb->ki_flags & IOCB_DIRECT) && + (iocb->ki_flags & IOCB_NOWAIT)) + return -EOPNOTSUPP; + if (!inode_trylock(inode)) { if (iocb->ki_flags & IOCB_NOWAIT) return -EAGAIN; @@ -3112,7 +3116,7 @@ out: static int btrfs_file_open(struct inode *inode, struct file *filp) { - filp->f_mode |= FMODE_AIO_NOWAIT; + filp->f_mode |= FMODE_NOWAIT; return generic_file_open(inode, filp); } |