]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: refactor shift-by-merge into xfs_bmse_merge() helper
authorBrian Foster <bfoster@redhat.com>
Tue, 23 Sep 2014 05:38:09 +0000 (15:38 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 23 Sep 2014 05:38:09 +0000 (15:38 +1000)
commit32b849bf4545eb88fc056f55a89832a7aa03373d
tree17caa0584d177b35bb57a77e559ac53d821c41c9
parent897f4b13ff55a759d46ebf2b6ac61b3ec7cb3818
xfs: refactor shift-by-merge into xfs_bmse_merge() helper

The extent shift mechanism in xfs_bmap_shift_extents() is complicated
and handles several different, non-deterministic scenarios. These
include extent shifts, extent merges and potential btree updates in
either of the former scenarios.

Refactor the code to be more linear and readable. The loop logic in
xfs_bmap_shift_extents() and some initial error checking is adjusted
slightly. The associated btree lookup and update/delete operations are
condensed into single blocks of code. This reduces the number of
btree-specific blocks and facilitates the separation of the merge
operation into a new xfs_bmse_merge() and xfs_bmse_can_merge() helpers.

This is a code refactor only. The behavior of extent shift and collapse
range is not modified.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_bmap.c