@@ -6,6 +6,7 @@
#include <linux/blkdev.h>
#include <linux/module.h>
#include <linux/fs.h>
+#include <linux/fs_parser.h>
#include <linux/pagemap.h>
#include <linux/highmem.h>
#include <linux/time.h>
@@ -370,6 +371,7 @@ enum {
Opt_check_integrity_print_mask,
Opt_enospc_debug, Opt_noenospc_debug,
#ifdef CONFIG_BTRFS_DEBUG
+ Opt_fragment,
Opt_fragment_data, Opt_fragment_metadata, Opt_fragment_all,
#endif
#ifdef CONFIG_BTRFS_FS_REF_VERIFY
@@ -458,6 +460,65 @@ static const match_table_t rescue_tokens = {
{Opt_err, NULL},
};
+static const struct fs_parameter_spec btrfs_fs_parameters[] = {
+ fsparam_flag_no("acl", Opt_acl),
+ fsparam_flag_no("autodefrag", Opt_defrag),
+ fsparam_flag_no("barrier", Opt_barrier),
+ fsparam_flag("clear_cache", Opt_clear_cache),
+ fsparam_u32("commit", Opt_commit_interval),
+ fsparam_flag("compress", Opt_compress),
+ fsparam_string("compress", Opt_compress_type),
+ fsparam_flag("compress-force", Opt_compress_force),
+ fsparam_string("compress-force", Opt_compress_force_type),
+ fsparam_flag_no("datacow", Opt_datacow),
+ fsparam_flag_no("datasum", Opt_datasum),
+ fsparam_flag("degraded", Opt_degraded),
+ fsparam_string("device", Opt_device),
+ fsparam_flag_no("discard", Opt_discard),
+ fsparam_string("discard", Opt_discard_mode),
+ fsparam_string("fatal_errors", Opt_fatal_errors),
+ fsparam_flag_no("flushoncommit", Opt_flushoncommit),
+ fsparam_flag_no("inode_cache", Opt_inode_cache),
+ fsparam_string("max_inline", Opt_max_inline),
+ fsparam_u32("metadata_ratio", Opt_ratio),
+ fsparam_flag("norecovery", Opt_norecovery),
+ fsparam_flag("rescan_uuid_tree", Opt_rescan_uuid_tree),
+ fsparam_flag("skip_balance", Opt_skip_balance),
+ fsparam_flag_no("space_cache", Opt_space_cache),
+ fsparam_string("space_cache", Opt_space_cache_version),
+ fsparam_string("subvol", Opt_subvol),
+ fsparam_u64("subvolid", Opt_subvolid),
+ fsparam_flag_no("ssd", Opt_ssd),
+ fsparam_flag_no("ssd_spread", Opt_ssd_spread),
+ fsparam_u32("thread_pool", Opt_thread_pool),
+ fsparam_flag_no("treelog", Opt_treelog),
+ fsparam_flag("user_subvol_rm_allowed", Opt_user_subvol_rm_allowed),
+
+ /* Debugging options */
+ fsparam_flag("check_int", Opt_check_integrity),
+ fsparam_flag("check_int_data", Opt_check_integrity_including_extent_data),
+ fsparam_u32("check_int_print_mask", Opt_check_integrity_print_mask),
+
+ /* Rescue options */
+ fsparam_string("rescue", Opt_rescue),
+ /* Deprecated, with alias rescue=nologreplay */
+ fsparam_flag("nologreplay", Opt_nologreplay),
+ /* Deprecated, with alias rescue=usebackuproot */
+ fsparam_flag("usebackuproot", Opt_usebackuproot),
+
+ /* Deprecated options */
+ fsparam_flag("recovery", Opt_recovery),
+ fsparam_flag_no("enospc_debug", Opt_enospc_debug),
+
+ #ifdef CONFIG_BTRFS_DEBUG
+ fsparam_string("fragment", Opt_fragment),
+ #endif
+ #ifdef CONFIG_BTRFS_FS_REF_VERIFY
+ fsparam_flag("ref_verify", Opt_ref_verify),
+ #endif
+ {}
+};
+
static int parse_rescue_options(struct btrfs_fs_info *info, const char *options)
{
char *opts;
@@ -2269,6 +2330,7 @@ static struct file_system_type btrfs_fs_type = {
.owner = THIS_MODULE,
.name = "btrfs",
.mount = btrfs_mount,
+ .parameters = btrfs_fs_parameters,
.kill_sb = btrfs_kill_super,
.fs_flags = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA,
};
@@ -2277,6 +2339,7 @@ static struct file_system_type btrfs_root_fs_type = {
.owner = THIS_MODULE,
.name = "btrfs",
.mount = btrfs_mount_root,
+ .parameters = btrfs_fs_parameters,
.kill_sb = btrfs_kill_super,
.fs_flags = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA,
};