mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 08:30:54 +07:00
[XFS] Make xfs_alloc_compute_aligned() void.
xfs_alloc_compute_aligned() returns a value based on a comparison of the computed extent length and the minimum length allowed. This is only used by some callers - the other four return parameters are used more often. Hence move the comparison to the code that actually needs to do it and make xfs_alloc_compute_aligned() a void function. SGI-PV: 980084 SGI-Modid: xfs-linux-melb:xfs-kern:30797a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Niv Sardi <xaiki@sgi.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
This commit is contained in:
parent
f4586e4061
commit
12375c8237
@ -93,7 +93,7 @@ STATIC int xfs_alloc_ag_vextent_small(xfs_alloc_arg_t *,
|
||||
* Compute aligned version of the found extent.
|
||||
* Takes alignment and min length into account.
|
||||
*/
|
||||
STATIC int /* success (>= minlen) */
|
||||
STATIC void
|
||||
xfs_alloc_compute_aligned(
|
||||
xfs_agblock_t foundbno, /* starting block in found extent */
|
||||
xfs_extlen_t foundlen, /* length in found extent */
|
||||
@ -116,7 +116,6 @@ xfs_alloc_compute_aligned(
|
||||
}
|
||||
*resbno = bno;
|
||||
*reslen = len;
|
||||
return len >= minlen;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -837,9 +836,9 @@ xfs_alloc_ag_vextent_near(
|
||||
if ((error = xfs_alloc_get_rec(cnt_cur, <bno, <len, &i)))
|
||||
goto error0;
|
||||
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
|
||||
if (!xfs_alloc_compute_aligned(ltbno, ltlen,
|
||||
args->alignment, args->minlen,
|
||||
<bnoa, <lena))
|
||||
xfs_alloc_compute_aligned(ltbno, ltlen, args->alignment,
|
||||
args->minlen, <bnoa, <lena);
|
||||
if (ltlena >= args->minlen)
|
||||
continue;
|
||||
args->len = XFS_EXTLEN_MIN(ltlena, args->maxlen);
|
||||
xfs_alloc_fix_len(args);
|
||||
@ -958,9 +957,9 @@ xfs_alloc_ag_vextent_near(
|
||||
if ((error = xfs_alloc_get_rec(bno_cur_lt, <bno, <len, &i)))
|
||||
goto error0;
|
||||
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
|
||||
if (xfs_alloc_compute_aligned(ltbno, ltlen,
|
||||
args->alignment, args->minlen,
|
||||
<bnoa, <lena))
|
||||
xfs_alloc_compute_aligned(ltbno, ltlen, args->alignment,
|
||||
args->minlen, <bnoa, <lena);
|
||||
if (ltlena >= args->minlen)
|
||||
break;
|
||||
if ((error = xfs_alloc_decrement(bno_cur_lt, 0, &i)))
|
||||
goto error0;
|
||||
@ -974,9 +973,9 @@ xfs_alloc_ag_vextent_near(
|
||||
if ((error = xfs_alloc_get_rec(bno_cur_gt, >bno, >len, &i)))
|
||||
goto error0;
|
||||
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
|
||||
if (xfs_alloc_compute_aligned(gtbno, gtlen,
|
||||
args->alignment, args->minlen,
|
||||
>bnoa, >lena))
|
||||
xfs_alloc_compute_aligned(gtbno, gtlen, args->alignment,
|
||||
args->minlen, >bnoa, >lena);
|
||||
if (gtlena >= args->minlen)
|
||||
break;
|
||||
if ((error = xfs_alloc_increment(bno_cur_gt, 0, &i)))
|
||||
goto error0;
|
||||
|
Loading…
Reference in New Issue
Block a user