diff options
author | John Garry <[email protected]> | 2024-11-04 16:14:04 -0800 |
---|---|---|
committer | Darrick J. Wong <[email protected]> | 2024-11-04 16:22:11 -0800 |
commit | 3af5298ce94bb672845adadf347874ba5bcfad2c (patch) | |
tree | 3c2af8b1584274670be2a784aae4bb8c83a616d6 | |
parent | f096207d327692a066954435dafb4bedbc031d9e (diff) |
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
-rw-r--r-- | fs/xfs/xfs_file.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 44be10490342..c94019b12537 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -1223,6 +1223,8 @@ xfs_file_open( if (xfs_is_shutdown(XFS_M(inode->i_sb))) return -EIO; file->f_mode |= FMODE_NOWAIT | FMODE_CAN_ODIRECT; + if (xfs_inode_can_atomicwrite(XFS_I(inode))) + file->f_mode |= FMODE_CAN_ATOMIC_WRITE; return generic_file_open(inode, file); } |