• Boris Burkov's avatar
    btrfs: use superblock state to print space_cache mount option · 04c41559
    Boris Burkov authored
    
    
    To make the contents of /proc/mounts better match the actual state of
    the filesystem, base the display of the space cache mount options off
    the contents of the super block rather than the last mount options
    passed in. Since there are many scenarios where the mount will ignore a
    space cache option, simply showing the passed in option is misleading.
    
    For example, if we mount with -o remount,space_cache=v2 on a read-write
    file system without an existing free space tree, we won't build a free
    space tree, but /proc/mounts will read space_cache=v2 (until we mount
    again and it goes away)
    
    cache_generation is set iff space_cache=v1, FREE_SPACE_TREE is set iff
    space_cache=v2, and if neither is the case, we print nospace_cache.
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarBoris Burkov <boris@bur.io>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    04c41559
super.c 70 KB