]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb1cb2301a1f3a72f897962914e6b2d8e3b3825e0
tree66a215bac40c8832a6df463aba4aaac4506a3be2
parentc923f973b959978b54620aa4f1fdadeeda8f549e
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