• Brian Foster's avatar
    xfs: only free allocated regions of inode chunks · 10ae3dc7
    Brian Foster authored
    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: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
    10ae3dc7
xfs_ialloc.c 71.5 KB