mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
fs: Introduce RWF_NOWAIT and FMODE_AIO_NOWAIT
RWF_NOWAIT informs kernel to bail out if an AIO request will block for reasons such as file allocations, or a writeback triggered, or would block while allocating requests while performing direct I/O. RWF_NOWAIT is translated to IOCB_NOWAIT for iocb->ki_flags. FMODE_AIO_NOWAIT is a flag which identifies the file opened is capable of returning -EAGAIN if the AIO call will block. This must be set by supporting filesystems in the ->open() call. Filesystems xfs, btrfs and ext4 would be supported in the following patches. Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Jan Kara <[email protected]> Signed-off-by: Goldwyn Rodrigues <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
9830f4be15
commit
b745fafaf7
3 changed files with 18 additions and 1 deletions
6
fs/aio.c
6
fs/aio.c
|
|
@ -1592,6 +1592,12 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
|
|||
goto out_put_req;
|
||||
}
|
||||
|
||||
if ((req->common.ki_flags & IOCB_NOWAIT) &&
|
||||
!(req->common.ki_flags & IOCB_DIRECT)) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto out_put_req;
|
||||
}
|
||||
|
||||
ret = put_user(KIOCB_KEY, &user_iocb->aio_key);
|
||||
if (unlikely(ret)) {
|
||||
pr_debug("EFAULT: aio_key\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue