linux/fs/xfs/libxfs
Brian Foster e021a2e5fc xfs: support embedded dfops in transaction
The dfops structure used by multi-transaction operations is
typically stored on the stack and carried around by the associated
transaction. The lifecycle of dfops does not quite match that of the
transaction, but they are tightly related in that the former depends
on the latter.

The relationship of these objects is tight enough that we can avoid
the cumbersome boilerplate code required in most cases to manage
them separately by just embedding an xfs_defer_ops in the
transaction itself. This means that a transaction allocation returns
with an initialized dfops, a transaction commit finishes pending
deferred items before the tx commit, a transaction cancel cancels
the dfops before the transaction and a transaction dup operation
transfers the current dfops state to the new transaction.

The dup operation is slightly complicated by the fact that we can no
longer just copy a dfops pointer from the old transaction to the new
transaction. This is solved through a dfops move helper that
transfers the pending items and other dfops state across the
transactions. This also requires that transaction rolling code
always refer to the transaction for the current dfops reference.

Finally, to facilitate incremental conversion to the internal dfops
and continue to support the current external dfops mode of
operation, create the new ->t_dfops_internal field with a layer of
indirection. On allocation, ->t_dfops points to the internal dfops.
This state is overridden by callers who re-init a local dfops on the
transaction. Once ->t_dfops is overridden, the external dfops
reference is maintained as the transaction rolls.

This patch adds the fundamental ability to support an internal
dfops. All codepaths that perform deferred processing continue to
override the internal dfops until they are converted over in
subsequent patches.

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>
2018-07-26 10:15:14 -07:00
..
xfs_ag_resv.c xfs: fix fdblocks accounting w/ RMAPBT per-AG reservation 2018-06-24 12:00:12 -07:00
xfs_ag_resv.h libxfs: Fix a couple of sparse complaintis 2018-07-17 14:25:58 -07:00
xfs_ag.c xfs: factor the ag length extension code into libxfs 2018-05-15 18:12:51 -07:00
xfs_ag.h xfs: factor the ag length extension code into libxfs 2018-05-15 18:12:51 -07:00
xfs_alloc_btree.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_alloc_btree.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_alloc.c xfs: Initialize variables in xfs_alloc_get_rec before using them 2018-07-11 22:26:36 -07:00
xfs_alloc.h xfs: remove xfs_alloc_arg firstblock field 2018-07-11 22:26:30 -07:00
xfs_attr_leaf.c xfs: check leaf attribute block freemap in verifier 2018-07-23 09:08:00 -07:00
xfs_attr_leaf.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_attr_remote.c xfs: fix transaction leak on remote attr set/remove failure 2018-07-26 10:15:12 -07:00
xfs_attr_remote.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_attr_sf.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_attr.c xfs: remove xfs_defer_init() firstblock param 2018-07-11 22:26:33 -07:00
xfs_bit.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_bit.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_bmap_btree.c xfs: trivial xfs_btree_del_cursor cleanups 2018-07-23 09:08:00 -07:00
xfs_bmap_btree.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_bmap.c xfs: trivial xfs_btree_del_cursor cleanups 2018-07-23 09:08:00 -07:00
xfs_bmap.h xfs: remove xfs_bmalloca firstblock field 2018-07-11 22:26:28 -07:00
xfs_btree.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_btree.h xfs: remove xfs_btree_cur private firstblock field 2018-07-11 22:26:29 -07:00
xfs_cksum.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xfs_da_btree.c xfs: remove xfs_bunmapi() firstblock param 2018-07-11 22:26:25 -07:00
xfs_da_btree.h xfs: use ->t_firstblock in xattr ops 2018-07-11 22:26:22 -07:00
xfs_da_format.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_da_format.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_defer.c xfs: support embedded dfops in transaction 2018-07-26 10:15:14 -07:00
xfs_defer.h xfs: support embedded dfops in transaction 2018-07-26 10:15:14 -07:00
xfs_dir2_block.c xfs: clean up MIN/MAX 2018-06-08 10:07:52 -07:00
xfs_dir2_data.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_dir2_leaf.c xfs: clean up MIN/MAX 2018-06-08 10:07:52 -07:00
xfs_dir2_node.c xfs: use swap macro in xfs_dir2_leafn_rebalance 2018-07-17 14:25:57 -07:00
xfs_dir2_priv.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_dir2_sf.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_dir2.c xfs: remove xfs_bunmapi() firstblock param 2018-07-11 22:26:25 -07:00
xfs_dir2.h xfs: remove firstblock param from xfs dir ops 2018-07-11 22:26:21 -07:00
xfs_dquot_buf.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_errortag.h xfs: force summary counter recalc at next mount 2018-07-23 09:08:01 -07:00
xfs_format.h xfs: don't allow insert-range to shift extents past the maximum offset 2018-06-24 11:56:36 -07:00
xfs_fs.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_ialloc_btree.c xfs: trivial xfs_btree_del_cursor cleanups 2018-07-23 09:08:00 -07:00
xfs_ialloc_btree.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_ialloc.c xfs: trivial xfs_btree_del_cursor cleanups 2018-07-23 09:08:00 -07:00
xfs_ialloc.h xfs: remove dfops parameter from ifree call stack 2018-07-11 22:26:07 -07:00
xfs_iext_tree.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_inode_buf.c xfs: More robust inode extent count validation 2018-06-21 23:25:57 -07:00
xfs_inode_buf.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_inode_fork.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_inode_fork.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_log_format.h xfs: refactor unmount record write 2018-07-23 09:08:01 -07:00
xfs_log_recover.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_log_rlimit.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_quota_defs.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_refcount_btree.c xfs: remove xfs_alloc_arg firstblock field 2018-07-11 22:26:30 -07:00
xfs_refcount_btree.h xfs: remove unused btree cursor bc_private.a.dfops field 2018-07-11 22:26:17 -07:00
xfs_refcount.c xfs: clean up xfs_btree_del_cursor callers 2018-07-23 09:08:00 -07:00
xfs_refcount.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_rmap_btree.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_rmap_btree.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_rmap.c xfs: trivial xfs_btree_del_cursor cleanups 2018-07-23 09:08:00 -07:00
xfs_rmap.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_rtbitmap.c xfs: fix off-by-one error in xfs_rtalloc_query_range 2018-06-24 11:56:36 -07:00
xfs_sb.c xfs: detect and fix bad summary counts at mount 2018-07-23 09:08:01 -07:00
xfs_sb.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_shared.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_symlink_remote.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trans_resv.c xfs: clean up MIN/MAX 2018-06-08 10:07:52 -07:00
xfs_trans_resv.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trans_space.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_types.c xfs: move various type verifiers to common file 2018-06-08 10:07:51 -07:00
xfs_types.h xfs: move various type verifiers to common file 2018-06-08 10:07:51 -07:00