[Top] [All Lists]

[PATCH 4/4] xfs: remove file writeback and eofblocks trim from collapse

To: xfs@xxxxxxxxxxx
Subject: [PATCH 4/4] xfs: remove file writeback and eofblocks trim from collapse range
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Fri, 29 Aug 2014 16:29:38 -0400
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1409344178-44817-1-git-send-email-bfoster@xxxxxxxxxx>
References: <1409344178-44817-1-git-send-email-bfoster@xxxxxxxxxx>
The full writeback and eofblocks trim operations executed prior to
collapse range are temporary hacks to avoid problems in the extent shift
implementation. The writeback prevents the in-core extent count from
changing due to extent conversions in parts of the file prior to the
collapse target. The eofblocks trim prevents collapse failure due to
attempts to look up delalloc extents on disk for bmapbt mappings.

The full writeback is no longer necessary because the extent shift is
now file offset based. Each time the ilock is dropped and reacquired, we
look up the current extent index based on the file offset where the
previous shift left off. The eofblocks trim is no longer required
because the extent shift mechanism knows how to shift delalloc extents.

Remove the writeback and eofblocks trim from xfs_collapse_file_space().

Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
 fs/xfs/xfs_bmap_util.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 1e96d77..c9d16bd 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1470,26 +1470,6 @@ xfs_collapse_file_space(
        next_fsb = XFS_B_TO_FSB(mp, offset + len);
        shift_fsb = XFS_B_TO_FSB(mp, len);
-       /*
-        * Writeback the entire file and force remove any post-eof blocks. The
-        * writeback prevents changes to the extent list via concurrent
-        * writeback and the eofblocks trim prevents the extent shift algorithm
-        * from running into a post-eof delalloc extent.
-        *
-        * XXX: This is a temporary fix until the extent shift loop below is
-        * converted to use offsets and lookups within the ILOCK rather than
-        * carrying around the index into the extent list for the next
-        * iteration.
-        */
-       error = filemap_write_and_wait(VFS_I(ip)->i_mapping);
-       if (error)
-               return error;
-       if (xfs_can_free_eofblocks(ip, true)) {
-               error = xfs_free_eofblocks(mp, ip, false);
-               if (error)
-                       return error;
-       }
        error = xfs_free_file_space(ip, offset, len);
        if (error)
                return error;

<Prev in Thread] Current Thread [Next in Thread>