Skip to content

Commit 3af5298

Browse files
johnpgarryDarrick J. Wong
authored andcommitted
xfs: Support setting FMODE_CAN_ATOMIC_WRITE
Set FMODE_CAN_ATOMIC_WRITE flag if we can atomic write for that inode. Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: "Darrick J. Wong" <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Jan Kara <[email protected]> Reviewed-by: John Garry <[email protected]> Tested-by: Ojaswin Mujoo <[email protected]> #On ppc64
1 parent f096207 commit 3af5298

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/xfs/xfs_file.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,8 @@ xfs_file_open(
12231223
if (xfs_is_shutdown(XFS_M(inode->i_sb)))
12241224
return -EIO;
12251225
file->f_mode |= FMODE_NOWAIT | FMODE_CAN_ODIRECT;
1226+
if (xfs_inode_can_atomicwrite(XFS_I(inode)))
1227+
file->f_mode |= FMODE_CAN_ATOMIC_WRITE;
12261228
return generic_file_open(inode, file);
12271229
}
12281230

0 commit comments

Comments
 (0)