-
- if (args->agbp) {
- /*
- * Allocation is supposed to succeed now, so break out
- * of the loop regardless of whether we succeed or not.
- */
- if (args->agno == start_agno && target_agbno) {
- args->agbno = target_agbno;
- error = xfs_alloc_ag_vextent_near(args);
- } else {
- args->agbno = 0;
- error = xfs_alloc_ag_vextent_size(args);
- }
- break;
- }
-
- trace_xfs_alloc_vextent_loopfailed(args);
-
- /*
- * If we are try-locking, we can't deadlock on AGF locks so we
- * can wrap all the way back to the first AG. Otherwise, wrap
- * back to the start AG so we can't deadlock and let the end of
- * scan handler decide what to do next.
- */
- if (++(args->agno) == mp->m_sb.sb_agcount) {
- if (flags & XFS_ALLOC_FLAG_TRYLOCK)
- args->agno = 0;
- else
- args->agno = minimum_agno;