• B
    btrfs: remove free space items when disabling space cache v1 · 36b216c8
    Boris Burkov 提交于
    When the filesystem transitions from space cache v1 to v2 or to
    nospace_cache, it removes the old cached data, but does not remove
    the FREE_SPACE items nor the free space inodes they point to. This
    doesn't cause any issues besides being a bit inefficient, since these
    items no longer do anything useful.
    
    To fix it, when we are mounting, and plan to disable the space cache,
    destroy each block group's free space item and free space inode.
    The code to remove the items is lifted from the existing use case of
    removing the block group, with a light adaptation to handle whether or
    not we have already looked up the free space inode.
    Reviewed-by: NJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: NBoris Burkov <boris@bur.io>
    Signed-off-by: NDavid Sterba <dsterba@suse.com>
    36b216c8
free-space-cache.h 5.1 KB