Skip to content

Commit 2496bff

Browse files
josefbacikkdave
authored andcommitted
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: Johannes Thumshirn <[email protected]> Reviewed-by: Anand Jain <[email protected]> Acked-by: Christian Brauner <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 9ef40c2 commit 2496bff

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

fs/btrfs/disk-io.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2955,6 +2955,7 @@ void btrfs_clear_oneshot_options(struct btrfs_fs_info *fs_info)
29552955
{
29562956
btrfs_clear_opt(fs_info->mount_opt, USEBACKUPROOT);
29572957
btrfs_clear_opt(fs_info->mount_opt, CLEAR_CACHE);
2958+
btrfs_clear_opt(fs_info->mount_opt, NOSPACECACHE);
29582959
}
29592960

29602961
/*

fs/btrfs/fs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ enum {
188188
BTRFS_MOUNT_IGNOREBADROOTS = (1UL << 27),
189189
BTRFS_MOUNT_IGNOREDATACSUMS = (1UL << 28),
190190
BTRFS_MOUNT_NODISCARD = (1UL << 29),
191+
BTRFS_MOUNT_NOSPACECACHE = (1UL << 30),
191192
};
192193

193194
/*

0 commit comments

Comments
 (0)