Re: [PATCH 10/13] xfs: look at m_frextents in xfs_iomap_prealloc_size for RT allocations

Dave Chinner
2024-03-28T04:32:54Z

On Wed, Mar 27, 2024 at 12:03:15PM +0100, Christoph Hellwig wrote:
> Add a check for files on the RT subvolume and use m_frextents instead
> of m_fdblocks to adjust the preallocation size.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>

One minor nit:

> + if (unlikely(XFS_IS_REALTIME_INODE(ip)))
> + freesp = xfs_rtx_to_rtb(mp, xfs_iomap_freesp(&mp->m_frextents,
> + mp->m_low_rtexts, &shift));

It took me extra brain cells to realise that this had nested
function calls because of the way the long line is split. Can we
change it to look like this:

freesp = xfs_rtx_to_rtb(mp,
xfs_iomap_freesp(&mp->m_frextents,
mp->m_low_rtexts, &shift));

Just to make it a little easier to spot the nested function and
which parameters belong to which function?

Regardless, the code looks correct, so:

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-Dave.
--
Dave Chinner
david@fromorbit.com