From: zwu.kernel@gmail.com
To: linux-btrfs@vger.kernel.org
Cc: sekharan@us.ibm.com, chris.mason@fusionio.com,
idryomov@gmail.com, Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Subject: [RFC 5/5] btrfs: add hot relocation support
Date: Mon, 6 May 2013 16:53:38 +0800 [thread overview]
Message-ID: <1367830418-26865-6-git-send-email-zwu.kernel@gmail.com> (raw)
In-Reply-To: <1367830418-26865-1-git-send-email-zwu.kernel@gmail.com>
From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Add one new mount option '-o hot_move' for hot
relocation support. When hot relocation is enabled,
hot tracking will be enabled automatically.
Its usage looks like:
mount -o hot_move
mount -o nouser,hot_move
mount -o nouser,hot_move,loop
mount -o hot_move,nouser
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
fs/btrfs/super.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 4cbd0de..b342f6f 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -311,8 +311,13 @@ static void btrfs_put_super(struct super_block *sb)
* process... Whom would you report that to?
*/
+ /* Hot data relocation */
+ if (btrfs_test_opt(btrfs_sb(sb)->tree_root, HOT_MOVE))
+ hot_relocate_exit(btrfs_sb(sb));
+
/* Hot data tracking */
- if (btrfs_test_opt(btrfs_sb(sb)->tree_root, HOT_TRACK))
+ if (btrfs_test_opt(btrfs_sb(sb)->tree_root, HOT_MOVE)
+ || btrfs_test_opt(btrfs_sb(sb)->tree_root, HOT_TRACK))
hot_track_exit(sb);
}
@@ -327,7 +332,7 @@ enum {
Opt_no_space_cache, Opt_recovery, Opt_skip_balance,
Opt_check_integrity, Opt_check_integrity_including_extent_data,
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_hot_track,
- Opt_err,
+ Opt_hot_move, Opt_err,
};
static match_table_t tokens = {
@@ -368,6 +373,7 @@ static match_table_t tokens = {
{Opt_check_integrity_print_mask, "check_int_print_mask=%d"},
{Opt_fatal_errors, "fatal_errors=%s"},
{Opt_hot_track, "hot_track"},
+ {Opt_hot_move, "hot_move"},
{Opt_err, NULL},
};
@@ -636,6 +642,9 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
case Opt_hot_track:
btrfs_set_opt(info->mount_opt, HOT_TRACK);
break;
+ case Opt_hot_move:
+ btrfs_set_opt(info->mount_opt, HOT_MOVE);
+ break;
case Opt_err:
printk(KERN_INFO "btrfs: unrecognized mount option "
"'%s'\n", p);
@@ -863,17 +872,26 @@ static int btrfs_fill_super(struct super_block *sb,
goto fail_close;
}
- if (btrfs_test_opt(fs_info->tree_root, HOT_TRACK)) {
+ if (btrfs_test_opt(fs_info->tree_root, HOT_MOVE)
+ || btrfs_test_opt(fs_info->tree_root, HOT_TRACK)) {
err = hot_track_init(sb);
if (err)
goto fail_hot;
}
+ if (btrfs_test_opt(fs_info->tree_root, HOT_MOVE)) {
+ err = hot_relocate_init(fs_info);
+ if (err)
+ goto fail_reloc;
+ }
+
save_mount_options(sb, data);
cleancache_init_fs(sb);
sb->s_flags |= MS_ACTIVE;
return 0;
+fail_reloc:
+ hot_track_exit(sb);
fail_hot:
dput(sb->s_root);
sb->s_root = NULL;
@@ -974,6 +992,8 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
seq_puts(seq, ",fatal_errors=panic");
if (btrfs_test_opt(root, HOT_TRACK))
seq_puts(seq, ",hot_track");
+ if (btrfs_test_opt(root, HOT_MOVE))
+ seq_puts(seq, ",hot_move");
return 0;
}
--
1.7.11.7
next prev parent reply other threads:[~2013-05-06 8:53 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-06 8:53 [RFC 0/5] BTRFS hot relocation support zwu.kernel
2013-05-06 8:53 ` [RFC 1/5] vfs: add one list_head field zwu.kernel
2013-05-06 8:53 ` [RFC 2/5] btrfs: add one new block group zwu.kernel
2013-05-06 8:53 ` [RFC 3/5] btrfs: add one hot relocation kthread zwu.kernel
2013-05-06 8:53 ` [RFC 4/5] procfs: add three proc interfaces zwu.kernel
2013-05-06 8:53 ` zwu.kernel [this message]
2013-05-06 20:36 ` [RFC 0/5] BTRFS hot relocation support Kai Krakow
2013-05-07 5:17 ` Tomasz Torcz
2013-05-07 21:17 ` Kai Krakow
2013-05-07 21:35 ` Gabriel de Perthuis
2013-05-07 21:58 ` Kai Krakow
2013-05-07 22:27 ` Gabriel de Perthuis
2013-05-08 23:13 ` Zhi Yong Wu
2013-05-09 6:30 ` Stefan Behrens
2013-05-09 6:42 ` Zhi Yong Wu
2013-05-09 7:41 ` Stefan Behrens
2013-05-09 7:49 ` Zhi Yong Wu
2013-05-09 7:28 ` Zheng Liu
2013-05-09 6:56 ` Roger Binns
2013-05-19 10:41 ` Martin Steigerwald
2013-05-19 13:43 ` Zhi Yong Wu
2013-05-19 14:42 ` Martin Steigerwald
2013-05-19 13:46 ` Zhi Yong Wu
2013-05-09 7:17 ` Gabriel de Perthuis
2013-05-14 15:24 ` Zhi Yong Wu
2013-05-16 7:12 ` Kai Krakow
2013-05-17 7:23 ` Zhi Yong Wu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1367830418-26865-6-git-send-email-zwu.kernel@gmail.com \
--to=zwu.kernel@gmail.com \
--cc=chris.mason@fusionio.com \
--cc=idryomov@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=sekharan@us.ibm.com \
--cc=wuzhy@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox