summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-11-03 15:17:42 -0400
committerChris Mason <chris.mason@oracle.com>2011-11-06 03:04:15 -0500
commitaf31f5e5b84b5bf2bcec464153a5130b170b2770 (patch)
treef8f5d8f18a115431e8826fa1c46580311dc1e485 /fs/btrfs/super.c
parent6c41761fc6efe1503103a1afe03a6635c0b5d4ec (diff)
Btrfs: add a log of past tree roots
This takes some of the free space in the btrfs super block to record information about most of the roots in the last four commits. It also adds a -o recovery to use the root history log when we're not able to read the tree of tree roots, the extent tree root, the device tree root or the csum root. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index f7e9de724ef2..57080dffdfc6 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -164,7 +164,7 @@ enum {
164 Opt_notreelog, Opt_ratio, Opt_flushoncommit, Opt_discard, 164 Opt_notreelog, Opt_ratio, Opt_flushoncommit, Opt_discard,
165 Opt_space_cache, Opt_clear_cache, Opt_user_subvol_rm_allowed, 165 Opt_space_cache, Opt_clear_cache, Opt_user_subvol_rm_allowed,
166 Opt_enospc_debug, Opt_subvolrootid, Opt_defrag, 166 Opt_enospc_debug, Opt_subvolrootid, Opt_defrag,
167 Opt_inode_cache, Opt_no_space_cache, Opt_err, 167 Opt_inode_cache, Opt_no_space_cache, Opt_recovery, Opt_err,
168}; 168};
169 169
170static match_table_t tokens = { 170static match_table_t tokens = {
@@ -198,6 +198,7 @@ static match_table_t tokens = {
198 {Opt_defrag, "autodefrag"}, 198 {Opt_defrag, "autodefrag"},
199 {Opt_inode_cache, "inode_cache"}, 199 {Opt_inode_cache, "inode_cache"},
200 {Opt_no_space_cache, "no_space_cache"}, 200 {Opt_no_space_cache, "no_space_cache"},
201 {Opt_recovery, "recovery"},
201 {Opt_err, NULL}, 202 {Opt_err, NULL},
202}; 203};
203 204
@@ -392,6 +393,10 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
392 printk(KERN_INFO "btrfs: enabling auto defrag"); 393 printk(KERN_INFO "btrfs: enabling auto defrag");
393 btrfs_set_opt(info->mount_opt, AUTO_DEFRAG); 394 btrfs_set_opt(info->mount_opt, AUTO_DEFRAG);
394 break; 395 break;
396 case Opt_recovery:
397 printk(KERN_INFO "btrfs: enabling auto recovery");
398 btrfs_set_opt(info->mount_opt, RECOVERY);
399 break;
395 case Opt_err: 400 case Opt_err:
396 printk(KERN_INFO "btrfs: unrecognized mount option " 401 printk(KERN_INFO "btrfs: unrecognized mount option "
397 "'%s'\n", p); 402 "'%s'\n", p);