Skip to content

Commit 8c392eb

Browse files
Dave Chinnerdchinner
authored andcommitted
xfs: pass perag to xfs_alloc_put_freelist
It's available in all callers, so pass it in so that the perag can be passed further down the stack. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
1 parent 49f0d84 commit 8c392eb

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

fs/xfs/libxfs/xfs_alloc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,7 +2742,7 @@ xfs_alloc_fix_freelist(
27422742
* Put each allocated block on the list.
27432743
*/
27442744
for (bno = targs.agbno; bno < targs.agbno + targs.len; bno++) {
2745-
error = xfs_alloc_put_freelist(tp, agbp,
2745+
error = xfs_alloc_put_freelist(pag, tp, agbp,
27462746
agflbp, bno, 0);
27472747
if (error)
27482748
goto out_agflbp_relse;
@@ -2872,6 +2872,7 @@ xfs_alloc_log_agf(
28722872
*/
28732873
int
28742874
xfs_alloc_put_freelist(
2875+
struct xfs_perag *pag,
28752876
struct xfs_trans *tp,
28762877
struct xfs_buf *agbp,
28772878
struct xfs_buf *agflbp,
@@ -2880,7 +2881,6 @@ xfs_alloc_put_freelist(
28802881
{
28812882
struct xfs_mount *mp = tp->t_mountp;
28822883
struct xfs_agf *agf = agbp->b_addr;
2883-
struct xfs_perag *pag;
28842884
__be32 *blockp;
28852885
int error;
28862886
uint32_t logflags;
@@ -2894,7 +2894,6 @@ xfs_alloc_put_freelist(
28942894
if (be32_to_cpu(agf->agf_fllast) == xfs_agfl_size(mp))
28952895
agf->agf_fllast = 0;
28962896

2897-
pag = agbp->b_pag;
28982897
ASSERT(!pag->pagf_agflreset);
28992898
be32_add_cpu(&agf->agf_flcount, 1);
29002899
pag->pagf_flcount++;

fs/xfs/libxfs/xfs_alloc.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ unsigned int xfs_alloc_min_freelist(struct xfs_mount *mp,
9797
struct xfs_perag *pag);
9898
int xfs_alloc_get_freelist(struct xfs_perag *pag, struct xfs_trans *tp,
9999
struct xfs_buf *agfbp, xfs_agblock_t *bnop, int btreeblk);
100+
int xfs_alloc_put_freelist(struct xfs_perag *pag, struct xfs_trans *tp,
101+
struct xfs_buf *agfbp, struct xfs_buf *agflbp,
102+
xfs_agblock_t bno, int btreeblk);
100103

101104
/*
102105
* Compute and fill in value of m_alloc_maxlevels.
@@ -114,17 +117,6 @@ xfs_alloc_log_agf(
114117
struct xfs_buf *bp, /* buffer for a.g. freelist header */
115118
uint32_t fields);/* mask of fields to be logged (XFS_AGF_...) */
116119

117-
/*
118-
* Put the block on the freelist for the allocation group.
119-
*/
120-
int /* error */
121-
xfs_alloc_put_freelist(
122-
struct xfs_trans *tp, /* transaction pointer */
123-
struct xfs_buf *agbp, /* buffer for a.g. freelist header */
124-
struct xfs_buf *agflbp,/* buffer for a.g. free block array */
125-
xfs_agblock_t bno, /* block being freed */
126-
int btreeblk); /* owner was a AGF btree */
127-
128120
/*
129121
* Allocate an extent (variable-size).
130122
*/

fs/xfs/libxfs/xfs_alloc_btree.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ xfs_allocbt_free_block(
8989
int error;
9090

9191
bno = xfs_daddr_to_agbno(cur->bc_mp, xfs_buf_daddr(bp));
92-
error = xfs_alloc_put_freelist(cur->bc_tp, agbp, NULL, bno, 1);
92+
error = xfs_alloc_put_freelist(cur->bc_ag.pag, cur->bc_tp, agbp, NULL,
93+
bno, 1);
9394
if (error)
9495
return error;
9596

fs/xfs/libxfs/xfs_rmap_btree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ xfs_rmapbt_free_block(
129129
bno, 1);
130130
be32_add_cpu(&agf->agf_rmap_blocks, -1);
131131
xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS);
132-
error = xfs_alloc_put_freelist(cur->bc_tp, agbp, NULL, bno, 1);
132+
error = xfs_alloc_put_freelist(pag, cur->bc_tp, agbp, NULL, bno, 1);
133133
if (error)
134134
return error;
135135

fs/xfs/scrub/repair.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ xrep_put_freelist(
516516
return error;
517517

518518
/* Put the block on the AGFL. */
519-
error = xfs_alloc_put_freelist(sc->tp, sc->sa.agf_bp, sc->sa.agfl_bp,
520-
agbno, 0);
519+
error = xfs_alloc_put_freelist(sc->sa.pag, sc->tp, sc->sa.agf_bp,
520+
sc->sa.agfl_bp, agbno, 0);
521521
if (error)
522522
return error;
523523
xfs_extent_busy_insert(sc->tp, sc->sa.pag, agbno, 1,

0 commit comments

Comments
 (0)