]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove xfs_trans_get_block_res
authorChristoph Hellwig <hch@lst.de>
Tue, 21 Jun 2016 05:56:21 +0000 (15:56 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 21 Jun 2016 05:56:21 +0000 (15:56 +1000)
Source kernel commit a7e5d03ba8882aa772c691f16690fe7e73cee257

Just use the t_blk_res field directly instead of obsfucating the reference
by a macro.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/xfs_trans.h
libxfs/xfs_bmap.c
libxfs/xfs_bmap_btree.c

index 5467c7f1187394e5e7a7d48d9957e2da56150287..0c7a90adc8194f1f5e9ef6798690ed15b67f0e08 100644 (file)
@@ -74,6 +74,7 @@ typedef struct xfs_trans {
        unsigned int    t_type;                 /* transaction type */
        unsigned int    t_log_res;              /* amt of log space resvd */
        unsigned int    t_log_count;            /* count for perm log res */
+       unsigned int    t_blk_res;              /* # of blocks resvd */
        struct xfs_mount *t_mountp;             /* ptr to fs mount struct */
        unsigned int    t_flags;                /* misc flags */
        long            t_icount_delta;         /* superblock icount change */
index 40286e4bc7109973b39bc0275a416e1f84ef7fd5..c513e45680a06d9650f8fa18c5a355aad06eab3d 100644 (file)
@@ -5202,7 +5202,7 @@ xfs_bunmapi(
                         * This is better than zeroing it.
                         */
                        ASSERT(del.br_state == XFS_EXT_NORM);
-                       ASSERT(xfs_trans_get_block_res(tp) > 0);
+                       ASSERT(tp->t_blk_res > 0);
                        /*
                         * If this spans a realtime extent boundary,
                         * chop it back to the start of the one we end at.
@@ -5233,7 +5233,7 @@ xfs_bunmapi(
                                del.br_startblock += mod;
                        } else if ((del.br_startoff == start &&
                                    (del.br_state == XFS_EXT_UNWRITTEN ||
-                                    xfs_trans_get_block_res(tp) == 0)) ||
+                                    tp->t_blk_res == 0)) ||
                                   !xfs_sb_version_hasextflgbit(&mp->m_sb)) {
                                /*
                                 * Can't make it unwritten.  There isn't
@@ -5324,7 +5324,7 @@ xfs_bunmapi(
                 * conversion to btree format, since the transaction
                 * will be dirty.
                 */
-               if (!wasdel && xfs_trans_get_block_res(tp) == 0 &&
+               if (!wasdel && tp->t_blk_res == 0 &&
                    XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS &&
                    XFS_IFORK_NEXTENTS(ip, whichfork) >= /* Note the >= */
                        XFS_IFORK_MAXEXT(ip, whichfork) &&
index a63379bfac2990918d0e89a9675f150bd0ef5529..022d4b653d6a2bc041d821434215dd7919a19148 100644 (file)
@@ -458,7 +458,7 @@ xfs_bmbt_alloc_block(
                 * reservation amount is insufficient then we may fail a
                 * block allocation here and corrupt the filesystem.
                 */
-               args.minleft = xfs_trans_get_block_res(args.tp);
+               args.minleft = args.tp->t_blk_res;
        } else if (cur->bc_private.b.flist->xbf_low) {
                args.type = XFS_ALLOCTYPE_START_BNO;
        } else {
@@ -467,7 +467,7 @@ xfs_bmbt_alloc_block(
 
        args.minlen = args.maxlen = args.prod = 1;
        args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL;
-       if (!args.wasdel && xfs_trans_get_block_res(args.tp) == 0) {
+       if (!args.wasdel && args.tp->t_blk_res == 0) {
                error = -ENOSPC;
                goto error0;
        }