Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 243179
b: refs/heads/master
c: c59021f
h: refs/heads/master
i:
  243177: 4e690e8
  243175: 5bf2545
v: v3
  • Loading branch information
liubo authored and root committed Mar 28, 2011
1 parent 13d1f9c commit dc1e51b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f7c43c96727a53bea45f7f2549d897f0a6117b8
refs/heads/master: c59021f846881a957ac5afe456d0f59d6a517b61
1 change: 1 addition & 0 deletions trunk/fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -2234,6 +2234,7 @@ int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans,
struct btrfs_root *root, u64 type);
int btrfs_trim_fs(struct btrfs_root *root, struct fstrim_range *range);

int btrfs_init_space_info(struct btrfs_fs_info *fs_info);
/* ctree.c */
int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key,
int level, int *slot);
Expand Down
6 changes: 6 additions & 0 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2065,6 +2065,12 @@ struct btrfs_root *open_ctree(struct super_block *sb,
fs_info->metadata_alloc_profile = (u64)-1;
fs_info->system_alloc_profile = fs_info->metadata_alloc_profile;

ret = btrfs_init_space_info(fs_info);
if (ret) {
printk(KERN_ERR "Failed to initial space info: %d\n", ret);
goto fail_block_groups;
}

ret = btrfs_read_block_groups(extent_root);
if (ret) {
printk(KERN_ERR "Failed to read block groups: %d\n", ret);
Expand Down
23 changes: 23 additions & 0 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -8778,6 +8778,29 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
return ret;
}

int btrfs_init_space_info(struct btrfs_fs_info *fs_info)
{
struct btrfs_space_info *space_info;
int ret;

ret = update_space_info(fs_info, BTRFS_BLOCK_GROUP_SYSTEM, 0, 0,
&space_info);
if (ret)
return ret;

ret = update_space_info(fs_info, BTRFS_BLOCK_GROUP_METADATA, 0, 0,
&space_info);
if (ret)
return ret;

ret = update_space_info(fs_info, BTRFS_BLOCK_GROUP_DATA, 0, 0,
&space_info);
if (ret)
return ret;

return ret;
}

int btrfs_error_unpin_extent_range(struct btrfs_root *root, u64 start, u64 end)
{
return unpin_extent_range(root, start, end);
Expand Down

0 comments on commit dc1e51b

Please sign in to comment.