Commit 576af732 authored by Dave Chinner's avatar Dave Chinner Committed by Darrick J. Wong

xfs: convert btree cursor ag-private member name

bc_private.a -> bc_ag conversion via script:

`sed -i 's/bc_private\.a/bc_ag/g' fs/xfs/*[ch] fs/xfs/*/*[ch]`

And then revert the change to the bc_ag #define in
fs/xfs/libxfs/xfs_btree.h manually.
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
parent 7cace18a
...@@ -151,7 +151,7 @@ xfs_alloc_lookup_eq( ...@@ -151,7 +151,7 @@ xfs_alloc_lookup_eq(
cur->bc_rec.a.ar_startblock = bno; cur->bc_rec.a.ar_startblock = bno;
cur->bc_rec.a.ar_blockcount = len; cur->bc_rec.a.ar_blockcount = len;
error = xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); error = xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
cur->bc_private.a.priv.abt.active = (*stat == 1); cur->bc_ag.priv.abt.active = (*stat == 1);
return error; return error;
} }
...@@ -171,7 +171,7 @@ xfs_alloc_lookup_ge( ...@@ -171,7 +171,7 @@ xfs_alloc_lookup_ge(
cur->bc_rec.a.ar_startblock = bno; cur->bc_rec.a.ar_startblock = bno;
cur->bc_rec.a.ar_blockcount = len; cur->bc_rec.a.ar_blockcount = len;
error = xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); error = xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat);
cur->bc_private.a.priv.abt.active = (*stat == 1); cur->bc_ag.priv.abt.active = (*stat == 1);
return error; return error;
} }
...@@ -190,7 +190,7 @@ xfs_alloc_lookup_le( ...@@ -190,7 +190,7 @@ xfs_alloc_lookup_le(
cur->bc_rec.a.ar_startblock = bno; cur->bc_rec.a.ar_startblock = bno;
cur->bc_rec.a.ar_blockcount = len; cur->bc_rec.a.ar_blockcount = len;
error = xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); error = xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat);
cur->bc_private.a.priv.abt.active = (*stat == 1); cur->bc_ag.priv.abt.active = (*stat == 1);
return error; return error;
} }
...@@ -198,7 +198,7 @@ static inline bool ...@@ -198,7 +198,7 @@ static inline bool
xfs_alloc_cur_active( xfs_alloc_cur_active(
struct xfs_btree_cur *cur) struct xfs_btree_cur *cur)
{ {
return cur && cur->bc_private.a.priv.abt.active; return cur && cur->bc_ag.priv.abt.active;
} }
/* /*
...@@ -230,7 +230,7 @@ xfs_alloc_get_rec( ...@@ -230,7 +230,7 @@ xfs_alloc_get_rec(
int *stat) /* output: success/failure */ int *stat) /* output: success/failure */
{ {
struct xfs_mount *mp = cur->bc_mp; struct xfs_mount *mp = cur->bc_mp;
xfs_agnumber_t agno = cur->bc_private.a.agno; xfs_agnumber_t agno = cur->bc_ag.agno;
union xfs_btree_rec *rec; union xfs_btree_rec *rec;
int error; int error;
...@@ -908,7 +908,7 @@ xfs_alloc_cur_check( ...@@ -908,7 +908,7 @@ xfs_alloc_cur_check(
deactivate = true; deactivate = true;
out: out:
if (deactivate) if (deactivate)
cur->bc_private.a.priv.abt.active = false; cur->bc_ag.priv.abt.active = false;
trace_xfs_alloc_cur_check(args->mp, cur->bc_btnum, bno, len, diff, trace_xfs_alloc_cur_check(args->mp, cur->bc_btnum, bno, len, diff,
*new); *new);
return 0; return 0;
...@@ -1352,7 +1352,7 @@ xfs_alloc_walk_iter( ...@@ -1352,7 +1352,7 @@ xfs_alloc_walk_iter(
if (error) if (error)
return error; return error;
if (i == 0) if (i == 0)
cur->bc_private.a.priv.abt.active = false; cur->bc_ag.priv.abt.active = false;
if (count > 0) if (count > 0)
count--; count--;
...@@ -1467,7 +1467,7 @@ xfs_alloc_ag_vextent_locality( ...@@ -1467,7 +1467,7 @@ xfs_alloc_ag_vextent_locality(
if (error) if (error)
return error; return error;
if (i) { if (i) {
acur->cnt->bc_private.a.priv.abt.active = true; acur->cnt->bc_ag.priv.abt.active = true;
fbcur = acur->cnt; fbcur = acur->cnt;
fbinc = false; fbinc = false;
} }
......
...@@ -25,7 +25,7 @@ xfs_allocbt_dup_cursor( ...@@ -25,7 +25,7 @@ xfs_allocbt_dup_cursor(
struct xfs_btree_cur *cur) struct xfs_btree_cur *cur)
{ {
return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp,
cur->bc_private.a.agbp, cur->bc_private.a.agno, cur->bc_ag.agbp, cur->bc_ag.agno,
cur->bc_btnum); cur->bc_btnum);
} }
...@@ -35,7 +35,7 @@ xfs_allocbt_set_root( ...@@ -35,7 +35,7 @@ xfs_allocbt_set_root(
union xfs_btree_ptr *ptr, union xfs_btree_ptr *ptr,
int inc) int inc)
{ {
struct xfs_buf *agbp = cur->bc_private.a.agbp; struct xfs_buf *agbp = cur->bc_ag.agbp;
struct xfs_agf *agf = agbp->b_addr; struct xfs_agf *agf = agbp->b_addr;
xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno);
int btnum = cur->bc_btnum; int btnum = cur->bc_btnum;
...@@ -62,7 +62,7 @@ xfs_allocbt_alloc_block( ...@@ -62,7 +62,7 @@ xfs_allocbt_alloc_block(
xfs_agblock_t bno; xfs_agblock_t bno;
/* Allocate the new block from the freelist. If we can't, give up. */ /* Allocate the new block from the freelist. If we can't, give up. */
error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp, error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_ag.agbp,
&bno, 1); &bno, 1);
if (error) if (error)
return error; return error;
...@@ -72,7 +72,7 @@ xfs_allocbt_alloc_block( ...@@ -72,7 +72,7 @@ xfs_allocbt_alloc_block(
return 0; return 0;
} }
xfs_extent_busy_reuse(cur->bc_mp, cur->bc_private.a.agno, bno, 1, false); xfs_extent_busy_reuse(cur->bc_mp, cur->bc_ag.agno, bno, 1, false);
xfs_trans_agbtree_delta(cur->bc_tp, 1); xfs_trans_agbtree_delta(cur->bc_tp, 1);
new->s = cpu_to_be32(bno); new->s = cpu_to_be32(bno);
...@@ -86,7 +86,7 @@ xfs_allocbt_free_block( ...@@ -86,7 +86,7 @@ xfs_allocbt_free_block(
struct xfs_btree_cur *cur, struct xfs_btree_cur *cur,
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_buf *agbp = cur->bc_private.a.agbp; struct xfs_buf *agbp = cur->bc_ag.agbp;
struct xfs_agf *agf = agbp->b_addr; struct xfs_agf *agf = agbp->b_addr;
xfs_agblock_t bno; xfs_agblock_t bno;
int error; int error;
...@@ -113,7 +113,7 @@ xfs_allocbt_update_lastrec( ...@@ -113,7 +113,7 @@ xfs_allocbt_update_lastrec(
int ptr, int ptr,
int reason) int reason)
{ {
struct xfs_agf *agf = cur->bc_private.a.agbp->b_addr; struct xfs_agf *agf = cur->bc_ag.agbp->b_addr;
xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno);
struct xfs_perag *pag; struct xfs_perag *pag;
__be32 len; __be32 len;
...@@ -162,7 +162,7 @@ xfs_allocbt_update_lastrec( ...@@ -162,7 +162,7 @@ xfs_allocbt_update_lastrec(
pag = xfs_perag_get(cur->bc_mp, seqno); pag = xfs_perag_get(cur->bc_mp, seqno);
pag->pagf_longest = be32_to_cpu(len); pag->pagf_longest = be32_to_cpu(len);
xfs_perag_put(pag); xfs_perag_put(pag);
xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, XFS_AGF_LONGEST); xfs_alloc_log_agf(cur->bc_tp, cur->bc_ag.agbp, XFS_AGF_LONGEST);
} }
STATIC int STATIC int
...@@ -226,9 +226,9 @@ xfs_allocbt_init_ptr_from_cur( ...@@ -226,9 +226,9 @@ xfs_allocbt_init_ptr_from_cur(
struct xfs_btree_cur *cur, struct xfs_btree_cur *cur,
union xfs_btree_ptr *ptr) union xfs_btree_ptr *ptr)
{ {
struct xfs_agf *agf = cur->bc_private.a.agbp->b_addr; struct xfs_agf *agf = cur->bc_ag.agbp->b_addr;
ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno)); ASSERT(cur->bc_ag.agno == be32_to_cpu(agf->agf_seqno));
ptr->s = agf->agf_roots[cur->bc_btnum]; ptr->s = agf->agf_roots[cur->bc_btnum];
} }
...@@ -505,9 +505,9 @@ xfs_allocbt_init_cursor( ...@@ -505,9 +505,9 @@ xfs_allocbt_init_cursor(
cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]); cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]);
} }
cur->bc_private.a.agbp = agbp; cur->bc_ag.agbp = agbp;
cur->bc_private.a.agno = agno; cur->bc_ag.agno = agno;
cur->bc_private.a.priv.abt.active = false; cur->bc_ag.priv.abt.active = false;
if (xfs_sb_version_hascrc(&mp->m_sb)) if (xfs_sb_version_hascrc(&mp->m_sb))
cur->bc_flags |= XFS_BTREE_CRC_BLOCKS; cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
......
...@@ -214,7 +214,7 @@ xfs_btree_check_sptr( ...@@ -214,7 +214,7 @@ xfs_btree_check_sptr(
{ {
if (level <= 0) if (level <= 0)
return false; return false;
return xfs_verify_agbno(cur->bc_mp, cur->bc_private.a.agno, agbno); return xfs_verify_agbno(cur->bc_mp, cur->bc_ag.agno, agbno);
} }
/* /*
...@@ -243,7 +243,7 @@ xfs_btree_check_ptr( ...@@ -243,7 +243,7 @@ xfs_btree_check_ptr(
return 0; return 0;
xfs_err(cur->bc_mp, xfs_err(cur->bc_mp,
"AG %u: Corrupt btree %d pointer at level %d index %d.", "AG %u: Corrupt btree %d pointer at level %d index %d.",
cur->bc_private.a.agno, cur->bc_btnum, cur->bc_ag.agno, cur->bc_btnum,
level, index); level, index);
} }
...@@ -881,13 +881,13 @@ xfs_btree_readahead_sblock( ...@@ -881,13 +881,13 @@ xfs_btree_readahead_sblock(
if ((lr & XFS_BTCUR_LEFTRA) && left != NULLAGBLOCK) { if ((lr & XFS_BTCUR_LEFTRA) && left != NULLAGBLOCK) {
xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, xfs_btree_reada_bufs(cur->bc_mp, cur->bc_ag.agno,
left, 1, cur->bc_ops->buf_ops); left, 1, cur->bc_ops->buf_ops);
rval++; rval++;
} }
if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLAGBLOCK) { if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLAGBLOCK) {
xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, xfs_btree_reada_bufs(cur->bc_mp, cur->bc_ag.agno,
right, 1, cur->bc_ops->buf_ops); right, 1, cur->bc_ops->buf_ops);
rval++; rval++;
} }
...@@ -945,7 +945,7 @@ xfs_btree_ptr_to_daddr( ...@@ -945,7 +945,7 @@ xfs_btree_ptr_to_daddr(
*daddr = XFS_FSB_TO_DADDR(cur->bc_mp, fsbno); *daddr = XFS_FSB_TO_DADDR(cur->bc_mp, fsbno);
} else { } else {
agbno = be32_to_cpu(ptr->s); agbno = be32_to_cpu(ptr->s);
*daddr = XFS_AGB_TO_DADDR(cur->bc_mp, cur->bc_private.a.agno, *daddr = XFS_AGB_TO_DADDR(cur->bc_mp, cur->bc_ag.agno,
agbno); agbno);
} }
...@@ -1146,7 +1146,7 @@ xfs_btree_init_block_cur( ...@@ -1146,7 +1146,7 @@ xfs_btree_init_block_cur(
if (cur->bc_flags & XFS_BTREE_LONG_PTRS) if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
owner = cur->bc_private.b.ip->i_ino; owner = cur->bc_private.b.ip->i_ino;
else else
owner = cur->bc_private.a.agno; owner = cur->bc_ag.agno;
xfs_btree_init_block_int(cur->bc_mp, XFS_BUF_TO_BLOCK(bp), bp->b_bn, xfs_btree_init_block_int(cur->bc_mp, XFS_BUF_TO_BLOCK(bp), bp->b_bn,
cur->bc_btnum, level, numrecs, cur->bc_btnum, level, numrecs,
......
...@@ -105,7 +105,7 @@ xfs_inobt_get_rec( ...@@ -105,7 +105,7 @@ xfs_inobt_get_rec(
int *stat) int *stat)
{ {
struct xfs_mount *mp = cur->bc_mp; struct xfs_mount *mp = cur->bc_mp;
xfs_agnumber_t agno = cur->bc_private.a.agno; xfs_agnumber_t agno = cur->bc_ag.agno;
union xfs_btree_rec *rec; union xfs_btree_rec *rec;
int error; int error;
uint64_t realfree; uint64_t realfree;
......
...@@ -34,7 +34,7 @@ xfs_inobt_dup_cursor( ...@@ -34,7 +34,7 @@ xfs_inobt_dup_cursor(
struct xfs_btree_cur *cur) struct xfs_btree_cur *cur)
{ {
return xfs_inobt_init_cursor(cur->bc_mp, cur->bc_tp, return xfs_inobt_init_cursor(cur->bc_mp, cur->bc_tp,
cur->bc_private.a.agbp, cur->bc_private.a.agno, cur->bc_ag.agbp, cur->bc_ag.agno,
cur->bc_btnum); cur->bc_btnum);
} }
...@@ -44,7 +44,7 @@ xfs_inobt_set_root( ...@@ -44,7 +44,7 @@ xfs_inobt_set_root(
union xfs_btree_ptr *nptr, union xfs_btree_ptr *nptr,
int inc) /* level change */ int inc) /* level change */
{ {
struct xfs_buf *agbp = cur->bc_private.a.agbp; struct xfs_buf *agbp = cur->bc_ag.agbp;
struct xfs_agi *agi = agbp->b_addr; struct xfs_agi *agi = agbp->b_addr;
agi->agi_root = nptr->s; agi->agi_root = nptr->s;
...@@ -58,7 +58,7 @@ xfs_finobt_set_root( ...@@ -58,7 +58,7 @@ xfs_finobt_set_root(
union xfs_btree_ptr *nptr, union xfs_btree_ptr *nptr,
int inc) /* level change */ int inc) /* level change */
{ {
struct xfs_buf *agbp = cur->bc_private.a.agbp; struct xfs_buf *agbp = cur->bc_ag.agbp;
struct xfs_agi *agi = agbp->b_addr; struct xfs_agi *agi = agbp->b_addr;
agi->agi_free_root = nptr->s; agi->agi_free_root = nptr->s;
...@@ -83,7 +83,7 @@ __xfs_inobt_alloc_block( ...@@ -83,7 +83,7 @@ __xfs_inobt_alloc_block(
args.tp = cur->bc_tp; args.tp = cur->bc_tp;
args.mp = cur->bc_mp; args.mp = cur->bc_mp;
args.oinfo = XFS_RMAP_OINFO_INOBT; args.oinfo = XFS_RMAP_OINFO_INOBT;
args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_private.a.agno, sbno); args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_ag.agno, sbno);
args.minlen = 1; args.minlen = 1;
args.maxlen = 1; args.maxlen = 1;
args.prod = 1; args.prod = 1;
...@@ -212,9 +212,9 @@ xfs_inobt_init_ptr_from_cur( ...@@ -212,9 +212,9 @@ xfs_inobt_init_ptr_from_cur(
struct xfs_btree_cur *cur, struct xfs_btree_cur *cur,
union xfs_btree_ptr *ptr) union xfs_btree_ptr *ptr)
{ {
struct xfs_agi *agi = cur->bc_private.a.agbp->b_addr; struct xfs_agi *agi = cur->bc_ag.agbp->b_addr;
ASSERT(cur->bc_private.a.agno == be32_to_cpu(agi->agi_seqno)); ASSERT(cur->bc_ag.agno == be32_to_cpu(agi->agi_seqno));
ptr->s = agi->agi_root; ptr->s = agi->agi_root;
} }
...@@ -224,9 +224,9 @@ xfs_finobt_init_ptr_from_cur( ...@@ -224,9 +224,9 @@ xfs_finobt_init_ptr_from_cur(
struct xfs_btree_cur *cur, struct xfs_btree_cur *cur,
union xfs_btree_ptr *ptr) union xfs_btree_ptr *ptr)
{ {
struct xfs_agi *agi = cur->bc_private.a.agbp->b_addr; struct xfs_agi *agi = cur->bc_ag.agbp->b_addr;
ASSERT(cur->bc_private.a.agno == be32_to_cpu(agi->agi_seqno)); ASSERT(cur->bc_ag.agno == be32_to_cpu(agi->agi_seqno));
ptr->s = agi->agi_free_root; ptr->s = agi->agi_free_root;
} }
...@@ -433,8 +433,8 @@ xfs_inobt_init_cursor( ...@@ -433,8 +433,8 @@ xfs_inobt_init_cursor(
if (xfs_sb_version_hascrc(&mp->m_sb)) if (xfs_sb_version_hascrc(&mp->m_sb))
cur->bc_flags |= XFS_BTREE_CRC_BLOCKS; cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
cur->bc_private.a.agbp = agbp; cur->bc_ag.agbp = agbp;
cur->bc_private.a.agno = agno; cur->bc_ag.agno = agno;
return cur; return cur;
} }
......
This diff is collapsed.
...@@ -25,7 +25,7 @@ xfs_refcountbt_dup_cursor( ...@@ -25,7 +25,7 @@ xfs_refcountbt_dup_cursor(
struct xfs_btree_cur *cur) struct xfs_btree_cur *cur)
{ {
return xfs_refcountbt_init_cursor(cur->bc_mp, cur->bc_tp, return xfs_refcountbt_init_cursor(cur->bc_mp, cur->bc_tp,
cur->bc_private.a.agbp, cur->bc_private.a.agno); cur->bc_ag.agbp, cur->bc_ag.agno);
} }
STATIC void STATIC void
...@@ -34,7 +34,7 @@ xfs_refcountbt_set_root( ...@@ -34,7 +34,7 @@ xfs_refcountbt_set_root(
union xfs_btree_ptr *ptr, union xfs_btree_ptr *ptr,
int inc) int inc)
{ {
struct xfs_buf *agbp = cur->bc_private.a.agbp; struct xfs_buf *agbp = cur->bc_ag.agbp;
struct xfs_agf *agf = agbp->b_addr; struct xfs_agf *agf = agbp->b_addr;
xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno);
struct xfs_perag *pag = xfs_perag_get(cur->bc_mp, seqno); struct xfs_perag *pag = xfs_perag_get(cur->bc_mp, seqno);
...@@ -57,7 +57,7 @@ xfs_refcountbt_alloc_block( ...@@ -57,7 +57,7 @@ xfs_refcountbt_alloc_block(
union xfs_btree_ptr *new, union xfs_btree_ptr *new,
int *stat) int *stat)
{ {
struct xfs_buf *agbp = cur->bc_private.a.agbp; struct xfs_buf *agbp = cur->bc_ag.agbp;
struct xfs_agf *agf = agbp->b_addr; struct xfs_agf *agf = agbp->b_addr;
struct xfs_alloc_arg args; /* block allocation args */ struct xfs_alloc_arg args; /* block allocation args */
int error; /* error return value */ int error; /* error return value */
...@@ -66,7 +66,7 @@ xfs_refcountbt_alloc_block( ...@@ -66,7 +66,7 @@ xfs_refcountbt_alloc_block(
args.tp = cur->bc_tp; args.tp = cur->bc_tp;
args.mp = cur->bc_mp; args.mp = cur->bc_mp;
args.type = XFS_ALLOCTYPE_NEAR_BNO; args.type = XFS_ALLOCTYPE_NEAR_BNO;
args.fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno, args.fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_ag.agno,
xfs_refc_block(args.mp)); xfs_refc_block(args.mp));
args.oinfo = XFS_RMAP_OINFO_REFC; args.oinfo = XFS_RMAP_OINFO_REFC;
args.minlen = args.maxlen = args.prod = 1; args.minlen = args.maxlen = args.prod = 1;
...@@ -75,13 +75,13 @@ xfs_refcountbt_alloc_block( ...@@ -75,13 +75,13 @@ xfs_refcountbt_alloc_block(
error = xfs_alloc_vextent(&args); error = xfs_alloc_vextent(&args);
if (error) if (error)
goto out_error; goto out_error;
trace_xfs_refcountbt_alloc_block(cur->bc_mp, cur->bc_private.a.agno, trace_xfs_refcountbt_alloc_block(cur->bc_mp, cur->bc_ag.agno,
args.agbno, 1); args.agbno, 1);
if (args.fsbno == NULLFSBLOCK) { if (args.fsbno == NULLFSBLOCK) {
*stat = 0; *stat = 0;
return 0; return 0;
} }
ASSERT(args.agno == cur->bc_private.a.agno); ASSERT(args.agno == cur->bc_ag.agno);
ASSERT(args.len == 1); ASSERT(args.len == 1);
new->s = cpu_to_be32(args.agbno); new->s = cpu_to_be32(args.agbno);
...@@ -101,12 +101,12 @@ xfs_refcountbt_free_block( ...@@ -101,12 +101,12 @@ xfs_refcountbt_free_block(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_mount *mp = cur->bc_mp; struct xfs_mount *mp = cur->bc_mp;
struct xfs_buf *agbp = cur->bc_private.a.agbp; struct xfs_buf *agbp = cur->bc_ag.agbp;
struct xfs_agf *agf = agbp->b_addr; struct xfs_agf *agf = agbp->b_addr;
xfs_fsblock_t fsbno = XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(bp)); xfs_fsblock_t fsbno = XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(bp));
int error; int error;
trace_xfs_refcountbt_free_block(cur->bc_mp, cur->bc_private.a.agno, trace_xfs_refcountbt_free_block(cur->bc_mp, cur->bc_ag.agno,
XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno), 1); XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno), 1);
be32_add_cpu(&agf->agf_refcount_blocks, -1); be32_add_cpu(&agf->agf_refcount_blocks, -1);
xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_REFCOUNT_BLOCKS); xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_REFCOUNT_BLOCKS);
...@@ -169,9 +169,9 @@ xfs_refcountbt_init_ptr_from_cur( ...@@ -169,9 +169,9 @@ xfs_refcountbt_init_ptr_from_cur(
struct xfs_btree_cur *cur, struct xfs_btree_cur *cur,
union xfs_btree_ptr *ptr) union xfs_btree_ptr *ptr)
{ {
struct xfs_agf *agf = cur->bc_private.a.agbp->b_addr; struct xfs_agf *agf = cur->bc_ag.agbp->b_addr;
ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno)); ASSERT(cur->bc_ag.agno == be32_to_cpu(agf->agf_seqno));
ptr->s = agf->agf_refcount_root; ptr->s = agf->agf_refcount_root;
} }
...@@ -336,12 +336,12 @@ xfs_refcountbt_init_cursor( ...@@ -336,12 +336,12 @@ xfs_refcountbt_init_cursor(
cur->bc_nlevels = be32_to_cpu(agf->agf_refcount_level); cur->bc_nlevels = be32_to_cpu(agf->agf_refcount_level);
cur->bc_private.a.agbp = agbp; cur->bc_ag.agbp = agbp;
cur->bc_private.a.agno = agno; cur->bc_ag.agno = agno;
cur->bc_flags |= XFS_BTREE_CRC_BLOCKS; cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
cur->bc_private.a.priv.refc.nr_ops = 0; cur->bc_ag.priv.refc.nr_ops = 0;
cur->bc_private.a.priv.refc.shape_changes = 0; cur->bc_ag.priv.refc.shape_changes = 0;
return cur; return cur;
} }
......
This diff is collapsed.
...@@ -51,7 +51,7 @@ xfs_rmapbt_dup_cursor( ...@@ -51,7 +51,7 @@ xfs_rmapbt_dup_cursor(
struct xfs_btree_cur *cur) struct xfs_btree_cur *cur)
{ {
return xfs_rmapbt_init_cursor(cur->bc_mp, cur->bc_tp, return xfs_rmapbt_init_cursor(cur->bc_mp, cur->bc_tp,
cur->bc_private.a.agbp, cur->bc_private.a.agno); cur->bc_ag.agbp, cur->bc_ag.agno);
} }
STATIC void STATIC void
...@@ -60,7 +60,7 @@ xfs_rmapbt_set_root( ...@@ -60,7 +60,7 @@ xfs_rmapbt_set_root(
union xfs_btree_ptr *ptr, union xfs_btree_ptr *ptr,
int inc) int inc)
{ {
struct xfs_buf *agbp = cur->bc_private.a.agbp; struct xfs_buf *agbp = cur->bc_ag.agbp;
struct xfs_agf *agf = agbp->b_addr; struct xfs_agf *agf = agbp->b_addr;
xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno);
int btnum = cur->bc_btnum; int btnum = cur->bc_btnum;
...@@ -83,25 +83,25 @@ xfs_rmapbt_alloc_block( ...@@ -83,25 +83,25 @@ xfs_rmapbt_alloc_block(
union xfs_btree_ptr *new, union xfs_btree_ptr *new,
int *stat) int *stat)
{ {
struct xfs_buf *agbp = cur->bc_private.a.agbp; struct xfs_buf *agbp = cur->bc_ag.agbp;
struct xfs_agf *agf = agbp->b_addr; struct xfs_agf *agf = agbp->b_addr;
int error; int error;
xfs_agblock_t bno; xfs_agblock_t bno;
/* Allocate the new block from the freelist. If we can't, give up. */ /* Allocate the new block from the freelist. If we can't, give up. */
error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp, error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_ag.agbp,
&bno, 1); &bno, 1);
if (error) if (error)
return error; return error;
trace_xfs_rmapbt_alloc_block(cur->bc_mp, cur->bc_private.a.agno, trace_xfs_rmapbt_alloc_block(cur->bc_mp, cur->bc_ag.agno,
bno, 1); bno, 1);
if (bno == NULLAGBLOCK) { if (bno == NULLAGBLOCK) {
*stat = 0; *stat = 0;
return 0; return 0;
} }
xfs_extent_busy_reuse(cur->bc_mp, cur->bc_private.a.agno, bno, 1, xfs_extent_busy_reuse(cur->bc_mp, cur->bc_ag.agno, bno, 1,
false); false);
xfs_trans_agbtree_delta(cur->bc_tp, 1); xfs_trans_agbtree_delta(cur->bc_tp, 1);
...@@ -109,7 +109,7 @@ xfs_rmapbt_alloc_block( ...@@ -109,7 +109,7 @@ xfs_rmapbt_alloc_block(
be32_add_cpu(&agf->agf_rmap_blocks, 1); be32_add_cpu(&agf->agf_rmap_blocks, 1);
xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS); xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS);
xfs_ag_resv_rmapbt_alloc(cur->bc_mp, cur->bc_private.a.agno); xfs_ag_resv_rmapbt_alloc(cur->bc_mp, cur->bc_ag.agno);
*stat = 1; *stat = 1;
return 0; return 0;
...@@ -120,13 +120,13 @@ xfs_rmapbt_free_block( ...@@ -120,13 +120,13 @@ xfs_rmapbt_free_block(
struct xfs_btree_cur *cur, struct xfs_btree_cur *cur,
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_buf *agbp = cur->bc_private.a.agbp; struct xfs_buf *agbp = cur->bc_ag.agbp;
struct xfs_agf *agf = agbp->b_addr; struct xfs_agf *agf = agbp->b_addr;
xfs_agblock_t bno; xfs_agblock_t bno;
int error; int error;
bno = xfs_daddr_to_agbno(cur->bc_mp, XFS_BUF_ADDR(bp)); bno = xfs_daddr_to_agbno(cur->bc_mp, XFS_BUF_ADDR(bp));
trace_xfs_rmapbt_free_block(cur->bc_mp, cur->bc_private.a.agno, trace_xfs_rmapbt_free_block(cur->bc_mp, cur->bc_ag.agno,
bno, 1); bno, 1);
be32_add_cpu(&agf->agf_rmap_blocks, -1); be32_add_cpu(&agf->agf_rmap_blocks, -1);
xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS); xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS);
...@@ -138,7 +138,7 @@ xfs_rmapbt_free_block( ...@@ -138,7 +138,7 @@ xfs_rmapbt_free_block(
XFS_EXTENT_BUSY_SKIP_DISCARD); XFS_EXTENT_BUSY_SKIP_DISCARD);
xfs_trans_agbtree_delta(cur->bc_tp, -1); xfs_trans_agbtree_delta(cur->bc_tp, -1);
xfs_ag_resv_rmapbt_free(cur->bc_mp, cur->bc_private.a.agno); xfs_ag_resv_rmapbt_free(cur->bc_mp, cur->bc_ag.agno);
return 0; return 0;
} }
...@@ -215,9 +215,9 @@ xfs_rmapbt_init_ptr_from_cur( ...@@ -215,9 +215,9 @@ xfs_rmapbt_init_ptr_from_cur(
struct xfs_btree_cur *cur, struct xfs_btree_cur *cur,
union xfs_btree_ptr *ptr) union xfs_btree_ptr *ptr)
{ {
struct xfs_agf *agf = cur->bc_private.a.agbp->b_addr; struct xfs_agf *agf = cur->bc_ag.agbp->b_addr;
ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno)); ASSERT(cur->bc_ag.agno == be32_to_cpu(agf->agf_seqno));
ptr->s = agf->agf_roots[cur->bc_btnum]; ptr->s = agf->agf_roots[cur->bc_btnum];
} }
...@@ -472,8 +472,8 @@ xfs_rmapbt_init_cursor( ...@@ -472,8 +472,8 @@ xfs_rmapbt_init_cursor(
cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]); cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]);
cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_rmap_2); cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_rmap_2);
cur->bc_private.a.agbp = agbp; cur->bc_ag.agbp = agbp;
cur->bc_private.a.agno = agno; cur->bc_ag.agno = agno;
return cur; return cur;
} }
......
...@@ -453,7 +453,7 @@ xrep_agfl_walk_rmap( ...@@ -453,7 +453,7 @@ xrep_agfl_walk_rmap(
/* Record all the OWN_AG blocks. */ /* Record all the OWN_AG blocks. */
if (rec->rm_owner == XFS_RMAP_OWN_AG) { if (rec->rm_owner == XFS_RMAP_OWN_AG) {
fsb = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno, fsb = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_ag.agno,
rec->rm_startblock); rec->rm_startblock);
error = xfs_bitmap_set(ra->freesp, fsb, rec->rm_blockcount); error = xfs_bitmap_set(ra->freesp, fsb, rec->rm_blockcount);
if (error) if (error)
......
...@@ -94,7 +94,7 @@ xchk_allocbt_rec( ...@@ -94,7 +94,7 @@ xchk_allocbt_rec(
union xfs_btree_rec *rec) union xfs_btree_rec *rec)
{ {
struct xfs_mount *mp = bs->cur->bc_mp; struct xfs_mount *mp = bs->cur->bc_mp;
xfs_agnumber_t agno = bs->cur->bc_private.a.agno; xfs_agnumber_t agno = bs->cur->bc_ag.agno;
xfs_agblock_t bno; xfs_agblock_t bno;
xfs_extlen_t len; xfs_extlen_t len;
......
...@@ -501,7 +501,7 @@ xchk_bmap_check_rmap( ...@@ -501,7 +501,7 @@ xchk_bmap_check_rmap(
xchk_fblock_set_corrupt(sc, sbcri->whichfork, xchk_fblock_set_corrupt(sc, sbcri->whichfork,
rec->rm_offset); rec->rm_offset);
if (irec.br_startblock != XFS_AGB_TO_FSB(sc->mp, if (irec.br_startblock != XFS_AGB_TO_FSB(sc->mp,
cur->bc_private.a.agno, rec->rm_startblock)) cur->bc_ag.agno, rec->rm_startblock))
xchk_fblock_set_corrupt(sc, sbcri->whichfork, xchk_fblock_set_corrupt(sc, sbcri->whichfork,
rec->rm_offset); rec->rm_offset);
if (irec.br_blockcount > rec->rm_blockcount) if (irec.br_blockcount > rec->rm_blockcount)
......
...@@ -104,7 +104,7 @@ xchk_iallocbt_chunk( ...@@ -104,7 +104,7 @@ xchk_iallocbt_chunk(
xfs_extlen_t len) xfs_extlen_t len)
{ {
struct xfs_mount *mp = bs->cur->bc_mp; struct xfs_mount *mp = bs->cur->bc_mp;
xfs_agnumber_t agno = bs->cur->bc_private.a.agno; xfs_agnumber_t agno = bs->cur->bc_ag.agno;
xfs_agblock_t bno; xfs_agblock_t bno;
bno = XFS_AGINO_TO_AGBNO(mp, agino); bno = XFS_AGINO_TO_AGBNO(mp, agino);
...@@ -164,7 +164,7 @@ xchk_iallocbt_check_cluster_ifree( ...@@ -164,7 +164,7 @@ xchk_iallocbt_check_cluster_ifree(
* the record, compute which fs inode we're talking about. * the record, compute which fs inode we're talking about.
*/ */
agino = irec->ir_startino + irec_ino; agino = irec->ir_startino + irec_ino;
fsino = XFS_AGINO_TO_INO(mp, bs->cur->bc_private.a.agno, agino); fsino = XFS_AGINO_TO_INO(mp, bs->cur->bc_ag.agno, agino);
irec_free = (irec->ir_free & XFS_INOBT_MASK(irec_ino)); irec_free = (irec->ir_free & XFS_INOBT_MASK(irec_ino));
if (be16_to_cpu(dip->di_magic) != XFS_DINODE_MAGIC || if (be16_to_cpu(dip->di_magic) != XFS_DINODE_MAGIC ||
...@@ -215,7 +215,7 @@ xchk_iallocbt_check_cluster( ...@@ -215,7 +215,7 @@ xchk_iallocbt_check_cluster(
struct xfs_dinode *dip; struct xfs_dinode *dip;
struct xfs_buf *cluster_bp; struct xfs_buf *cluster_bp;
unsigned int nr_inodes; unsigned int nr_inodes;
xfs_agnumber_t agno = bs->cur->bc_private.a.agno; xfs_agnumber_t agno = bs->cur->bc_ag.agno;
xfs_agblock_t agbno; xfs_agblock_t agbno;
unsigned int cluster_index; unsigned int cluster_index;
uint16_t cluster_mask = 0; uint16_t cluster_mask = 0;
...@@ -426,7 +426,7 @@ xchk_iallocbt_rec( ...@@ -426,7 +426,7 @@ xchk_iallocbt_rec(
struct xchk_iallocbt *iabt = bs->private; struct xchk_iallocbt *iabt = bs->private;
struct xfs_inobt_rec_incore irec; struct xfs_inobt_rec_incore irec;
uint64_t holes; uint64_t holes;
xfs_agnumber_t agno = bs->cur->bc_private.a.agno; xfs_agnumber_t agno = bs->cur->bc_ag.agno;
xfs_agino_t agino; xfs_agino_t agino;
xfs_extlen_t len; xfs_extlen_t len;
int holecount; int holecount;
......
...@@ -336,7 +336,7 @@ xchk_refcountbt_rec( ...@@ -336,7 +336,7 @@ xchk_refcountbt_rec(
{ {
struct xfs_mount *mp = bs->cur->bc_mp; struct xfs_mount *mp = bs->cur->bc_mp;
xfs_agblock_t *cow_blocks = bs->private; xfs_agblock_t *cow_blocks = bs->private;
xfs_agnumber_t agno = bs->cur->bc_private.a.agno; xfs_agnumber_t agno = bs->cur->bc_ag.agno;
xfs_agblock_t bno; xfs_agblock_t bno;
xfs_extlen_t len; xfs_extlen_t len;
xfs_nlink_t refcount; xfs_nlink_t refcount;
......
...@@ -92,7 +92,7 @@ xchk_rmapbt_rec( ...@@ -92,7 +92,7 @@ xchk_rmapbt_rec(
{ {
struct xfs_mount *mp = bs->cur->bc_mp; struct xfs_mount *mp = bs->cur->bc_mp;
struct xfs_rmap_irec irec; struct xfs_rmap_irec irec;
xfs_agnumber_t agno = bs->cur->bc_private.a.agno; xfs_agnumber_t agno = bs->cur->bc_ag.agno;
bool non_inode; bool non_inode;
bool is_unwritten; bool is_unwritten;
bool is_bmbt; bool is_bmbt;
......
...@@ -26,7 +26,7 @@ xchk_btree_cur_fsbno( ...@@ -26,7 +26,7 @@ xchk_btree_cur_fsbno(
cur->bc_flags & XFS_BTREE_LONG_PTRS) cur->bc_flags & XFS_BTREE_LONG_PTRS)
return XFS_INO_TO_FSB(cur->bc_mp, cur->bc_private.b.ip->i_ino); return XFS_INO_TO_FSB(cur->bc_mp, cur->bc_private.b.ip->i_ino);
else if (!(cur->bc_flags & XFS_BTREE_LONG_PTRS)) else if (!(cur->bc_flags & XFS_BTREE_LONG_PTRS))
return XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno, 0); return XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_ag.agno, 0);
return NULLFSBLOCK; return NULLFSBLOCK;
} }
......
...@@ -344,7 +344,7 @@ xfs_getfsmap_datadev_helper( ...@@ -344,7 +344,7 @@ xfs_getfsmap_datadev_helper(
xfs_fsblock_t fsb; xfs_fsblock_t fsb;
xfs_daddr_t rec_daddr; xfs_daddr_t rec_daddr;
fsb = XFS_AGB_TO_FSB(mp, cur->bc_private.a.agno, rec->rm_startblock); fsb = XFS_AGB_TO_FSB(mp, cur->bc_ag.agno, rec->rm_startblock);
rec_daddr = XFS_FSB_TO_DADDR(mp, fsb); rec_daddr = XFS_FSB_TO_DADDR(mp, fsb);
return xfs_getfsmap_helper(cur->bc_tp, info, rec, rec_daddr); return xfs_getfsmap_helper(cur->bc_tp, info, rec, rec_daddr);
...@@ -362,7 +362,7 @@ xfs_getfsmap_datadev_bnobt_helper( ...@@ -362,7 +362,7 @@ xfs_getfsmap_datadev_bnobt_helper(
struct xfs_rmap_irec irec; struct xfs_rmap_irec irec;
xfs_daddr_t rec_daddr; xfs_daddr_t rec_daddr;
rec_daddr = XFS_AGB_TO_DADDR(mp, cur->bc_private.a.agno, rec_daddr = XFS_AGB_TO_DADDR(mp, cur->bc_ag.agno,
rec->ar_startblock); rec->ar_startblock);
irec.rm_startblock = rec->ar_startblock; irec.rm_startblock = rec->ar_startblock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment