aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_bmap.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/libxfs/xfs_bmap.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/libxfs/xfs_bmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 71687d805f79..5cd490dc891a 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -1119,7 +1119,6 @@ xfs_bmap_add_attrfork(
1119 xfs_log_sb(tp); 1119 xfs_log_sb(tp);
1120 } 1120 }
1121 1121
1122 xfs_defer_ijoin(tp->t_dfops, ip);
1123 error = xfs_trans_commit(tp); 1122 error = xfs_trans_commit(tp);
1124 xfs_iunlock(ip, XFS_ILOCK_EXCL); 1123 xfs_iunlock(ip, XFS_ILOCK_EXCL);
1125 return error; 1124 return error;
@@ -5987,7 +5986,6 @@ __xfs_bmap_add(
5987 int whichfork, 5986 int whichfork,
5988 struct xfs_bmbt_irec *bmap) 5987 struct xfs_bmbt_irec *bmap)
5989{ 5988{
5990 int error;
5991 struct xfs_bmap_intent *bi; 5989 struct xfs_bmap_intent *bi;
5992 5990
5993 trace_xfs_bmap_defer(mp, 5991 trace_xfs_bmap_defer(mp,
@@ -6006,12 +6004,6 @@ __xfs_bmap_add(
6006 bi->bi_whichfork = whichfork; 6004 bi->bi_whichfork = whichfork;
6007 bi->bi_bmap = *bmap; 6005 bi->bi_bmap = *bmap;
6008 6006
6009 error = xfs_defer_ijoin(dfops, bi->bi_owner);
6010 if (error) {
6011 kmem_free(bi);
6012 return error;
6013 }
6014
6015 xfs_defer_add(dfops, XFS_DEFER_OPS_TYPE_BMAP, &bi->bi_list); 6007 xfs_defer_add(dfops, XFS_DEFER_OPS_TYPE_BMAP, &bi->bi_list);
6016 return 0; 6008 return 0;
6017} 6009}