summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorMiao Xie2013-01-29 11:13:12 +0100
committerJosef Bacik2013-02-20 18:59:08 +0100
commitde98ced9e743656d108de41841797def0f5cb951 (patch)
tree52314be4abe2cd2510712e8b629d58d8d01d5e0a /fs/btrfs/ctree.h
parentBtrfs: use the inode own lock to protect its delalloc_bytes (diff)
downloadkernel-qcow2-linux-de98ced9e743656d108de41841797def0f5cb951.tar.gz
kernel-qcow2-linux-de98ced9e743656d108de41841797def0f5cb951.tar.xz
kernel-qcow2-linux-de98ced9e743656d108de41841797def0f5cb951.zip
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/ctree.h')
-rw-r--r--fs/btrfs/ctree.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 50def99f5379..5f5c30aaef36 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1483,6 +1483,8 @@ struct btrfs_fs_info {
struct rb_root defrag_inodes;
atomic_t defrag_running;
+ /* Used to protect avail_{data, metadata, system}_alloc_bits */
+ seqlock_t profiles_lock;
/*
* these three are in extended format (availability of single
* chunks is denoted by BTRFS_AVAIL_ALLOC_BIT_SINGLE bit, other