Re: [PATCH v5 02/10] xfs: Switch atomic write size check in xfs_file_write_iter()

From: Christoph Hellwig
Date: Wed Mar 12 2025 - 03:17:32 EST


> +void
> +xfs_get_atomic_write_attr(
> + struct xfs_inode *ip,
> + unsigned int *unit_min,
> + unsigned int *unit_max)
> +{
> + if (!xfs_inode_can_atomicwrite(ip)) {
> + *unit_min = *unit_max = 0;
> + return;
> + }
> +
> + *unit_min = *unit_max = ip->i_mount->m_sb.sb_blocksize;

This is a rather ugly interface. Why not have separate helpers for
the min and max values that can just return the actual values?