xfs: turn the allocbt cursor active field into a btree flag

Add a new XFS_BTREE_ALLOCBT_ACTIVE flag to replace the active field.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
Christoph Hellwig
2024-02-22 12:35:15 -08:00
committed by Darrick J. Wong
parent 73a8fd93c4
commit b20775ed64
3 changed files with 11 additions and 9 deletions

View File

@@ -165,7 +165,10 @@ xfs_alloc_lookup(
cur->bc_rec.a.ar_startblock = bno;
cur->bc_rec.a.ar_blockcount = len;
error = xfs_btree_lookup(cur, dir, stat);
cur->bc_ag.abt.active = (*stat == 1);
if (*stat == 1)
cur->bc_flags |= XFS_BTREE_ALLOCBT_ACTIVE;
else
cur->bc_flags &= ~XFS_BTREE_ALLOCBT_ACTIVE;
return error;
}
@@ -214,7 +217,7 @@ static inline bool
xfs_alloc_cur_active(
struct xfs_btree_cur *cur)
{
return cur && cur->bc_ag.abt.active;
return cur && (cur->bc_flags & XFS_BTREE_ALLOCBT_ACTIVE);
}
/*
@@ -992,7 +995,7 @@ xfs_alloc_cur_check(
deactivate = true;
out:
if (deactivate)
cur->bc_ag.abt.active = false;
cur->bc_flags &= ~XFS_BTREE_ALLOCBT_ACTIVE;
trace_xfs_alloc_cur_check(args->mp, cur->bc_btnum, bno, len, diff,
*new);
return 0;
@@ -1367,7 +1370,7 @@ xfs_alloc_walk_iter(
if (error)
return error;
if (i == 0)
cur->bc_ag.abt.active = false;
cur->bc_flags &= ~XFS_BTREE_ALLOCBT_ACTIVE;
if (count > 0)
count--;
@@ -1481,7 +1484,7 @@ xfs_alloc_ag_vextent_locality(
if (error)
return error;
if (i) {
acur->cnt->bc_ag.abt.active = true;
acur->cnt->bc_flags |= XFS_BTREE_ALLOCBT_ACTIVE;
fbcur = acur->cnt;
fbinc = false;
}