Re: [PATCH v6 13/13] xfs: update atomic write max size

Christoph Hellwig
2025-03-17T07:25:46Z

On Thu, Mar 13, 2025 at 05:13:10PM +0000, John Garry wrote:
> For simplicity, limit at the max of what the mounted bdev can support in
> terms of atomic write limits. Maybe in future we will have a better way
> to advertise this optimised limit.

You'll still need to cover limit this by the amount that can
be commited in a single transactions. And handle the case where there
is no hardware support at all.

> xfs_get_atomic_write_max_attr(

I missed it in the previous version, but can be drop the
pointless _attr for these two helpers?

> +static inline void
> +xfs_compute_awu_max(

And use a more descriptive name than AWU, wich really just is a
nvme field name.

> + awu_max = 1;
> + while (1) {
> + if (agsize % (awu_max * 2))
> + break;

while ((agsize % (awu_max * 2) == 0)) {

?

> + xfs_extlen_t m_awu_max; /* data device max atomic write */

overly long line.