--- linux-2.6.32.19/fs/btrfs/super.c 2010-08-16 10:52:40.000000000 -0500 +++ linux-2.6.32.19-vs2.3.0.36.29.4/fs/btrfs/super.c 2010-08-16 12:06:46.000000000 -0500 @@ -67,7 +67,7 @@ enum { Opt_max_extent, Opt_max_inline, Opt_alloc_start, Opt_nobarrier, Opt_ssd, Opt_nossd, Opt_ssd_spread, Opt_thread_pool, Opt_noacl, Opt_compress, Opt_notreelog, Opt_ratio, Opt_flushoncommit, - Opt_discard, Opt_err, + Opt_tag, Opt_notag, Opt_tagid, Opt_discard, Opt_err, }; static match_table_t tokens = { @@ -90,6 +90,9 @@ static match_table_t tokens = { {Opt_flushoncommit, "flushoncommit"}, {Opt_ratio, "metadata_ratio=%d"}, {Opt_discard, "discard"}, + {Opt_tag, "tag"}, + {Opt_notag, "notag"}, + {Opt_tagid, "tagid=%u"}, {Opt_err, NULL}, }; @@ -264,6 +267,22 @@ int btrfs_parse_options(struct btrfs_roo case Opt_discard: btrfs_set_opt(info->mount_opt, DISCARD); break; +#ifndef CONFIG_TAGGING_NONE + case Opt_tag: + printk(KERN_INFO "btrfs: use tagging\n"); + btrfs_set_opt(info->mount_opt, TAGGED); + break; + case Opt_notag: + printk(KERN_INFO "btrfs: disabled tagging\n"); + btrfs_clear_opt(info->mount_opt, TAGGED); + break; +#endif +#ifdef CONFIG_PROPAGATE + case Opt_tagid: + /* use args[0] */ + btrfs_set_opt(info->mount_opt, TAGGED); + break; +#endif case Opt_err: printk(KERN_INFO "btrfs: unrecognized mount option " "'%s'\n", p); @@ -585,6 +604,12 @@ static int btrfs_remount(struct super_bl if (ret) return -EINVAL; + if (btrfs_test_opt(root, TAGGED) && !(sb->s_flags & MS_TAGGED)) { + printk("btrfs: %s: tagging not permitted on remount.\n", + sb->s_id); + return -EINVAL; + } + if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) return 0;