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>
This commit is contained in:
Brian Foster 2018-08-01 07:20:32 -07:00 committed by Darrick J. Wong
parent 82ff27bc52
commit a8198666fb
11 changed files with 21 additions and 75 deletions

View file

@ -435,7 +435,6 @@ retry:
xfs_inode_set_cowblocks_tag(ip);
/* Finish up. */
xfs_defer_ijoin(tp->t_dfops, ip);
error = xfs_trans_commit(tp);
if (error)
return error;
@ -518,7 +517,6 @@ xfs_reflink_cancel_cow_blocks(
NULL);
/* Roll the transaction */
xfs_defer_ijoin((*tpp)->t_dfops, ip);
error = xfs_defer_finish(tpp);
if (error) {
xfs_defer_cancel(*tpp);
@ -716,7 +714,6 @@ xfs_reflink_end_cow(
/* Remove the mapping from the CoW fork. */
xfs_bmap_del_extent_cow(ip, &icur, &got, &del);
xfs_defer_ijoin(tp->t_dfops, ip);
error = xfs_defer_finish(&tp);
if (error)
goto out_cancel;
@ -1077,7 +1074,6 @@ xfs_reflink_remap_extent(
next_extent:
/* Process all the deferred stuff. */
xfs_defer_ijoin(tp->t_dfops, ip);
error = xfs_defer_finish(&tp);
if (error)
goto out_cancel;