xfs: refactor internal dfops initialization
authorBrian Foster <bfoster@redhat.com>
Wed, 1 Aug 2018 14:20:29 +0000 (07:20 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Fri, 3 Aug 2018 06:05:13 +0000 (23:05 -0700)
commit98719051e75ccf9eca18bd2b569de4ea637b4479
treef07a3069240d0330b138b3fec67cbf7b778b4f0f
parent56830d6cc114f76f656d5e65ab355b070d5a695e
xfs: refactor internal dfops initialization

The current transaction allocation code conditionally initializes
the ->t_dfops indirection pointer. Transaction commit/cancel check
the validity of the pointer to determine whether to finish/cancel
the internal dfops.

This disallows the ability to use the internal dfops list as a
temporary container (via xfs_trans_alloc_empty()). Refactor
transaction allocation to always initialize ->t_dfops and check
permanent reservation state on transaction commit/cancel.

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>
fs/xfs/xfs_trans.c