]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: only free allocated regions of inode chunks
authorBrian Foster <bfoster@redhat.com>
Thu, 28 May 2015 23:22:52 +0000 (09:22 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 30 Jul 2015 23:13:07 +0000 (09:13 +1000)
commit7338c4b865c782aaba07f5ee0c6e56380f1467b1
treecea9ed32f233621e54e854f66a81d6143b37110c
parentfa58183cedeecc21a5576d317871a907463d9542
xfs: only free allocated regions of inode chunks

An inode chunk is currently added to the transaction free list based on
a simple fsb conversion and hardcoded chunk length. The nature of sparse
chunks is such that the physical chunk of inodes on disk may consist of
one or more discontiguous parts. Blocks that reside in the holes of the
inode chunk are not inodes and could be allocated to any other use or
not allocated at all.

Refactor the existing xfs_bmap_add_free() call into the
xfs_difree_inode_chunk() helper. The new helper uses the existing
calculation if a chunk is not sparse. Otherwise, use the inobt record
holemask to free the contiguous regions of the chunk.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/libxfs_priv.h
libxfs/xfs_ialloc.c