mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
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>
This commit is contained in:
parent
443bd90f2c
commit
fdd2f5b7de
3 changed files with 19 additions and 9 deletions
|
@ -3057,6 +3057,20 @@ static inline int iocb_flags(struct file *file)
|
|||
return res;
|
||||
}
|
||||
|
||||
static inline int kiocb_set_rw_flags(struct kiocb *ki, int flags)
|
||||
{
|
||||
if (unlikely(flags & ~RWF_SUPPORTED))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (flags & RWF_HIPRI)
|
||||
ki->ki_flags |= IOCB_HIPRI;
|
||||
if (flags & RWF_DSYNC)
|
||||
ki->ki_flags |= IOCB_DSYNC;
|
||||
if (flags & RWF_SYNC)
|
||||
ki->ki_flags |= (IOCB_DSYNC | IOCB_SYNC);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline ino_t parent_ino(struct dentry *dentry)
|
||||
{
|
||||
ino_t res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue