linux/fs/xfs/libxfs
Brian Foster 2c845f5a5f xfs: track collapse via file offset rather than extent index
The collapse range implementation uses a transaction per extent shift.
The progress of the overall operation is tracked via the current extent
index of the in-core extent list. This is racy because the ilock must be
dropped and reacquired for each transaction according to locking and log
reservation rules. Therefore, writeback to prior regions of the file is
possible and can change the extent count. This changes the extent to
which the current index refers and causes the collapse to fail mid
operation. To avoid this problem, the entire file is currently written
back before the collapse operation starts.

To eliminate the need to flush the entire file, use the file offset
(fsb) to track the progress of the overall extent shift operation rather
than the extent index. Modify xfs_bmap_shift_extents() to
unconditionally convert the start_fsb parameter to an extent index and
return the file offset of the extent where the shift left off, if
further extents exist. The bulk of ths function can remain based on
extent index as ilock is held by the caller. xfs_collapse_file_space()
now uses the fsb output as the starting point for the subsequent shift.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-09-23 15:37:09 +10:00
..
xfs_ag.h
xfs_alloc_btree.c
xfs_alloc_btree.h
xfs_alloc.c
xfs_alloc.h
xfs_attr_leaf.c
xfs_attr_leaf.h
xfs_attr_remote.c
xfs_attr_remote.h
xfs_attr_sf.h
xfs_attr.c
xfs_bit.h
xfs_bmap_btree.c xfs: require 64-bit sector_t 2014-07-30 09:12:05 +10:00
xfs_bmap_btree.h
xfs_bmap.c xfs: track collapse via file offset rather than extent index 2014-09-23 15:37:09 +10:00
xfs_bmap.h xfs: track collapse via file offset rather than extent index 2014-09-23 15:37:09 +10:00
xfs_btree.c Merge branch 'xfs-misc-fixes-3.17-1' into for-next 2014-08-04 13:54:14 +10:00
xfs_btree.h xfs: require 64-bit sector_t 2014-07-30 09:12:05 +10:00
xfs_cksum.h
xfs_da_btree.c xfs: require 64-bit sector_t 2014-07-30 09:12:05 +10:00
xfs_da_btree.h
xfs_da_format.c
xfs_da_format.h
xfs_dinode.h
xfs_dir2_block.c
xfs_dir2_data.c
xfs_dir2_leaf.c
xfs_dir2_node.c
xfs_dir2_priv.h
xfs_dir2_sf.c xfs: require 64-bit sector_t 2014-07-30 09:12:05 +10:00
xfs_dir2.c
xfs_dir2.h
xfs_dquot_buf.c
xfs_format.h xfs: require 64-bit sector_t 2014-07-30 09:12:05 +10:00
xfs_ialloc_btree.c
xfs_ialloc_btree.h
xfs_ialloc.c
xfs_ialloc.h
xfs_inode_buf.c
xfs_inode_buf.h
xfs_inode_fork.c xfs: require 64-bit sector_t 2014-07-30 09:12:05 +10:00
xfs_inode_fork.h
xfs_inum.h xfs: require 64-bit sector_t 2014-07-30 09:12:05 +10:00
xfs_log_format.h xfs: require 64-bit sector_t 2014-07-30 09:12:05 +10:00
xfs_log_recover.h
xfs_log_rlimit.c
xfs_quota_defs.h
xfs_rtbitmap.c
xfs_sb.c Merge branch 'xfs-misc-fixes-3.17-2' into for-next 2014-08-04 13:55:27 +10:00
xfs_sb.h xfs: require 64-bit sector_t 2014-07-30 09:12:05 +10:00
xfs_shared.h
xfs_symlink_remote.c
xfs_trans_resv.c
xfs_trans_resv.h
xfs_trans_space.h