diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-12-13 11:13:32 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:58 -0400 |
commit | f6dbff55d77dee363c22873481db54d3bada3ea6 (patch) | |
tree | 9a669d43101730bd48044e4943ea833fc2320c15 /fs/btrfs/extent-tree.c | |
parent | 6caab489c5866788ae64a72986520b1f0e40c706 (diff) |
Btrfs: Reorder extent back refs to differentiate btree blocks from file data
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 | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 057cdd49c09b..00414836e963 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -520,13 +520,13 @@ out: | |||
520 | * | 520 | * |
521 | * When a tree block is created, back references are inserted: | 521 | * When a tree block is created, back references are inserted: |
522 | * | 522 | * |
523 | * (root->root_key.objectid, trans->transid or zero, lowest_key_objectid, level) | 523 | * (root->root_key.objectid, trans->transid or zero, level, lowest_key_objectid) |
524 | * | 524 | * |
525 | * When a tree block is cow'd in a reference counted root, | 525 | * When a tree block is cow'd in a reference counted root, |
526 | * new back references are added for all the blocks it points to. | 526 | * new back references are added for all the blocks it points to. |
527 | * These are of the form (trans->transid will have increased since creation): | 527 | * These are of the form (trans->transid will have increased since creation): |
528 | * | 528 | * |
529 | * (root->root_key.objectid, trans->transid, lowest_key_objectid, level) | 529 | * (root->root_key.objectid, trans->transid, level, lowest_key_objectid) |
530 | * | 530 | * |
531 | * Because the lowest_key_objectid and the level are just hints | 531 | * Because the lowest_key_objectid and the level are just hints |
532 | * they are not used when backrefs are deleted. When a backref is deleted: | 532 | * they are not used when backrefs are deleted. When a backref is deleted: |
@@ -702,7 +702,7 @@ int btrfs_inc_root_ref(struct btrfs_trans_handle *trans, | |||
702 | } | 702 | } |
703 | return btrfs_inc_extent_ref(trans, root, root->node->start, | 703 | return btrfs_inc_extent_ref(trans, root, root->node->start, |
704 | root->node->len, owner_objectid, | 704 | root->node->len, owner_objectid, |
705 | generation, key_objectid, level); | 705 | generation, level, key_objectid); |
706 | } | 706 | } |
707 | 707 | ||
708 | int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, | 708 | int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
@@ -750,8 +750,8 @@ int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, | |||
750 | ret = btrfs_inc_extent_ref(trans, root, bytenr, | 750 | ret = btrfs_inc_extent_ref(trans, root, bytenr, |
751 | btrfs_level_size(root, level - 1), | 751 | btrfs_level_size(root, level - 1), |
752 | root->root_key.objectid, | 752 | root->root_key.objectid, |
753 | trans->transid, key.objectid, | 753 | trans->transid, |
754 | level - 1); | 754 | level - 1, key.objectid); |
755 | if (ret) { | 755 | if (ret) { |
756 | faili = i; | 756 | faili = i; |
757 | goto fail; | 757 | goto fail; |
@@ -1063,8 +1063,8 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, struct | |||
1063 | } | 1063 | } |
1064 | err = btrfs_insert_extent_backref(trans, extent_root, path, | 1064 | err = btrfs_insert_extent_backref(trans, extent_root, path, |
1065 | start, extent_root->root_key.objectid, | 1065 | start, extent_root->root_key.objectid, |
1066 | 0, btrfs_disk_key_objectid(&first), | 1066 | 0, level, |
1067 | level); | 1067 | btrfs_disk_key_objectid(&first)); |
1068 | BUG_ON(err); | 1068 | BUG_ON(err); |
1069 | free_extent_buffer(eb); | 1069 | free_extent_buffer(eb); |
1070 | } | 1070 | } |
@@ -1640,7 +1640,7 @@ struct extent_buffer *__btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | |||
1640 | 1640 | ||
1641 | ret = btrfs_alloc_extent(trans, root, blocksize, | 1641 | ret = btrfs_alloc_extent(trans, root, blocksize, |
1642 | root_objectid, ref_generation, | 1642 | root_objectid, ref_generation, |
1643 | first_objectid, level, empty_size, hint, | 1643 | level, first_objectid, empty_size, hint, |
1644 | (u64)-1, &ins, 0); | 1644 | (u64)-1, &ins, 0); |
1645 | if (ret) { | 1645 | if (ret) { |
1646 | BUG_ON(ret > 0); | 1646 | BUG_ON(ret > 0); |