Commit 2496bff6 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba
Browse files

btrfs: add a NOSPACECACHE mount option flag



With the old mount API we'd pre-populate the mount options with the
space cache settings of the file system, and then the user toggled them
on or off with the mount options.  When we switch to the new mount API
the mount options will be set before we get into opening the file
system, so we need a flag to indicate that the user explicitly asked for
-o nospace_cache so we can make the appropriate changes after the fact.

Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Acked-by: default avatarChristian Brauner <brauner@kernel.org>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 9ef40c2e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2955,6 +2955,7 @@ void btrfs_clear_oneshot_options(struct btrfs_fs_info *fs_info)
{
	btrfs_clear_opt(fs_info->mount_opt, USEBACKUPROOT);
	btrfs_clear_opt(fs_info->mount_opt, CLEAR_CACHE);
	btrfs_clear_opt(fs_info->mount_opt, NOSPACECACHE);
}

/*
+1 −0
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ enum {
	BTRFS_MOUNT_IGNOREBADROOTS		= (1UL << 27),
	BTRFS_MOUNT_IGNOREDATACSUMS		= (1UL << 28),
	BTRFS_MOUNT_NODISCARD			= (1UL << 29),
	BTRFS_MOUNT_NOSPACECACHE		= (1UL << 30),
};

/*