summaryrefslogtreecommitdiff
path: root/ctree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-04-26 16:46:06 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-04-26 16:46:06 -0400
commit5856b7e1241b07a5d461ff1592562c8520c42d93 (patch)
tree2dfd928a18b73491a7a1aa698cbca84994511ec6 /ctree.c
parentc2d777735cb24b283d7dc19ba124652f0d965318 (diff)
start of block group code
Diffstat (limited to 'ctree.c')
-rw-r--r--ctree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ctree.c b/ctree.c
index ab8f9d03..c6dcba70 100644
--- a/ctree.c
+++ b/ctree.c
@@ -685,6 +685,8 @@ static int insert_new_root(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_level(&c->header, level);
btrfs_set_header_blocknr(&c->header, t->blocknr);
btrfs_set_header_owner(&c->header, root->root_key.objectid);
+ memcpy(c->header.fsid, root->fs_info->disk_super->fsid,
+ sizeof(c->header.fsid));
lower = &path->nodes[level-1]->node;
if (btrfs_is_leaf(lower))
lower_key = &((struct btrfs_leaf *)lower)->items[0].key;
@@ -771,6 +773,8 @@ static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_level(&split->header, btrfs_header_level(&c->header));
btrfs_set_header_blocknr(&split->header, split_buffer->blocknr);
btrfs_set_header_owner(&split->header, root->root_key.objectid);
+ memcpy(split->header.fsid, root->fs_info->disk_super->fsid,
+ sizeof(split->header.fsid));
mid = (c_nritems + 1) / 2;
memcpy(split->ptrs, c->ptrs + mid,
(c_nritems - mid) * sizeof(struct btrfs_key_ptr));
@@ -1096,6 +1100,8 @@ static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_blocknr(&right->header, right_buffer->blocknr);
btrfs_set_header_level(&right->header, 0);
btrfs_set_header_owner(&right->header, root->root_key.objectid);
+ memcpy(right->header.fsid, root->fs_info->disk_super->fsid,
+ sizeof(right->header.fsid));
data_copy_size = btrfs_item_end(l->items + mid) -
leaf_data_end(root, l);
memcpy(right->items, l->items + mid,