aboutsummaryrefslogtreecommitdiffstats
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)
downloadkernel_goldelico_gta04-af31f5e5b84b5bf2bcec464153a5130b170b2770.zip
kernel_goldelico_gta04-af31f5e5b84b5bf2bcec464153a5130b170b2770.tar.gz
kernel_goldelico_gta04-af31f5e5b84b5bf2bcec464153a5130b170b2770.tar.bz2
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 f7e9de7..57080df 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -164,7 +164,7 @@ enum {
Opt_notreelog, Opt_ratio, Opt_flushoncommit, Opt_discard,
Opt_space_cache, Opt_clear_cache, Opt_user_subvol_rm_allowed,
Opt_enospc_debug, Opt_subvolrootid, Opt_defrag,
- Opt_inode_cache, Opt_no_space_cache, Opt_err,
+ Opt_inode_cache, Opt_no_space_cache, Opt_recovery, Opt_err,
};
static match_table_t tokens = {
@@ -198,6 +198,7 @@ static match_table_t tokens = {
{Opt_defrag, "autodefrag"},
{Opt_inode_cache, "inode_cache"},
{Opt_no_space_cache, "no_space_cache"},
+ {Opt_recovery, "recovery"},
{Opt_err, NULL},
};
@@ -392,6 +393,10 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
printk(KERN_INFO "btrfs: enabling auto defrag");
btrfs_set_opt(info->mount_opt, AUTO_DEFRAG);
break;
+ case Opt_recovery:
+ printk(KERN_INFO "btrfs: enabling auto recovery");
+ btrfs_set_opt(info->mount_opt, RECOVERY);
+ break;
case Opt_err:
printk(KERN_INFO "btrfs: unrecognized mount option "
"'%s'\n", p);