aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_reflink.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-08-01 10:20:32 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2018-08-03 02:05:14 -0400
commita8198666fb755e129c2fe92819774256ec26c79c (patch)
tree4eb28b2dcb562575ba2aa825110b259cdf6d44c3 /fs/xfs/xfs_reflink.c
parent82ff27bc52a88cb5cc400bfa64e210d3ec8dfebd (diff)
xfs: automatic dfops inode relogging
Inodes that are held across deferred operations are explicitly joined to the dfops structure to ensure appropriate relogging. While inodes are currently joined explicitly, we can detect the conditions that require relogging at dfops finish time by inspecting the transaction item list for inodes with ili_lock_flags == 0. Replace the xfs_defer_ijoin() infrastructure with such detection and automatic relogging of held inodes. This eliminates the need for the per-dfops inode list, replaced by an on-stack variant in xfs_defer_trans_roll(). 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>
Diffstat (limited to 'fs/xfs/xfs_reflink.c')
-rw-r--r--fs/xfs/xfs_reflink.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index e986fcf928e5..dce8ba8ab681 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -435,7 +435,6 @@ retry:
435 xfs_inode_set_cowblocks_tag(ip); 435 xfs_inode_set_cowblocks_tag(ip);
436 436
437 /* Finish up. */ 437 /* Finish up. */
438 xfs_defer_ijoin(tp->t_dfops, ip);
439 error = xfs_trans_commit(tp); 438 error = xfs_trans_commit(tp);
440 if (error) 439 if (error)
441 return error; 440 return error;
@@ -518,7 +517,6 @@ xfs_reflink_cancel_cow_blocks(
518 NULL); 517 NULL);
519 518
520 /* Roll the transaction */ 519 /* Roll the transaction */
521 xfs_defer_ijoin((*tpp)->t_dfops, ip);
522 error = xfs_defer_finish(tpp); 520 error = xfs_defer_finish(tpp);
523 if (error) { 521 if (error) {
524 xfs_defer_cancel(*tpp); 522 xfs_defer_cancel(*tpp);
@@ -716,7 +714,6 @@ xfs_reflink_end_cow(
716 /* Remove the mapping from the CoW fork. */ 714 /* Remove the mapping from the CoW fork. */
717 xfs_bmap_del_extent_cow(ip, &icur, &got, &del); 715 xfs_bmap_del_extent_cow(ip, &icur, &got, &del);
718 716
719 xfs_defer_ijoin(tp->t_dfops, ip);
720 error = xfs_defer_finish(&tp); 717 error = xfs_defer_finish(&tp);
721 if (error) 718 if (error)
722 goto out_cancel; 719 goto out_cancel;
@@ -1077,7 +1074,6 @@ xfs_reflink_remap_extent(
1077 1074
1078next_extent: 1075next_extent:
1079 /* Process all the deferred stuff. */ 1076 /* Process all the deferred stuff. */
1080 xfs_defer_ijoin(tp->t_dfops, ip);
1081 error = xfs_defer_finish(&tp); 1077 error = xfs_defer_finish(&tp);
1082 if (error) 1078 if (error)
1083 goto out_cancel; 1079 goto out_cancel;