]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: update atomic write limits
authorJohn Garry <john.g.garry@oracle.com>
Wed, 7 May 2025 21:18:33 +0000 (14:18 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 7 May 2025 21:25:32 +0000 (14:25 -0700)
commit9dffc58f23849783ab2f6c2c9f5af9b94a42666f
tree1573a03940d12895cf5fb4c28b073154fc5103cf
parent0c438dcc31504bf4f50b20dc52f8f5ca7fab53e2
xfs: update atomic write limits

Update the limits returned from xfs_get_atomic_write_{min, max, max_opt)().

No reflink support always means no CoW-based atomic writes.

For updating xfs_get_atomic_write_min(), we support blocksize only and that
depends on HW or reflink support.

For updating xfs_get_atomic_write_max(), for no reflink, we are limited to
blocksize but only if HW support. Otherwise we are limited to combined
limit in mp->m_atomic_write_unit_max.

For updating xfs_get_atomic_write_max_opt(), ultimately we are limited by
the bdev atomic write limit. If xfs_get_atomic_write_max() does not report
 > 1x blocksize, then just continue to report 0 as before.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
[djwong: update comments in the helper functions]
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: John Garry <john.g.garry@oracle.com>
fs/xfs/xfs_file.c
fs/xfs/xfs_iops.c