mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
fs: support RWF_NOWAIT for buffered reads
This is based on the old idea and code from Milosz Tanski. With the aio nowait code it becomes mostly trivial now. Buffered writes continue to return -EOPNOTSUPP if RWF_NOWAIT is passed. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Jan Kara <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
3239d83484
commit
91f9943e1c
5 changed files with 20 additions and 15 deletions
|
|
@ -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)
|
||||
|
|
@ -448,9 +450,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue