diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2013-01-29 05:13:12 -0500 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-02-20 12:59:08 -0500 |
commit | de98ced9e743656d108de41841797def0f5cb951 (patch) | |
tree | 52314be4abe2cd2510712e8b629d58d8d01d5e0a /fs/btrfs/disk-io.c | |
parent | df0af1a57f72c74d53a9377c60ff20095afab97d (diff) |
Btrfs: use seqlock to protect fs_info->avail_{data, metadata, system}_alloc_bits
There is no lock to protect
fs_info->avail_{data, metadata, system}_alloc_bits,
it may introduce some problem, such as the wrong profile
information, so we add a seqlock to protect them.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 11f6dbcb1191..00b6742fdde7 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -2040,6 +2040,7 @@ int open_ctree(struct super_block *sb, | |||
2040 | spin_lock_init(&fs_info->tree_mod_seq_lock); | 2040 | spin_lock_init(&fs_info->tree_mod_seq_lock); |
2041 | rwlock_init(&fs_info->tree_mod_log_lock); | 2041 | rwlock_init(&fs_info->tree_mod_log_lock); |
2042 | mutex_init(&fs_info->reloc_mutex); | 2042 | mutex_init(&fs_info->reloc_mutex); |
2043 | seqlock_init(&fs_info->profiles_lock); | ||
2043 | 2044 | ||
2044 | init_completion(&fs_info->kobj_unregister); | 2045 | init_completion(&fs_info->kobj_unregister); |
2045 | INIT_LIST_HEAD(&fs_info->dirty_cowonly_roots); | 2046 | INIT_LIST_HEAD(&fs_info->dirty_cowonly_roots); |