summaryrefslogtreecommitdiff
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)
downloadlwn-6324fbf334f4586325057197da7752f4ffa409d3.tar.gz
lwn-6324fbf334f4586325057197da7752f4ffa409d3.zip
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,
{
struct inode *inode;
struct btrfs_inode_item *inode_item;
+ struct btrfs_block_group_cache *new_inode_group;
struct btrfs_key *location;
struct btrfs_path *path;
struct btrfs_inode_ref *ref;
@@ -1553,9 +1554,13 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
owner = 0;
else
owner = 1;
- group = btrfs_find_block_group(root, group, 0,
+ new_inode_group = btrfs_find_block_group(root, group, 0,
BTRFS_BLOCK_GROUP_METADATA, owner);
- BTRFS_I(inode)->block_group = group;
+ if (!new_inode_group) {
+ printk("find_block group failed\n");
+ new_inode_group = group;
+ }
+ BTRFS_I(inode)->block_group = new_inode_group;
BTRFS_I(inode)->flags = 0;
key[0].objectid = objectid;