aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-03-24 15:01:59 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:01 -0400
commit6324fbf334f4586325057197da7752f4ffa409d3 (patch)
treeaf67d90c3a58f48b91f73ac23f753f4f3907a453 /fs/btrfs/inode.c
parent0b86a832a1f38abec695864ec2eaedc9d2383f1b (diff)
Btrfs: Dynamic chunk and block group allocation
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 17063cd2cb73..109576b57f69 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1527,6 +1527,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
1527{ 1527{
1528 struct inode *inode; 1528 struct inode *inode;
1529 struct btrfs_inode_item *inode_item; 1529 struct btrfs_inode_item *inode_item;
1530 struct btrfs_block_group_cache *new_inode_group;
1530 struct btrfs_key *location; 1531 struct btrfs_key *location;
1531 struct btrfs_path *path; 1532 struct btrfs_path *path;
1532 struct btrfs_inode_ref *ref; 1533 struct btrfs_inode_ref *ref;
@@ -1553,9 +1554,13 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
1553 owner = 0; 1554 owner = 0;
1554 else 1555 else
1555 owner = 1; 1556 owner = 1;
1556 group = btrfs_find_block_group(root, group, 0, 1557 new_inode_group = btrfs_find_block_group(root, group, 0,
1557 BTRFS_BLOCK_GROUP_METADATA, owner); 1558 BTRFS_BLOCK_GROUP_METADATA, owner);
1558 BTRFS_I(inode)->block_group = group; 1559 if (!new_inode_group) {
1560 printk("find_block group failed\n");
1561 new_inode_group = group;
1562 }
1563 BTRFS_I(inode)->block_group = new_inode_group;
1559 BTRFS_I(inode)->flags = 0; 1564 BTRFS_I(inode)->flags = 0;
1560 1565
1561 key[0].objectid = objectid; 1566 key[0].objectid = objectid;