diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-10-09 11:46:24 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-10-09 11:46:24 -0400 |
commit | 3bb1a1bc42f2ae9582c28adf620484efcd4da38d (patch) | |
tree | 4e65ee859e73ea9558e33a02ba10e1d9d54756f3 /fs/btrfs/ctree.h | |
parent | a76a3cd40c1127ca199d4f7f37bf0d541bf44eb2 (diff) |
Btrfs: Remove offset field from struct btrfs_extent_ref
The offset field in struct btrfs_extent_ref records the position
inside file that file extent is referenced by. In the new back
reference system, tree leaves holding references to file extent
are recorded explicitly. We can scan these tree leaves very quickly, so the
offset field is not required.
This patch also makes the back reference system check the objectid
when extents are in deleting.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 50fbcc9ec45f..a37fd783407c 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -374,7 +374,6 @@ struct btrfs_extent_ref { | |||
374 | __le64 root; | 374 | __le64 root; |
375 | __le64 generation; | 375 | __le64 generation; |
376 | __le64 objectid; | 376 | __le64 objectid; |
377 | __le64 offset; | ||
378 | __le32 num_refs; | 377 | __le32 num_refs; |
379 | } __attribute__ ((__packed__)); | 378 | } __attribute__ ((__packed__)); |
380 | 379 | ||
@@ -1082,7 +1081,6 @@ static inline u8 *btrfs_dev_extent_chunk_tree_uuid(struct btrfs_dev_extent *dev) | |||
1082 | BTRFS_SETGET_FUNCS(ref_root, struct btrfs_extent_ref, root, 64); | 1081 | BTRFS_SETGET_FUNCS(ref_root, struct btrfs_extent_ref, root, 64); |
1083 | BTRFS_SETGET_FUNCS(ref_generation, struct btrfs_extent_ref, generation, 64); | 1082 | BTRFS_SETGET_FUNCS(ref_generation, struct btrfs_extent_ref, generation, 64); |
1084 | BTRFS_SETGET_FUNCS(ref_objectid, struct btrfs_extent_ref, objectid, 64); | 1083 | BTRFS_SETGET_FUNCS(ref_objectid, struct btrfs_extent_ref, objectid, 64); |
1085 | BTRFS_SETGET_FUNCS(ref_offset, struct btrfs_extent_ref, offset, 64); | ||
1086 | BTRFS_SETGET_FUNCS(ref_num_refs, struct btrfs_extent_ref, num_refs, 32); | 1084 | BTRFS_SETGET_FUNCS(ref_num_refs, struct btrfs_extent_ref, num_refs, 32); |
1087 | 1085 | ||
1088 | BTRFS_SETGET_STACK_FUNCS(stack_ref_root, struct btrfs_extent_ref, root, 64); | 1086 | BTRFS_SETGET_STACK_FUNCS(stack_ref_root, struct btrfs_extent_ref, root, 64); |
@@ -1090,8 +1088,6 @@ BTRFS_SETGET_STACK_FUNCS(stack_ref_generation, struct btrfs_extent_ref, | |||
1090 | generation, 64); | 1088 | generation, 64); |
1091 | BTRFS_SETGET_STACK_FUNCS(stack_ref_objectid, struct btrfs_extent_ref, | 1089 | BTRFS_SETGET_STACK_FUNCS(stack_ref_objectid, struct btrfs_extent_ref, |
1092 | objectid, 64); | 1090 | objectid, 64); |
1093 | BTRFS_SETGET_STACK_FUNCS(stack_ref_offset, struct btrfs_extent_ref, | ||
1094 | offset, 64); | ||
1095 | BTRFS_SETGET_STACK_FUNCS(stack_ref_num_refs, struct btrfs_extent_ref, | 1091 | BTRFS_SETGET_STACK_FUNCS(stack_ref_num_refs, struct btrfs_extent_ref, |
1096 | num_refs, 32); | 1092 | num_refs, 32); |
1097 | 1093 | ||
@@ -1522,29 +1518,20 @@ struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | |||
1522 | struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans, | 1518 | struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans, |
1523 | struct btrfs_root *root, | 1519 | struct btrfs_root *root, |
1524 | u64 bytenr, u32 blocksize); | 1520 | u64 bytenr, u32 blocksize); |
1525 | int btrfs_insert_extent_backref(struct btrfs_trans_handle *trans, | ||
1526 | struct btrfs_root *root, | ||
1527 | struct btrfs_path *path, | ||
1528 | u64 bytenr, u64 parent, | ||
1529 | u64 root_objectid, u64 ref_generation, | ||
1530 | u64 owner, u64 owner_offset); | ||
1531 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, | 1521 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, |
1532 | struct btrfs_root *root, | 1522 | struct btrfs_root *root, |
1533 | u64 num_bytes, u64 parent, u64 min_bytes, | 1523 | u64 num_bytes, u64 parent, u64 min_bytes, |
1534 | u64 root_objectid, u64 ref_generation, | 1524 | u64 root_objectid, u64 ref_generation, |
1535 | u64 owner, u64 owner_offset, | 1525 | u64 owner, u64 empty_size, u64 hint_byte, |
1536 | u64 empty_size, u64 hint_byte, | ||
1537 | u64 search_end, struct btrfs_key *ins, u64 data); | 1526 | u64 search_end, struct btrfs_key *ins, u64 data); |
1538 | int btrfs_alloc_reserved_extent(struct btrfs_trans_handle *trans, | 1527 | int btrfs_alloc_reserved_extent(struct btrfs_trans_handle *trans, |
1539 | struct btrfs_root *root, u64 parent, | 1528 | struct btrfs_root *root, u64 parent, |
1540 | u64 root_objectid, u64 ref_generation, | 1529 | u64 root_objectid, u64 ref_generation, |
1541 | u64 owner, u64 owner_offset, | 1530 | u64 owner, struct btrfs_key *ins); |
1542 | struct btrfs_key *ins); | ||
1543 | int btrfs_alloc_logged_extent(struct btrfs_trans_handle *trans, | 1531 | int btrfs_alloc_logged_extent(struct btrfs_trans_handle *trans, |
1544 | struct btrfs_root *root, u64 parent, | 1532 | struct btrfs_root *root, u64 parent, |
1545 | u64 root_objectid, u64 ref_generation, | 1533 | u64 root_objectid, u64 ref_generation, |
1546 | u64 owner, u64 owner_offset, | 1534 | u64 owner, struct btrfs_key *ins); |
1547 | struct btrfs_key *ins); | ||
1548 | int btrfs_reserve_extent(struct btrfs_trans_handle *trans, | 1535 | int btrfs_reserve_extent(struct btrfs_trans_handle *trans, |
1549 | struct btrfs_root *root, | 1536 | struct btrfs_root *root, |
1550 | u64 num_bytes, u64 min_alloc_size, | 1537 | u64 num_bytes, u64 min_alloc_size, |
@@ -1563,7 +1550,7 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans, | |||
1563 | struct btrfs_root *root, | 1550 | struct btrfs_root *root, |
1564 | u64 bytenr, u64 num_bytes, u64 parent, | 1551 | u64 bytenr, u64 num_bytes, u64 parent, |
1565 | u64 root_objectid, u64 ref_generation, | 1552 | u64 root_objectid, u64 ref_generation, |
1566 | u64 owner_objectid, u64 owner_offset, int pin); | 1553 | u64 owner_objectid, int pin); |
1567 | int btrfs_free_reserved_extent(struct btrfs_root *root, u64 start, u64 len); | 1554 | int btrfs_free_reserved_extent(struct btrfs_root *root, u64 start, u64 len); |
1568 | int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, | 1555 | int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, |
1569 | struct btrfs_root *root, | 1556 | struct btrfs_root *root, |
@@ -1572,12 +1559,12 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, | |||
1572 | struct btrfs_root *root, | 1559 | struct btrfs_root *root, |
1573 | u64 bytenr, u64 num_bytes, u64 parent, | 1560 | u64 bytenr, u64 num_bytes, u64 parent, |
1574 | u64 root_objectid, u64 ref_generation, | 1561 | u64 root_objectid, u64 ref_generation, |
1575 | u64 owner, u64 owner_offset); | 1562 | u64 owner_objectid); |
1576 | int btrfs_update_extent_ref(struct btrfs_trans_handle *trans, | 1563 | int btrfs_update_extent_ref(struct btrfs_trans_handle *trans, |
1577 | struct btrfs_root *root, u64 bytenr, | 1564 | struct btrfs_root *root, u64 bytenr, |
1578 | u64 orig_parent, u64 parent, | 1565 | u64 orig_parent, u64 parent, |
1579 | u64 root_objectid, u64 ref_generation, | 1566 | u64 root_objectid, u64 ref_generation, |
1580 | u64 owner, u64 owner_offset); | 1567 | u64 owner_objectid); |
1581 | int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans, | 1568 | int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans, |
1582 | struct btrfs_root *root); | 1569 | struct btrfs_root *root); |
1583 | int btrfs_free_block_groups(struct btrfs_fs_info *info); | 1570 | int btrfs_free_block_groups(struct btrfs_fs_info *info); |