]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: use internal dfops in attr code
authorBrian Foster <bfoster@redhat.com>
Fri, 5 Oct 2018 02:36:10 +0000 (21:36 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 5 Oct 2018 02:36:10 +0000 (21:36 -0500)
Source kernel commit: 9c6bb0cf7ba318767107328f39aac880344ddd2e

Remove the unnecessary on-stack dfops structure and use the internal
transaction dfops instead. The lower level xattr code already
appropriately accesses ->t_dfops throughout.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Bill O'Donnell <billodo@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_attr.c

index 2cce9e386abb2bb555189ae9d060c3f17b28c83a..6ed680febf354d8d62121f04df2fcd2eedb0061d 100644 (file)
@@ -197,7 +197,6 @@ xfs_attr_set(
        struct xfs_mount        *mp = dp->i_mount;
        struct xfs_buf          *leaf_bp = NULL;
        struct xfs_da_args      args;
-       struct xfs_defer_ops    dfops;
        struct xfs_trans_res    tres;
        int                     rsvd = (flags & ATTR_ROOT) != 0;
        int                     error, err2, local;
@@ -246,7 +245,6 @@ xfs_attr_set(
                        rsvd ? XFS_TRANS_RESERVE : 0, &args.trans);
        if (error)
                return error;
-       xfs_defer_init(args.trans, &dfops);
 
        xfs_ilock(dp, XFS_ILOCK_EXCL);
        error = xfs_trans_reserve_quota_nblks(args.trans, dp, args.total, 0,
@@ -310,18 +308,18 @@ xfs_attr_set(
                 */
                error = xfs_attr_shortform_to_leaf(&args, &leaf_bp);
                if (error)
-                       goto out_defer_cancel;
+                       goto out;
                /*
                 * Prevent the leaf buffer from being unlocked so that a
                 * concurrent AIL push cannot grab the half-baked leaf
                 * buffer and run into problems with the write verifier.
                 */
                xfs_trans_bhold(args.trans, leaf_bp);
-               xfs_defer_bjoin(&dfops, leaf_bp);
-               xfs_defer_ijoin(&dfops, dp);
-               error = xfs_defer_finish(&args.trans, &dfops);
+               xfs_defer_bjoin(args.trans->t_dfops, leaf_bp);
+               xfs_defer_ijoin(args.trans->t_dfops, dp);
+               error = xfs_defer_finish(&args.trans, args.trans->t_dfops);
                if (error)
-                       goto out_defer_cancel;
+                       goto out;
 
                /*
                 * Commit the leaf transformation.  We'll need another (linked)
@@ -361,8 +359,6 @@ xfs_attr_set(
 
        return error;
 
-out_defer_cancel:
-       xfs_defer_cancel(&dfops);
 out:
        if (leaf_bp)
                xfs_trans_brelse(args.trans, leaf_bp);
@@ -384,7 +380,6 @@ xfs_attr_remove(
 {
        struct xfs_mount        *mp = dp->i_mount;
        struct xfs_da_args      args;
-       struct xfs_defer_ops    dfops;
        int                     error;
 
        XFS_STATS_INC(mp, xs_attr_remove);
@@ -417,7 +412,6 @@ xfs_attr_remove(
                        &args.trans);
        if (error)
                return error;
-       xfs_defer_init(args.trans, &dfops);
 
        xfs_ilock(dp, XFS_ILOCK_EXCL);
        /*