Btrfs: fix leaking block group on balance
authorYan Zheng <zheng.yan@oracle.com>
Thu, 11 Dec 2008 21:30:39 +0000 (16:30 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 11 Dec 2008 21:30:39 +0000 (16:30 -0500)
commitd2fb3437e4d8d12c73c587615ad187d5288547ec
tree894e4c698970dd35226b2614b8a38fb8a96580e7
parentcfc8ea87201dc9bb6aeb3fc80c61abee83e7cc06
Btrfs: fix leaking block group on balance

The block group structs are referenced in many different
places, and it's not safe to free while balancing.  So, those block
group structs were simply leaked instead.

This patch replaces the block group pointer in the inode with the starting byte
offset of the block group and adds reference counting to the block group
struct.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/transaction.c
fs/btrfs/transaction.h