diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-12-11 22:30:39 +0100 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-12-11 22:30:39 +0100 |
commit | d2fb3437e4d8d12c73c587615ad187d5288547ec (patch) | |
tree | 894e4c698970dd35226b2614b8a38fb8a96580e7 /fs/btrfs/btrfs_inode.h | |
parent | Btrfs: mnt_drop_write in ioctl_trans_end (diff) | |
download | linux-d2fb3437e4d8d12c73c587615ad187d5288547ec.tar.xz linux-d2fb3437e4d8d12c73c587615ad187d5288547ec.zip |
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>
Diffstat (limited to 'fs/btrfs/btrfs_inode.h')
-rw-r--r-- | fs/btrfs/btrfs_inode.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 1b9ec1ab1f68..a8c9693b75ac 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -28,11 +28,6 @@ struct btrfs_inode { /* which subvolume this inode belongs to */ struct btrfs_root *root; - /* the block group preferred for allocations. This pointer is buggy - * and needs to be replaced with a bytenr instead - */ - struct btrfs_block_group_cache *block_group; - /* key used to find this inode on disk. This is used by the code * to read in roots of subvolumes */ @@ -115,6 +110,9 @@ struct btrfs_inode { */ u64 index_cnt; + /* the start of block group preferred for allocations. */ + u64 block_group; + struct inode vfs_inode; }; |