Re: [PATCH 07/10] xfs: clean up long conditionals in xfs_iwalk_ichunk_ra

Brian Foster
2019-06-10T19:32:24Z

On Tue, Jun 04, 2019 at 02:50:12PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Refactor xfs_iwalk_ichunk_ra to avoid long conditionals.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

> fs/xfs/xfs_iwalk.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
>
> diff --git a/fs/xfs/xfs_iwalk.c b/fs/xfs/xfs_iwalk.c
> index 9ad017ddbae7..8595258b5001 100644
> --- a/fs/xfs/xfs_iwalk.c
> +++ b/fs/xfs/xfs_iwalk.c
> @@ -84,16 +84,16 @@ xfs_iwalk_ichunk_ra(
> agbno = XFS_AGINO_TO_AGBNO(mp, irec->ir_startino);
>
> blk_start_plug(&plug);
> - for (i = 0;
> - i < XFS_INODES_PER_CHUNK;
> - i += igeo->inodes_per_cluster,
> - agbno += igeo->blocks_per_cluster) {
> - if (xfs_inobt_maskn(i, igeo->inodes_per_cluster) &
> - ~irec->ir_free) {
> + for (i = 0; i < XFS_INODES_PER_CHUNK; i += igeo->inodes_per_cluster) {
> + xfs_inofree_t imask;
> +
> + imask = xfs_inobt_maskn(i, igeo->inodes_per_cluster);
> + if (imask & ~irec->ir_free) {
> xfs_btree_reada_bufs(mp, agno, agbno,
> igeo->blocks_per_cluster,
> &xfs_inode_buf_ops);
> }
> + agbno += igeo->blocks_per_cluster;
> }
> blk_finish_plug(&plug);
> }
>