Skip to content

Commit

Permalink
xfs: remove xfs_filestream_select_ag() longest extent check
Browse files Browse the repository at this point in the history
Picking a new AG checks the longest free extent in the AG is valid,
so there's no need to repeat the check in
xfs_filestream_select_ag(). Remove it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
  • Loading branch information
Dave Chinner committed Feb 12, 2023
1 parent ba34de8 commit 3e43877
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions fs/xfs/xfs_filestream.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ xfs_filestream_select_ag(
xfs_agnumber_t agno = NULLAGNUMBER;
struct xfs_mru_cache_elem *mru;
int flags = 0;
int error;
int error = 0;

args->total = ap->total;
*blen = 0;
Expand Down Expand Up @@ -351,27 +351,11 @@ xfs_filestream_select_ag(
goto out_error;
if (agno == NULLAGNUMBER) {
agno = 0;
goto out_irele;
}

pag = xfs_perag_grab(mp, agno);
if (!pag)
goto out_irele;

error = xfs_bmap_longest_free_extent(pag, args->tp, blen);
xfs_perag_rele(pag);
if (error) {
if (error != -EAGAIN)
goto out_error;
*blen = 0;
}

out_irele:
xfs_irele(pip);
out_select:
ap->blkno = XFS_AGB_TO_FSB(mp, agno, 0);
return 0;

out_error:
xfs_irele(pip);
return error;
Expand Down

0 comments on commit 3e43877

Please sign in to comment.