]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: replace xfs_defer_ops ->dop_pending with on-stack list
authorBrian Foster <bfoster@redhat.com>
Fri, 5 Oct 2018 02:36:12 +0000 (21:36 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 5 Oct 2018 02:36:12 +0000 (21:36 -0500)
commit3e1da129d241d09384bcae48c565f7b871b91cd3
treea33fb4f7ea92d3bc0f2f7e462ae426f9c472a353
parent9f5a828b5a4b3baf37196d18606429fdb233e8a7
xfs: replace xfs_defer_ops ->dop_pending with on-stack list

Source kernel commit: 1ae093cbea3d1ef04e1344b9e3996a9e1763a91b

The xfs_defer_ops ->dop_pending list is used to track active
deferred operations once intents are logged. These items must be
aborted in the event of an error. The list is populated as intents
are logged and items are removed as they complete (or are aborted).

Now that xfs_defer_finish() cancels on error, there is no need to
ever access ->dop_pending outside of xfs_defer_finish(). The list is
only ever populated after xfs_defer_finish() begins and is either
completed or cancelled before it returns.

Remove ->dop_pending from xfs_defer_ops and replace it with a local
list in the xfs_defer_finish() path. Pass the local list to the
various helpers now that it is not accessible via dfops. Note that
we have to check for NULL in the abort case as the final tx roll
occurs outside of the scope of the new local list (once the dfops
has completed and thus drained the list).

Signed-off-by: Brian Foster <bfoster@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>
include/xfs_trace.h
include/xfs_trans.h
libxfs/trans.c
libxfs/xfs_defer.c
libxfs/xfs_defer.h