diff options
| author | Hyunchul Lee <cheol.lee@lge.com> | 2018-03-08 19:34:38 +0900 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-04-08 03:51:14 -0700 |
| commit | 30654507e0a28a634e709f7fa05dd3850067bd32 (patch) | |
| tree | b4fb9d2972c8acc9a577faf4c077388b0ee7987c /include/linux | |
| parent | d909e9410634d321ae6931e87bb0ad5eaac3fa62 (diff) | |
f2fs: add nowait aio support
This patch adds nowait aio support[1].
Return EAGAIN if any of the following checks fail for direct I/O:
- i_rwsem is not lockable
- Blocks are not allocated at the write location
And xfstests generic/471 is passed.
[1]: 6be96d "Introduce RWF_NOWAIT and FMODE_AIO_NOWAIT"
Signed-off-by: Hyunchul Lee <cheol.lee@lge.com>
Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 8231cdc25901..e9382296305d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -144,6 +144,9 @@ typedef void (dax_iodone_t)(struct buffer_head *bh_map, int uptodate); /* File was opened by fanotify and shouldn't generate fanotify events */ #define FMODE_NONOTIFY ((__force fmode_t)0x4000000) +/* File is capable of returning -EAGAIN if I/O will block */ +#define FMODE_NOWAIT ((__force fmode_t)0x8000000) + /* * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector * that indicates that they should check the contents of the iovec are @@ -334,6 +337,7 @@ enum rw_hint { #define IOCB_EVENTFD (1 << 0) #define IOCB_APPEND (1 << 1) #define IOCB_DIRECT (1 << 2) +#define IOCB_NOWAIT (1 << 7) struct kiocb { struct file *ki_filp; |
