summaryrefslogtreecommitdiff
path: root/fs/xfs
diff options
context:
space:
mode:
authorJohn Garry <john.g.garry@oracle.com>2024-11-05 03:14:04 +0300
committerDarrick J. Wong <djwong@djwong.org>2024-11-05 03:22:11 +0300
commit3af5298ce94bb672845adadf347874ba5bcfad2c (patch)
tree3c2af8b1584274670be2a784aae4bb8c83a616d6 /fs/xfs
parentf096207d327692a066954435dafb4bedbc031d9e (diff)
downloadlinux-3af5298ce94bb672845adadf347874ba5bcfad2c.tar.xz
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 <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: John Garry <john.g.garry@oracle.com> Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: John Garry <john.g.garry@oracle.com> Tested-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> #On ppc64
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_file.c2
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);
}