diff options
author | Brian Foster <bfoster@redhat.com> | 2018-07-24 22:43:14 +0200 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-07-26 19:15:15 +0200 |
commit | d5cca7eb244d276177a57e42494d479742bbba37 (patch) | |
tree | b4d16a1a806530db2a67d47efa88f65a3557273c /fs/xfs/libxfs/xfs_attr.c | |
parent | xfs: remove all boilerplate defer init/finish code (diff) | |
download | linux-d5cca7eb244d276177a57e42494d479742bbba37.tar.xz linux-d5cca7eb244d276177a57e42494d479742bbba37.zip |
xfs: remove unnecessary dfops init calls in xattr code
Each xfs_defer_init() call in the xattr code uses the internal dfops
reference. In addition, a successful xfs_defer_finish() always
returns with a reset xfs_defer_ops structure.
Given that along with the fact that every xfs_defer_init() call in
the xattr code is followed up by an xfs_defer_finish(), the former
calls are no longer necessary and can be removed.
Note that the xfs_defer_init() call in the remote value copy loop of
xfs_attr_rmtval_set() is not followed by a finish, but the dfops is
unused in this instance.
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>
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_attr.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index 66a22c80a0db..3e98f0af389c 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -587,7 +587,6 @@ xfs_attr_leaf_addname( * Commit that transaction so that the node_addname() call * can manage its own transactions. */ - xfs_defer_init(args->trans, args->trans->t_dfops); error = xfs_attr3_leaf_to_node(args); if (error) goto out_defer_cancel; @@ -676,7 +675,6 @@ xfs_attr_leaf_addname( * If the result is small enough, shrink it all into the inode. */ if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) { - xfs_defer_init(args->trans, args->trans->t_dfops); error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); /* bp is gone due to xfs_da_shrink_inode */ if (error) @@ -741,7 +739,6 @@ xfs_attr_leaf_removename( * If the result is small enough, shrink it all into the inode. */ if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) { - xfs_defer_init(args->trans, args->trans->t_dfops); error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); /* bp is gone due to xfs_da_shrink_inode */ if (error) @@ -870,7 +867,6 @@ restart: */ xfs_da_state_free(state); state = NULL; - xfs_defer_init(args->trans, args->trans->t_dfops); error = xfs_attr3_leaf_to_node(args); if (error) goto out_defer_cancel; @@ -897,7 +893,6 @@ restart: * in the index/blkno/rmtblkno/rmtblkcnt fields and * in the index2/blkno2/rmtblkno2/rmtblkcnt2 fields. */ - xfs_defer_init(args->trans, args->trans->t_dfops); error = xfs_da3_split(state); if (error) goto out_defer_cancel; @@ -995,7 +990,6 @@ restart: * Check to see if the tree needs to be collapsed. */ if (retval && (state->path.active > 1)) { - xfs_defer_init(args->trans, args->trans->t_dfops); error = xfs_da3_join(state); if (error) goto out_defer_cancel; @@ -1120,7 +1114,6 @@ xfs_attr_node_removename( * Check to see if the tree needs to be collapsed. */ if (retval && (state->path.active > 1)) { - xfs_defer_init(args->trans, args->trans->t_dfops); error = xfs_da3_join(state); if (error) goto out_defer_cancel; @@ -1152,7 +1145,6 @@ xfs_attr_node_removename( goto out; if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) { - xfs_defer_init(args->trans, args->trans->t_dfops); error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); /* bp is gone due to xfs_da_shrink_inode */ if (error) |