diff options
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index ee51b7afe97d..36e03312267a 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -4108,13 +4108,15 @@ static int block_rsv_migrate_bytes(struct btrfs_block_rsv *src, | |||
4108 | return 0; | 4108 | return 0; |
4109 | } | 4109 | } |
4110 | 4110 | ||
4111 | void btrfs_init_block_rsv(struct btrfs_block_rsv *rsv) | 4111 | void btrfs_init_block_rsv(struct btrfs_block_rsv *rsv, unsigned short type) |
4112 | { | 4112 | { |
4113 | memset(rsv, 0, sizeof(*rsv)); | 4113 | memset(rsv, 0, sizeof(*rsv)); |
4114 | spin_lock_init(&rsv->lock); | 4114 | spin_lock_init(&rsv->lock); |
4115 | rsv->type = type; | ||
4115 | } | 4116 | } |
4116 | 4117 | ||
4117 | struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_root *root) | 4118 | struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_root *root, |
4119 | unsigned short type) | ||
4118 | { | 4120 | { |
4119 | struct btrfs_block_rsv *block_rsv; | 4121 | struct btrfs_block_rsv *block_rsv; |
4120 | struct btrfs_fs_info *fs_info = root->fs_info; | 4122 | struct btrfs_fs_info *fs_info = root->fs_info; |
@@ -4123,7 +4125,7 @@ struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_root *root) | |||
4123 | if (!block_rsv) | 4125 | if (!block_rsv) |
4124 | return NULL; | 4126 | return NULL; |
4125 | 4127 | ||
4126 | btrfs_init_block_rsv(block_rsv); | 4128 | btrfs_init_block_rsv(block_rsv, type); |
4127 | block_rsv->space_info = __find_space_info(fs_info, | 4129 | block_rsv->space_info = __find_space_info(fs_info, |
4128 | BTRFS_BLOCK_GROUP_METADATA); | 4130 | BTRFS_BLOCK_GROUP_METADATA); |
4129 | return block_rsv; | 4131 | return block_rsv; |