diff options
| author | Goldwyn Rodrigues <rgoldwyn@suse.com> | 2017-06-20 08:05:40 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2017-06-20 09:12:03 -0400 |
| commit | fdd2f5b7de2afaa931e5f7bad7bcda35d1f1b479 (patch) | |
| tree | 2774b3a9c34b3529c8efef0842b4fbd71583c2fc /include/linux/fs.h | |
| parent | 443bd90f2cca9dec3db9ef9460a9c2a6f095f789 (diff) | |
fs: Separate out kiocb flags setup based on RWF_* flags
Also added RWF_SUPPORTED to encompass all flags.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/fs.h')
| -rw-r--r-- | include/linux/fs.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 023f0324762b..96a1a1fa54a9 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -3057,6 +3057,20 @@ static inline int iocb_flags(struct file *file) | |||
| 3057 | return res; | 3057 | return res; |
| 3058 | } | 3058 | } |
| 3059 | 3059 | ||
| 3060 | static inline int kiocb_set_rw_flags(struct kiocb *ki, int flags) | ||
| 3061 | { | ||
| 3062 | if (unlikely(flags & ~RWF_SUPPORTED)) | ||
| 3063 | return -EOPNOTSUPP; | ||
| 3064 | |||
| 3065 | if (flags & RWF_HIPRI) | ||
| 3066 | ki->ki_flags |= IOCB_HIPRI; | ||
| 3067 | if (flags & RWF_DSYNC) | ||
| 3068 | ki->ki_flags |= IOCB_DSYNC; | ||
| 3069 | if (flags & RWF_SYNC) | ||
| 3070 | ki->ki_flags |= (IOCB_DSYNC | IOCB_SYNC); | ||
| 3071 | return 0; | ||
| 3072 | } | ||
| 3073 | |||
| 3060 | static inline ino_t parent_ino(struct dentry *dentry) | 3074 | static inline ino_t parent_ino(struct dentry *dentry) |
| 3061 | { | 3075 | { |
| 3062 | ino_t res; | 3076 | ino_t res; |
