btrfs: Use ref_cnt for set_block_group_ro()
authorZhaolei <zhaolei@cn.fujitsu.com>
Wed, 5 Aug 2015 08:43:27 +0000 (16:43 +0800)
committerChris Mason <clm@fb.com>
Sun, 9 Aug 2015 14:07:12 +0000 (07:07 -0700)
commit868f401ae38acb439005626c04d575e64c5ae760
tree66a215bac40c8832a6df463aba4aaac4506a3be2
parentd7cad2389560f3249435ac928bc13e9408ae467e
btrfs: Use ref_cnt for set_block_group_ro()

More than one code call set_block_group_ro() and restore rw in fail.

Old code use bool bit to save blockgroup's ro state, it can not
support parallel case(it is confirmd exist in my debug log).

This patch use ref count to store ro state, and rename
set_block_group_ro/set_block_group_rw
to
inc_block_group_ro/dec_block_group_ro.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/relocation.c