xfs: remove XFS_BUF_TO_AGF
Just dereference bp->b_addr directly and make the code a little simpler and more clear. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:

committed by
Darrick J. Wong

parent
370c782b98
commit
9798f615ad
@@ -36,7 +36,7 @@ xfs_allocbt_set_root(
|
||||
int inc)
|
||||
{
|
||||
struct xfs_buf *agbp = cur->bc_private.a.agbp;
|
||||
struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp);
|
||||
struct xfs_agf *agf = agbp->b_addr;
|
||||
xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno);
|
||||
int btnum = cur->bc_btnum;
|
||||
struct xfs_perag *pag = xfs_perag_get(cur->bc_mp, seqno);
|
||||
@@ -87,7 +87,7 @@ xfs_allocbt_free_block(
|
||||
struct xfs_buf *bp)
|
||||
{
|
||||
struct xfs_buf *agbp = cur->bc_private.a.agbp;
|
||||
struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp);
|
||||
struct xfs_agf *agf = agbp->b_addr;
|
||||
xfs_agblock_t bno;
|
||||
int error;
|
||||
|
||||
@@ -113,7 +113,7 @@ xfs_allocbt_update_lastrec(
|
||||
int ptr,
|
||||
int reason)
|
||||
{
|
||||
struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp);
|
||||
struct xfs_agf *agf = cur->bc_private.a.agbp->b_addr;
|
||||
xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno);
|
||||
struct xfs_perag *pag;
|
||||
__be32 len;
|
||||
@@ -226,7 +226,7 @@ xfs_allocbt_init_ptr_from_cur(
|
||||
struct xfs_btree_cur *cur,
|
||||
union xfs_btree_ptr *ptr)
|
||||
{
|
||||
struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp);
|
||||
struct xfs_agf *agf = cur->bc_private.a.agbp->b_addr;
|
||||
|
||||
ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno));
|
||||
|
||||
@@ -482,7 +482,7 @@ xfs_allocbt_init_cursor(
|
||||
xfs_agnumber_t agno, /* allocation group number */
|
||||
xfs_btnum_t btnum) /* btree identifier */
|
||||
{
|
||||
struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp);
|
||||
struct xfs_agf *agf = agbp->b_addr;
|
||||
struct xfs_btree_cur *cur;
|
||||
|
||||
ASSERT(btnum == XFS_BTNUM_BNO || btnum == XFS_BTNUM_CNT);
|
||||
|
Reference in New Issue
Block a user