Commit 64396ff2 authored by Brian Foster's avatar Brian Foster Committed by Darrick J. Wong

xfs: remove xfs_alloc_arg firstblock field

The xfs_alloc_arg.firstblock field is used to control the starting
agno for an allocation. The structure already carries a pointer to
the transaction, which carries the current firstblock value.

Remove the field and access ->t_firstblock directly in the
allocation code.
Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent cf612de7
...@@ -2783,12 +2783,12 @@ xfs_alloc_read_agf( ...@@ -2783,12 +2783,12 @@ xfs_alloc_read_agf(
*/ */
int /* error */ int /* error */
xfs_alloc_vextent( xfs_alloc_vextent(
xfs_alloc_arg_t *args) /* allocation argument structure */ struct xfs_alloc_arg *args) /* allocation argument structure */
{ {
xfs_agblock_t agsize; /* allocation group size */ xfs_agblock_t agsize; /* allocation group size */
int error; int error;
int flags; /* XFS_ALLOC_FLAG_... locking flags */ int flags; /* XFS_ALLOC_FLAG_... locking flags */
xfs_mount_t *mp; /* mount structure pointer */ struct xfs_mount *mp; /* mount structure pointer */
xfs_agnumber_t sagno; /* starting allocation group number */ xfs_agnumber_t sagno; /* starting allocation group number */
xfs_alloctype_t type; /* input allocation type */ xfs_alloctype_t type; /* input allocation type */
int bump_rotor = 0; int bump_rotor = 0;
...@@ -2913,7 +2913,7 @@ xfs_alloc_vextent( ...@@ -2913,7 +2913,7 @@ xfs_alloc_vextent(
* locking of AGF, which might cause deadlock. * locking of AGF, which might cause deadlock.
*/ */
if (++(args->agno) == mp->m_sb.sb_agcount) { if (++(args->agno) == mp->m_sb.sb_agcount) {
if (args->firstblock != NULLFSBLOCK) if (args->tp->t_firstblock != NULLFSBLOCK)
args->agno = sagno; args->agno = sagno;
else else
args->agno = 0; args->agno = 0;
......
...@@ -74,7 +74,6 @@ typedef struct xfs_alloc_arg { ...@@ -74,7 +74,6 @@ typedef struct xfs_alloc_arg {
int datatype; /* mask defining data type treatment */ int datatype; /* mask defining data type treatment */
char wasdel; /* set if allocation was prev delayed */ char wasdel; /* set if allocation was prev delayed */
char wasfromfl; /* set if allocation is from freelist */ char wasfromfl; /* set if allocation is from freelist */
xfs_fsblock_t firstblock; /* io first block allocated */
struct xfs_owner_info oinfo; /* owner of blocks being allocated */ struct xfs_owner_info oinfo; /* owner of blocks being allocated */
enum xfs_ag_resv_type resv; /* block reservation to use */ enum xfs_ag_resv_type resv; /* block reservation to use */
} xfs_alloc_arg_t; } xfs_alloc_arg_t;
......
...@@ -697,7 +697,6 @@ xfs_bmap_extents_to_btree( ...@@ -697,7 +697,6 @@ xfs_bmap_extents_to_btree(
args.tp = tp; args.tp = tp;
args.mp = mp; args.mp = mp;
xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, whichfork); xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, whichfork);
args.firstblock = tp->t_firstblock;
if (tp->t_firstblock == NULLFSBLOCK) { if (tp->t_firstblock == NULLFSBLOCK) {
args.type = XFS_ALLOCTYPE_START_BNO; args.type = XFS_ALLOCTYPE_START_BNO;
args.fsbno = XFS_INO_TO_FSB(mp, ip->i_ino); args.fsbno = XFS_INO_TO_FSB(mp, ip->i_ino);
...@@ -845,7 +844,6 @@ xfs_bmap_local_to_extents( ...@@ -845,7 +844,6 @@ xfs_bmap_local_to_extents(
args.tp = tp; args.tp = tp;
args.mp = ip->i_mount; args.mp = ip->i_mount;
xfs_rmap_ino_owner(&args.oinfo, ip->i_ino, whichfork, 0); xfs_rmap_ino_owner(&args.oinfo, ip->i_ino, whichfork, 0);
args.firstblock = tp->t_firstblock;
/* /*
* Allocate a block. We know we need only one, since the * Allocate a block. We know we need only one, since the
* file currently fits in an inode. * file currently fits in an inode.
...@@ -3445,7 +3443,6 @@ xfs_bmap_btalloc( ...@@ -3445,7 +3443,6 @@ xfs_bmap_btalloc(
/* Trim the allocation back to the maximum an AG can fit. */ /* Trim the allocation back to the maximum an AG can fit. */
args.maxlen = min(ap->length, mp->m_ag_max_usable); args.maxlen = min(ap->length, mp->m_ag_max_usable);
args.firstblock = ap->tp->t_firstblock;
blen = 0; blen = 0;
if (nullfb) { if (nullfb) {
/* /*
......
...@@ -208,7 +208,6 @@ xfs_bmbt_alloc_block( ...@@ -208,7 +208,6 @@ xfs_bmbt_alloc_block(
args.tp = cur->bc_tp; args.tp = cur->bc_tp;
args.mp = cur->bc_mp; args.mp = cur->bc_mp;
args.fsbno = cur->bc_tp->t_firstblock; args.fsbno = cur->bc_tp->t_firstblock;
args.firstblock = args.fsbno;
xfs_rmap_ino_bmbt_owner(&args.oinfo, cur->bc_private.b.ip->i_ino, xfs_rmap_ino_bmbt_owner(&args.oinfo, cur->bc_private.b.ip->i_ino,
cur->bc_private.b.whichfork); cur->bc_private.b.whichfork);
......
...@@ -70,7 +70,6 @@ xfs_refcountbt_alloc_block( ...@@ -70,7 +70,6 @@ xfs_refcountbt_alloc_block(
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_private.a.agno,
xfs_refc_block(args.mp)); xfs_refc_block(args.mp));
args.firstblock = args.fsbno;
xfs_rmap_ag_owner(&args.oinfo, XFS_RMAP_OWN_REFC); xfs_rmap_ag_owner(&args.oinfo, XFS_RMAP_OWN_REFC);
args.minlen = args.maxlen = args.prod = 1; args.minlen = args.maxlen = args.prod = 1;
args.resv = XFS_AG_RESV_METADATA; args.resv = XFS_AG_RESV_METADATA;
......
...@@ -1590,7 +1590,7 @@ DECLARE_EVENT_CLASS(xfs_alloc_class, ...@@ -1590,7 +1590,7 @@ DECLARE_EVENT_CLASS(xfs_alloc_class,
__entry->wasfromfl = args->wasfromfl; __entry->wasfromfl = args->wasfromfl;
__entry->resv = args->resv; __entry->resv = args->resv;
__entry->datatype = args->datatype; __entry->datatype = args->datatype;
__entry->firstblock = args->firstblock; __entry->firstblock = args->tp->t_firstblock;
), ),
TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u " TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
"prod %u minleft %u total %u alignment %u minalignslop %u " "prod %u minleft %u total %u alignment %u minalignslop %u "
......
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