diff mbox series

[43/50] xfs: remove xfs_filestream_select_ag() longest extent check

Message ID 20220611012659.3418072-44-david@fromorbit.com (mailing list archive)
State Superseded, archived
Headers show
Series xfs: per-ag centric allocation alogrithms | expand

Commit Message

Dave Chinner June 11, 2022, 1:26 a.m. UTC
From: Dave Chinner <dchinner@redhat.com>

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>
---
 fs/xfs/xfs_filestream.c | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c
index 4c0392dedeb9..d251f78ffc95 100644
--- a/fs/xfs/xfs_filestream.c
+++ b/fs/xfs/xfs_filestream.c
@@ -341,32 +341,16 @@  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:
-	if (mru)
-		xfs_fstrm_free_func(mp, mru);
-	xfs_irele(pip);
-out_select:
-	ap->blkno = XFS_AGB_TO_FSB(mp, agno, 0);
-	return 0;
 out_error:
 	if (mru)
 		xfs_fstrm_free_func(mp, mru);
 	xfs_irele(pip);
+out_select:
+	if (!error)
+		ap->blkno = XFS_AGB_TO_FSB(mp, agno, 0);
 	return error;
 
 }