diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-04-23 17:01:05 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-04-23 17:01:05 -0400 |
commit | 5d0c3e60fea7e23fbfbe3ab2886b444b4c702441 (patch) | |
tree | bd1b909f21d15ffb376da966e655c3eb4053b854 /fs/btrfs/extent-tree.c | |
parent | 4d775673091d43b39fa9d086071009f98dec289e (diff) |
Btrfs: fix extent owner/type setting on extent tree blocks
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 49f7cd6e067c..aac3eccffb8e 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -167,6 +167,8 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, struct | |||
167 | ins.offset = 1; | 167 | ins.offset = 1; |
168 | ins.flags = 0; | 168 | ins.flags = 0; |
169 | btrfs_set_key_type(&ins, BTRFS_EXTENT_ITEM_KEY); | 169 | btrfs_set_key_type(&ins, BTRFS_EXTENT_ITEM_KEY); |
170 | btrfs_set_extent_type(&extent_item, BTRFS_EXTENT_TREE); | ||
171 | btrfs_set_extent_owner(&extent_item, extent_root->root_key.objectid); | ||
170 | 172 | ||
171 | for (i = 0; i < extent_root->fs_info->current_insert.flags; i++) { | 173 | for (i = 0; i < extent_root->fs_info->current_insert.flags; i++) { |
172 | ins.objectid = extent_root->fs_info->current_insert.objectid + | 174 | ins.objectid = extent_root->fs_info->current_insert.objectid + |
@@ -356,7 +358,7 @@ static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root | |||
356 | btrfs_set_key_type(ins, BTRFS_EXTENT_ITEM_KEY); | 358 | btrfs_set_key_type(ins, BTRFS_EXTENT_ITEM_KEY); |
357 | 359 | ||
358 | level = btrfs_header_level(btrfs_buffer_header(root->node)); | 360 | level = btrfs_header_level(btrfs_buffer_header(root->node)); |
359 | total_needed += (level + 1) * 3; | 361 | total_needed += (level + 2) * 3; |
360 | if (root->fs_info->last_insert.objectid == 0 && search_end == (u64)-1) { | 362 | if (root->fs_info->last_insert.objectid == 0 && search_end == (u64)-1) { |
361 | struct btrfs_disk_key *last_key; | 363 | struct btrfs_disk_key *last_key; |
362 | btrfs_init_path(path); | 364 | btrfs_init_path(path); |