]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove xfs_alloc_arg firstblock field
authorBrian Foster <bfoster@redhat.com>
Fri, 5 Oct 2018 02:36:09 +0000 (21:36 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 5 Oct 2018 02:36:09 +0000 (21:36 -0500)
Source kernel commit: 64396ff2c25b2cd8156948a64ae0da5ff962e3f2

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: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_alloc.c
libxfs/xfs_alloc.h
libxfs/xfs_bmap.c
libxfs/xfs_bmap_btree.c
libxfs/xfs_refcount_btree.c

index da7c51d397124ade1a3de867940c1f0fddec3738..e1b2c0fbf0235ad53e221043e852b6b093d2f206 100644 (file)
@@ -2781,16 +2781,16 @@ xfs_alloc_read_agf(
  */
 int                            /* error */
 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 */
-       int             error;
-       int             flags;  /* XFS_ALLOC_FLAG_... locking flags */
-       xfs_mount_t     *mp;    /* mount structure pointer */
-       xfs_agnumber_t  sagno;  /* starting allocation group number */
-       xfs_alloctype_t type;   /* input allocation type */
-       int             bump_rotor = 0;
-       xfs_agnumber_t  rotorstep = xfs_rotorstep; /* inode32 agf stepper */
+       xfs_agblock_t           agsize; /* allocation group size */
+       int                     error;
+       int                     flags;  /* XFS_ALLOC_FLAG_... locking flags */
+       struct xfs_mount        *mp;    /* mount structure pointer */
+       xfs_agnumber_t          sagno;  /* starting allocation group number */
+       xfs_alloctype_t         type;   /* input allocation type */
+       int                     bump_rotor = 0;
+       xfs_agnumber_t          rotorstep = xfs_rotorstep; /* inode32 agf stepper */
 
        mp = args->mp;
        type = args->otype = args->type;
@@ -2911,7 +2911,7 @@ xfs_alloc_vextent(
                        * locking of AGF, which might cause deadlock.
                        */
                        if (++(args->agno) == mp->m_sb.sb_agcount) {
-                               if (args->firstblock != NULLFSBLOCK)
+                               if (args->tp->t_firstblock != NULLFSBLOCK)
                                        args->agno = sagno;
                                else
                                        args->agno = 0;
index e716c993ac4c5b6a52d9f42ea6fa5459bd796a20..00cd5ec4cb6b0424c23205b00e21539fb156c777 100644 (file)
@@ -74,7 +74,6 @@ typedef struct xfs_alloc_arg {
        int             datatype;       /* mask defining data type treatment */
        char            wasdel;         /* set if allocation was prev delayed */
        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 */
        enum xfs_ag_resv_type   resv;   /* block reservation to use */
 } xfs_alloc_arg_t;
index 2c0eb94ea0fbbec00b69f6ba8c30a7e9658cdac7..2934c54de551208cbf93b5812825291cf9dcb5fc 100644 (file)
@@ -688,7 +688,6 @@ xfs_bmap_extents_to_btree(
        args.tp = tp;
        args.mp = mp;
        xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, whichfork);
-       args.firstblock = tp->t_firstblock;
        if (tp->t_firstblock == NULLFSBLOCK) {
                args.type = XFS_ALLOCTYPE_START_BNO;
                args.fsbno = XFS_INO_TO_FSB(mp, ip->i_ino);
@@ -836,7 +835,6 @@ xfs_bmap_local_to_extents(
        args.tp = tp;
        args.mp = ip->i_mount;
        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
         * file currently fits in an inode.
@@ -3436,7 +3434,6 @@ xfs_bmap_btalloc(
 
        /* Trim the allocation back to the maximum an AG can fit. */
        args.maxlen = min(ap->length, mp->m_ag_max_usable);
-       args.firstblock = ap->tp->t_firstblock;
        blen = 0;
        if (nullfb) {
                /*
index 5b9d547b4cf7f9732f81ee2a6e5fa80a6abf6ea8..626341ec46dc5ea04f6b881149a21de2b67a0174 100644 (file)
@@ -205,7 +205,6 @@ xfs_bmbt_alloc_block(
        args.tp = cur->bc_tp;
        args.mp = cur->bc_mp;
        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,
                        cur->bc_private.b.whichfork);
 
index 0f998e2e841ba70605a2e418187c69b7e7cc0c4c..04eb0232c5cbfc586a435aee971a65a568dc7961 100644 (file)
@@ -69,7 +69,6 @@ xfs_refcountbt_alloc_block(
        args.type = XFS_ALLOCTYPE_NEAR_BNO;
        args.fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno,
                        xfs_refc_block(args.mp));
-       args.firstblock = args.fsbno;
        xfs_rmap_ag_owner(&args.oinfo, XFS_RMAP_OWN_REFC);
        args.minlen = args.maxlen = args.prod = 1;
        args.resv = XFS_AG_RESV_METADATA;