summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-08-01 16:20:35 +0200
committerDarrick J. Wong <darrick.wong@oracle.com>2018-08-03 08:05:14 +0200
commit9d9e6233859706875c392707efd6d516cfb764fb (patch)
tree5d4ae3417bb8a60eb3ebaf63eaf54f9374498189 /fs/xfs/xfs_trans.c
parentxfs: always defer agfl block frees (diff)
downloadlinux-9d9e6233859706875c392707efd6d516cfb764fb.tar.xz
linux-9d9e6233859706875c392707efd6d516cfb764fb.zip
xfs: fold dfops into the transaction
struct xfs_defer_ops has now been reduced to a single list_head. The external dfops mechanism is unused and thus everywhere a (permanent) transaction is accessible the associated dfops structure is as well. Remove the xfs_defer_ops structure and fold the list_head into the transaction. Also remove the last remnant of external dfops in xfs_trans_dup(). Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_trans.c')
-rw-r--r--fs/xfs/xfs_trans.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 413e4138357f..bedc5a5133a5 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -100,6 +100,7 @@ xfs_trans_dup(
ntp->t_mountp = tp->t_mountp;
INIT_LIST_HEAD(&ntp->t_items);
INIT_LIST_HEAD(&ntp->t_busy);
+ INIT_LIST_HEAD(&ntp->t_dfops);
ntp->t_firstblock = NULLFSBLOCK;
ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
@@ -120,12 +121,8 @@ xfs_trans_dup(
tp->t_rtx_res = tp->t_rtx_res_used;
ntp->t_pflags = tp->t_pflags;
- /* copy the dfops pointer if it's external, otherwise move it */
- xfs_defer_init(ntp, &ntp->t_dfops_internal);
- if (tp->t_dfops != &tp->t_dfops_internal)
- ntp->t_dfops = tp->t_dfops;
- else
- xfs_defer_move(ntp, tp);
+ /* move deferred ops over to the new tp */
+ xfs_defer_move(ntp, tp);
xfs_trans_dup_dqinfo(tp, ntp);
@@ -280,8 +277,8 @@ xfs_trans_alloc(
tp->t_mountp = mp;
INIT_LIST_HEAD(&tp->t_items);
INIT_LIST_HEAD(&tp->t_busy);
+ INIT_LIST_HEAD(&tp->t_dfops);
tp->t_firstblock = NULLFSBLOCK;
- xfs_defer_init(tp, &tp->t_dfops_internal);
error = xfs_trans_reserve(tp, resp, blocks, rtextents);
if (error) {
@@ -929,7 +926,7 @@ __xfs_trans_commit(
* Finish deferred items on final commit. Only permanent transactions
* should ever have deferred ops.
*/
- WARN_ON_ONCE(!list_empty(&tp->t_dfops->dop_intake) &&
+ WARN_ON_ONCE(!list_empty(&tp->t_dfops) &&
!(tp->t_flags & XFS_TRANS_PERM_LOG_RES));
if (!regrant && (tp->t_flags & XFS_TRANS_PERM_LOG_RES)) {
error = xfs_defer_finish_noroll(&tp);