]> git.ipfire.org Git - people/ms/linux.git/commit - fs/xfs/xfs_extfree_item.c
xfs: port the defer ops capture and continue to resource capture
authorDarrick J. Wong <djwong@kernel.org>
Fri, 17 Sep 2021 00:28:07 +0000 (17:28 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 14 Oct 2021 16:19:31 +0000 (09:19 -0700)
commit512edfac85d243ed6a5a5f42f513ebb7c2d32863
tree92ceb8ce47c29eeb9abd9255a623042aa2cac0e8
parentc5db9f937b2971c78d6c6bbaa61a6450efa8b845
xfs: port the defer ops capture and continue to resource capture

When log recovery tries to recover a transaction that had log intent
items attached to it, it has to save certain parts of the transaction
state (reservation, dfops chain, inodes with no automatic unlock) so
that it can finish single-stepping the recovered transactions before
finishing the chains.

This is done with the xfs_defer_ops_capture and xfs_defer_ops_continue
functions.  Right now they open-code this functionality, so let's port
this to the formalized resource capture structure that we introduced in
the previous patch.  This enables us to hold up to two inodes and two
buffers during log recovery, the same way we do for regular runtime.

With this patch applied, we'll be ready to support atomic extent swap
which holds two inodes; and logged xattrs which holds one inode and one
xattr leaf buffer.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
fs/xfs/libxfs/xfs_defer.c
fs/xfs/libxfs/xfs_defer.h
fs/xfs/xfs_bmap_item.c
fs/xfs/xfs_extfree_item.c
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_refcount_item.c
fs/xfs/xfs_rmap_item.c