summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap_util.c
diff options
context:
space:
mode:
authorBrian Foster2018-07-24 22:43:07 +0200
committerDarrick J. Wong2018-07-26 19:15:12 +0200
commit02dff7bf81685b6770a082243060e0b5aac348cf (patch)
treeff388c2693bcf870418f1b3941c0bf38c98928cf /fs/xfs/xfs_bmap_util.c
parentxfs: force summary counter recalc at next mount (diff)
downloadkernel-qcow2-linux-02dff7bf81685b6770a082243060e0b5aac348cf.tar.gz
kernel-qcow2-linux-02dff7bf81685b6770a082243060e0b5aac348cf.tar.xz
kernel-qcow2-linux-02dff7bf81685b6770a082243060e0b5aac348cf.zip
xfs: pull up dfops from xfs_itruncate_extents()
xfs_itruncate_extents[_flags]() uses a local dfops with a transaction provided by the caller. It uses hacky ->t_dfops replacement logic to avoid stomping over an already populated ->t_dfops. The latter never occurs for current callers and the logic itself is not really appropriate. Clean this up by updating all callers to initialize a dfops and to use that down in xfs_itruncate_extents(). This more closely resembles the upcoming logic where dfops will be embedded within the transaction. We can also replace the xfs_defer_init() in the xfs_itruncate_extents_flags() loop with an assert. Both dfops and firstblock should be in a valid state after xfs_defer_finish() and the inode joined to the dfops is fixed throughout the loop. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bill O'Donnell <billodo@redhat.com> 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_bmap_util.c')
-rw-r--r--fs/xfs/xfs_bmap_util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 1b78c20de7bd..1a4617c74c6a 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -792,6 +792,7 @@ xfs_free_eofblocks(
int nimaps;
struct xfs_bmbt_irec imap;
struct xfs_mount *mp = ip->i_mount;
+ struct xfs_defer_ops dfops;
/*
* Figure out if there are any blocks beyond the end
@@ -831,6 +832,7 @@ xfs_free_eofblocks(
ASSERT(XFS_FORCED_SHUTDOWN(mp));
return error;
}
+ xfs_defer_init(tp, &dfops);
xfs_ilock(ip, XFS_ILOCK_EXCL);
xfs_trans_ijoin(tp, ip, 0);