mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
ext4: Support setting FMODE_CAN_ATOMIC_WRITE
FS needs to add the fmode capability in order to support atomic writes during file open (refer kiocb_set_rw_flags()). Set this capability on a regular file if ext4 can do atomic write. Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
43c696f9d0
commit
b7987a7d69
@ -898,6 +898,9 @@ static int ext4_file_open(struct inode *inode, struct file *filp)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ext4_inode_can_atomic_write(inode))
|
||||
filp->f_mode |= FMODE_CAN_ATOMIC_WRITE;
|
||||
|
||||
filp->f_mode |= FMODE_NOWAIT | FMODE_CAN_ODIRECT;
|
||||
return dquot_file_open(inode, filp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user