xfs: remove agno from btree cursor
Now that everything passes a perag, the agno is not needed anymore. Convert all the users to use pag->pag_agno instead and remove the agno from the cursor. This was largely done as an automated search and replace. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
committed by
Dave Chinner
parent
7b13c51551
commit
50f02fe333
@@ -47,7 +47,7 @@ xfs_refcount_lookup_le(
|
||||
xfs_agblock_t bno,
|
||||
int *stat)
|
||||
{
|
||||
trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.agno, bno,
|
||||
trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.pag->pag_agno, bno,
|
||||
XFS_LOOKUP_LE);
|
||||
cur->bc_rec.rc.rc_startblock = bno;
|
||||
cur->bc_rec.rc.rc_blockcount = 0;
|
||||
@@ -64,7 +64,7 @@ xfs_refcount_lookup_ge(
|
||||
xfs_agblock_t bno,
|
||||
int *stat)
|
||||
{
|
||||
trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.agno, bno,
|
||||
trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.pag->pag_agno, bno,
|
||||
XFS_LOOKUP_GE);
|
||||
cur->bc_rec.rc.rc_startblock = bno;
|
||||
cur->bc_rec.rc.rc_blockcount = 0;
|
||||
@@ -81,7 +81,7 @@ xfs_refcount_lookup_eq(
|
||||
xfs_agblock_t bno,
|
||||
int *stat)
|
||||
{
|
||||
trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.agno, bno,
|
||||
trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.pag->pag_agno, bno,
|
||||
XFS_LOOKUP_LE);
|
||||
cur->bc_rec.rc.rc_startblock = bno;
|
||||
cur->bc_rec.rc.rc_blockcount = 0;
|
||||
@@ -109,7 +109,7 @@ xfs_refcount_get_rec(
|
||||
int *stat)
|
||||
{
|
||||
struct xfs_mount *mp = cur->bc_mp;
|
||||
xfs_agnumber_t agno = cur->bc_ag.agno;
|
||||
xfs_agnumber_t agno = cur->bc_ag.pag->pag_agno;
|
||||
union xfs_btree_rec *rec;
|
||||
int error;
|
||||
xfs_agblock_t realstart;
|
||||
@@ -120,7 +120,7 @@ xfs_refcount_get_rec(
|
||||
|
||||
xfs_refcount_btrec_to_irec(rec, irec);
|
||||
|
||||
agno = cur->bc_ag.agno;
|
||||
agno = cur->bc_ag.pag->pag_agno;
|
||||
if (irec->rc_blockcount == 0 || irec->rc_blockcount > MAXREFCEXTLEN)
|
||||
goto out_bad_rec;
|
||||
|
||||
@@ -145,7 +145,7 @@ xfs_refcount_get_rec(
|
||||
if (irec->rc_refcount == 0 || irec->rc_refcount > MAXREFCOUNT)
|
||||
goto out_bad_rec;
|
||||
|
||||
trace_xfs_refcount_get(cur->bc_mp, cur->bc_ag.agno, irec);
|
||||
trace_xfs_refcount_get(cur->bc_mp, cur->bc_ag.pag->pag_agno, irec);
|
||||
return 0;
|
||||
|
||||
out_bad_rec:
|
||||
@@ -170,14 +170,14 @@ xfs_refcount_update(
|
||||
union xfs_btree_rec rec;
|
||||
int error;
|
||||
|
||||
trace_xfs_refcount_update(cur->bc_mp, cur->bc_ag.agno, irec);
|
||||
trace_xfs_refcount_update(cur->bc_mp, cur->bc_ag.pag->pag_agno, irec);
|
||||
rec.refc.rc_startblock = cpu_to_be32(irec->rc_startblock);
|
||||
rec.refc.rc_blockcount = cpu_to_be32(irec->rc_blockcount);
|
||||
rec.refc.rc_refcount = cpu_to_be32(irec->rc_refcount);
|
||||
error = xfs_btree_update(cur, &rec);
|
||||
if (error)
|
||||
trace_xfs_refcount_update_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ xfs_refcount_insert(
|
||||
{
|
||||
int error;
|
||||
|
||||
trace_xfs_refcount_insert(cur->bc_mp, cur->bc_ag.agno, irec);
|
||||
trace_xfs_refcount_insert(cur->bc_mp, cur->bc_ag.pag->pag_agno, irec);
|
||||
cur->bc_rec.rc.rc_startblock = irec->rc_startblock;
|
||||
cur->bc_rec.rc.rc_blockcount = irec->rc_blockcount;
|
||||
cur->bc_rec.rc.rc_refcount = irec->rc_refcount;
|
||||
@@ -209,7 +209,7 @@ xfs_refcount_insert(
|
||||
out_error:
|
||||
if (error)
|
||||
trace_xfs_refcount_insert_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ xfs_refcount_delete(
|
||||
error = -EFSCORRUPTED;
|
||||
goto out_error;
|
||||
}
|
||||
trace_xfs_refcount_delete(cur->bc_mp, cur->bc_ag.agno, &irec);
|
||||
trace_xfs_refcount_delete(cur->bc_mp, cur->bc_ag.pag->pag_agno, &irec);
|
||||
error = xfs_btree_delete(cur, i);
|
||||
if (XFS_IS_CORRUPT(cur->bc_mp, *i != 1)) {
|
||||
error = -EFSCORRUPTED;
|
||||
@@ -247,7 +247,7 @@ xfs_refcount_delete(
|
||||
out_error:
|
||||
if (error)
|
||||
trace_xfs_refcount_delete_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ xfs_refcount_split_extent(
|
||||
return 0;
|
||||
|
||||
*shape_changed = true;
|
||||
trace_xfs_refcount_split_extent(cur->bc_mp, cur->bc_ag.agno,
|
||||
trace_xfs_refcount_split_extent(cur->bc_mp, cur->bc_ag.pag->pag_agno,
|
||||
&rcext, agbno);
|
||||
|
||||
/* Establish the right extent. */
|
||||
@@ -392,7 +392,7 @@ xfs_refcount_split_extent(
|
||||
|
||||
out_error:
|
||||
trace_xfs_refcount_split_extent_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ xfs_refcount_merge_center_extents(
|
||||
int found_rec;
|
||||
|
||||
trace_xfs_refcount_merge_center_extents(cur->bc_mp,
|
||||
cur->bc_ag.agno, left, center, right);
|
||||
cur->bc_ag.pag->pag_agno, left, center, right);
|
||||
|
||||
/*
|
||||
* Make sure the center and right extents are not in the btree.
|
||||
@@ -469,7 +469,7 @@ xfs_refcount_merge_center_extents(
|
||||
|
||||
out_error:
|
||||
trace_xfs_refcount_merge_center_extents_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -488,7 +488,7 @@ xfs_refcount_merge_left_extent(
|
||||
int found_rec;
|
||||
|
||||
trace_xfs_refcount_merge_left_extent(cur->bc_mp,
|
||||
cur->bc_ag.agno, left, cleft);
|
||||
cur->bc_ag.pag->pag_agno, left, cleft);
|
||||
|
||||
/* If the extent at agbno (cleft) wasn't synthesized, remove it. */
|
||||
if (cleft->rc_refcount > 1) {
|
||||
@@ -531,7 +531,7 @@ xfs_refcount_merge_left_extent(
|
||||
|
||||
out_error:
|
||||
trace_xfs_refcount_merge_left_extent_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -549,7 +549,7 @@ xfs_refcount_merge_right_extent(
|
||||
int found_rec;
|
||||
|
||||
trace_xfs_refcount_merge_right_extent(cur->bc_mp,
|
||||
cur->bc_ag.agno, cright, right);
|
||||
cur->bc_ag.pag->pag_agno, cright, right);
|
||||
|
||||
/*
|
||||
* If the extent ending at agbno+aglen (cright) wasn't synthesized,
|
||||
@@ -595,7 +595,7 @@ xfs_refcount_merge_right_extent(
|
||||
|
||||
out_error:
|
||||
trace_xfs_refcount_merge_right_extent_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -680,13 +680,13 @@ xfs_refcount_find_left_extents(
|
||||
cleft->rc_blockcount = aglen;
|
||||
cleft->rc_refcount = 1;
|
||||
}
|
||||
trace_xfs_refcount_find_left_extent(cur->bc_mp, cur->bc_ag.agno,
|
||||
trace_xfs_refcount_find_left_extent(cur->bc_mp, cur->bc_ag.pag->pag_agno,
|
||||
left, cleft, agbno);
|
||||
return error;
|
||||
|
||||
out_error:
|
||||
trace_xfs_refcount_find_left_extent_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -769,13 +769,13 @@ xfs_refcount_find_right_extents(
|
||||
cright->rc_blockcount = aglen;
|
||||
cright->rc_refcount = 1;
|
||||
}
|
||||
trace_xfs_refcount_find_right_extent(cur->bc_mp, cur->bc_ag.agno,
|
||||
trace_xfs_refcount_find_right_extent(cur->bc_mp, cur->bc_ag.pag->pag_agno,
|
||||
cright, right, agbno + aglen);
|
||||
return error;
|
||||
|
||||
out_error:
|
||||
trace_xfs_refcount_find_right_extent_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -953,7 +953,7 @@ xfs_refcount_adjust_extents(
|
||||
ext.rc_startblock - *agbno);
|
||||
tmp.rc_refcount = 1 + adj;
|
||||
trace_xfs_refcount_modify_extent(cur->bc_mp,
|
||||
cur->bc_ag.agno, &tmp);
|
||||
cur->bc_ag.pag->pag_agno, &tmp);
|
||||
|
||||
/*
|
||||
* Either cover the hole (increment) or
|
||||
@@ -972,7 +972,7 @@ xfs_refcount_adjust_extents(
|
||||
cur->bc_ag.refc.nr_ops++;
|
||||
} else {
|
||||
fsbno = XFS_AGB_TO_FSB(cur->bc_mp,
|
||||
cur->bc_ag.agno,
|
||||
cur->bc_ag.pag->pag_agno,
|
||||
tmp.rc_startblock);
|
||||
xfs_bmap_add_free(cur->bc_tp, fsbno,
|
||||
tmp.rc_blockcount, oinfo);
|
||||
@@ -999,7 +999,7 @@ xfs_refcount_adjust_extents(
|
||||
goto skip;
|
||||
ext.rc_refcount += adj;
|
||||
trace_xfs_refcount_modify_extent(cur->bc_mp,
|
||||
cur->bc_ag.agno, &ext);
|
||||
cur->bc_ag.pag->pag_agno, &ext);
|
||||
if (ext.rc_refcount > 1) {
|
||||
error = xfs_refcount_update(cur, &ext);
|
||||
if (error)
|
||||
@@ -1017,7 +1017,7 @@ xfs_refcount_adjust_extents(
|
||||
goto advloop;
|
||||
} else {
|
||||
fsbno = XFS_AGB_TO_FSB(cur->bc_mp,
|
||||
cur->bc_ag.agno,
|
||||
cur->bc_ag.pag->pag_agno,
|
||||
ext.rc_startblock);
|
||||
xfs_bmap_add_free(cur->bc_tp, fsbno, ext.rc_blockcount,
|
||||
oinfo);
|
||||
@@ -1036,7 +1036,7 @@ advloop:
|
||||
return error;
|
||||
out_error:
|
||||
trace_xfs_refcount_modify_extent_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1058,10 +1058,10 @@ xfs_refcount_adjust(
|
||||
*new_agbno = agbno;
|
||||
*new_aglen = aglen;
|
||||
if (adj == XFS_REFCOUNT_ADJUST_INCREASE)
|
||||
trace_xfs_refcount_increase(cur->bc_mp, cur->bc_ag.agno,
|
||||
trace_xfs_refcount_increase(cur->bc_mp, cur->bc_ag.pag->pag_agno,
|
||||
agbno, aglen);
|
||||
else
|
||||
trace_xfs_refcount_decrease(cur->bc_mp, cur->bc_ag.agno,
|
||||
trace_xfs_refcount_decrease(cur->bc_mp, cur->bc_ag.pag->pag_agno,
|
||||
agbno, aglen);
|
||||
|
||||
/*
|
||||
@@ -1100,7 +1100,7 @@ xfs_refcount_adjust(
|
||||
return 0;
|
||||
|
||||
out_error:
|
||||
trace_xfs_refcount_adjust_error(cur->bc_mp, cur->bc_ag.agno,
|
||||
trace_xfs_refcount_adjust_error(cur->bc_mp, cur->bc_ag.pag->pag_agno,
|
||||
error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
@@ -1297,7 +1297,7 @@ xfs_refcount_find_shared(
|
||||
int have;
|
||||
int error;
|
||||
|
||||
trace_xfs_refcount_find_shared(cur->bc_mp, cur->bc_ag.agno,
|
||||
trace_xfs_refcount_find_shared(cur->bc_mp, cur->bc_ag.pag->pag_agno,
|
||||
agbno, aglen);
|
||||
|
||||
/* By default, skip the whole range */
|
||||
@@ -1377,12 +1377,12 @@ xfs_refcount_find_shared(
|
||||
|
||||
done:
|
||||
trace_xfs_refcount_find_shared_result(cur->bc_mp,
|
||||
cur->bc_ag.agno, *fbno, *flen);
|
||||
cur->bc_ag.pag->pag_agno, *fbno, *flen);
|
||||
|
||||
out_error:
|
||||
if (error)
|
||||
trace_xfs_refcount_find_shared_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1479,7 +1479,7 @@ xfs_refcount_adjust_cow_extents(
|
||||
tmp.rc_blockcount = aglen;
|
||||
tmp.rc_refcount = 1;
|
||||
trace_xfs_refcount_modify_extent(cur->bc_mp,
|
||||
cur->bc_ag.agno, &tmp);
|
||||
cur->bc_ag.pag->pag_agno, &tmp);
|
||||
|
||||
error = xfs_refcount_insert(cur, &tmp,
|
||||
&found_tmp);
|
||||
@@ -1507,7 +1507,7 @@ xfs_refcount_adjust_cow_extents(
|
||||
|
||||
ext.rc_refcount = 0;
|
||||
trace_xfs_refcount_modify_extent(cur->bc_mp,
|
||||
cur->bc_ag.agno, &ext);
|
||||
cur->bc_ag.pag->pag_agno, &ext);
|
||||
error = xfs_refcount_delete(cur, &found_rec);
|
||||
if (error)
|
||||
goto out_error;
|
||||
@@ -1523,7 +1523,7 @@ xfs_refcount_adjust_cow_extents(
|
||||
return error;
|
||||
out_error:
|
||||
trace_xfs_refcount_modify_extent_error(cur->bc_mp,
|
||||
cur->bc_ag.agno, error, _RET_IP_);
|
||||
cur->bc_ag.pag->pag_agno, error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1569,7 +1569,7 @@ xfs_refcount_adjust_cow(
|
||||
return 0;
|
||||
|
||||
out_error:
|
||||
trace_xfs_refcount_adjust_cow_error(cur->bc_mp, cur->bc_ag.agno,
|
||||
trace_xfs_refcount_adjust_cow_error(cur->bc_mp, cur->bc_ag.pag->pag_agno,
|
||||
error, _RET_IP_);
|
||||
return error;
|
||||
}
|
||||
@@ -1583,7 +1583,7 @@ __xfs_refcount_cow_alloc(
|
||||
xfs_agblock_t agbno,
|
||||
xfs_extlen_t aglen)
|
||||
{
|
||||
trace_xfs_refcount_cow_increase(rcur->bc_mp, rcur->bc_ag.agno,
|
||||
trace_xfs_refcount_cow_increase(rcur->bc_mp, rcur->bc_ag.pag->pag_agno,
|
||||
agbno, aglen);
|
||||
|
||||
/* Add refcount btree reservation */
|
||||
@@ -1600,7 +1600,7 @@ __xfs_refcount_cow_free(
|
||||
xfs_agblock_t agbno,
|
||||
xfs_extlen_t aglen)
|
||||
{
|
||||
trace_xfs_refcount_cow_decrease(rcur->bc_mp, rcur->bc_ag.agno,
|
||||
trace_xfs_refcount_cow_decrease(rcur->bc_mp, rcur->bc_ag.pag->pag_agno,
|
||||
agbno, aglen);
|
||||
|
||||
/* Remove refcount btree reservation */
|
||||
|
||||
Reference in New Issue
Block a user