]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: don't rely on extent indices in xfs_bmap_collapse_extents
authorChristoph Hellwig <hch@lst.de>
Thu, 19 Oct 2017 18:08:51 +0000 (11:08 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 26 Oct 2017 22:38:28 +0000 (15:38 -0700)
commit960bfc9172e2a8ec1e75db9abc8a12064a5934b1
treed6669d9f9f19c02b8c0ecc4e4a536713450d0492
parentb9dc57e4d815f1083990d1a87b6d9a370ecf69e4
xfs: don't rely on extent indices in xfs_bmap_collapse_extents

Rewrite xfs_bmap_collapse_extents so that we don't rely on extent indices
except for iterating over them.  Not being able to iterate to the next
extent is a sufficient exit condition, and we don't need to do any extent
count games given that:

  a) we already flushed all delalloc extents past our start offset
     before doing the operation
  b) xfs_iext_count() includes delalloc extents anyway

Signed-off-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>
fs/xfs/libxfs/xfs_bmap.c