diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-04-24 12:07:39 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-04-24 12:07:39 -0400 |
commit | c62a1920ced752e86f57ab1d4ad0ec65012bce4d (patch) | |
tree | 39ae2aa95a7921d2b0a959ccb28a3f3733154c47 /fs/btrfs | |
parent | b51338628f604d9b4ed3c776839a484a30e12fb7 (diff) |
Btrfs: get rid of the extent_item type field
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ctree.h | 16 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 5 | ||||
-rw-r--r-- | fs/btrfs/super.c | 3 |
3 files changed, 3 insertions, 21 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 78248d57729..2d166ca8b10 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -152,9 +152,6 @@ struct btrfs_path { | |||
152 | int slots[BTRFS_MAX_LEVEL]; | 152 | int slots[BTRFS_MAX_LEVEL]; |
153 | }; | 153 | }; |
154 | 154 | ||
155 | /* values for the type field in btrfs_extent_item */ | ||
156 | #define BTRFS_EXTENT_TREE 1 | ||
157 | #define BTRFS_EXTENT_FILE 2 | ||
158 | /* | 155 | /* |
159 | * items in the extent btree are used to record the objectid of the | 156 | * items in the extent btree are used to record the objectid of the |
160 | * owner of the block and the number of references | 157 | * owner of the block and the number of references |
@@ -162,7 +159,6 @@ struct btrfs_path { | |||
162 | struct btrfs_extent_item { | 159 | struct btrfs_extent_item { |
163 | __le32 refs; | 160 | __le32 refs; |
164 | __le64 owner; | 161 | __le64 owner; |
165 | u8 type; | ||
166 | } __attribute__ ((__packed__)); | 162 | } __attribute__ ((__packed__)); |
167 | 163 | ||
168 | struct btrfs_inode_timespec { | 164 | struct btrfs_inode_timespec { |
@@ -489,16 +485,6 @@ static inline void btrfs_set_extent_owner(struct btrfs_extent_item *ei, u64 val) | |||
489 | ei->owner = cpu_to_le64(val); | 485 | ei->owner = cpu_to_le64(val); |
490 | } | 486 | } |
491 | 487 | ||
492 | static inline u8 btrfs_extent_type(struct btrfs_extent_item *ei) | ||
493 | { | ||
494 | return ei->type; | ||
495 | } | ||
496 | |||
497 | static inline void btrfs_set_extent_type(struct btrfs_extent_item *ei, u8 val) | ||
498 | { | ||
499 | ei->type = val; | ||
500 | } | ||
501 | |||
502 | static inline u64 btrfs_node_blockptr(struct btrfs_node *n, int nr) | 488 | static inline u64 btrfs_node_blockptr(struct btrfs_node *n, int nr) |
503 | { | 489 | { |
504 | return le64_to_cpu(n->ptrs[nr].blockptr); | 490 | return le64_to_cpu(n->ptrs[nr].blockptr); |
@@ -1036,7 +1022,7 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | |||
1036 | struct btrfs_root *root); | 1022 | struct btrfs_root *root); |
1037 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, | 1023 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, |
1038 | struct btrfs_root *root, u64 owner, | 1024 | struct btrfs_root *root, u64 owner, |
1039 | u8 type, u64 num_blocks, u64 search_start, | 1025 | u64 num_blocks, u64 search_start, |
1040 | u64 search_end, struct btrfs_key *ins); | 1026 | u64 search_end, struct btrfs_key *ins); |
1041 | int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, | 1027 | int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
1042 | struct buffer_head *buf); | 1028 | struct buffer_head *buf); |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index aac3eccffb8..116519503d0 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -167,7 +167,6 @@ 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 | btrfs_set_extent_owner(&extent_item, extent_root->root_key.objectid); |
172 | 171 | ||
173 | for (i = 0; i < extent_root->fs_info->current_insert.flags; i++) { | 172 | for (i = 0; i < extent_root->fs_info->current_insert.flags; i++) { |
@@ -464,7 +463,7 @@ error: | |||
464 | */ | 463 | */ |
465 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, | 464 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, |
466 | struct btrfs_root *root, u64 owner, | 465 | struct btrfs_root *root, u64 owner, |
467 | u8 type, u64 num_blocks, u64 search_start, | 466 | u64 num_blocks, u64 search_start, |
468 | u64 search_end, struct btrfs_key *ins) | 467 | u64 search_end, struct btrfs_key *ins) |
469 | { | 468 | { |
470 | int ret; | 469 | int ret; |
@@ -476,7 +475,6 @@ int btrfs_alloc_extent(struct btrfs_trans_handle *trans, | |||
476 | 475 | ||
477 | btrfs_set_extent_refs(&extent_item, 1); | 476 | btrfs_set_extent_refs(&extent_item, 1); |
478 | btrfs_set_extent_owner(&extent_item, owner); | 477 | btrfs_set_extent_owner(&extent_item, owner); |
479 | btrfs_set_extent_type(&extent_item, type); | ||
480 | 478 | ||
481 | if (root == extent_root) { | 479 | if (root == extent_root) { |
482 | BUG_ON(extent_root->fs_info->current_insert.offset == 0); | 480 | BUG_ON(extent_root->fs_info->current_insert.offset == 0); |
@@ -520,7 +518,6 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | |||
520 | struct buffer_head *buf; | 518 | struct buffer_head *buf; |
521 | 519 | ||
522 | ret = btrfs_alloc_extent(trans, root, root->root_key.objectid, | 520 | ret = btrfs_alloc_extent(trans, root, root->root_key.objectid, |
523 | BTRFS_EXTENT_TREE, | ||
524 | 1, 0, (unsigned long)-1, &ins); | 521 | 1, 0, (unsigned long)-1, &ins); |
525 | if (ret) { | 522 | if (ret) { |
526 | BUG(); | 523 | BUG(); |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 43f081593c4..c076474c8bf 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -1830,8 +1830,7 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf, | |||
1830 | if (inode->i_size >= PAGE_CACHE_SIZE || pos + count < inode->i_size || | 1830 | if (inode->i_size >= PAGE_CACHE_SIZE || pos + count < inode->i_size || |
1831 | pos + count - start_pos > BTRFS_MAX_INLINE_DATA_SIZE(root)) { | 1831 | pos + count - start_pos > BTRFS_MAX_INLINE_DATA_SIZE(root)) { |
1832 | ret = btrfs_alloc_extent(trans, root, inode->i_ino, | 1832 | ret = btrfs_alloc_extent(trans, root, inode->i_ino, |
1833 | BTRFS_EXTENT_FILE, num_blocks, 1, | 1833 | num_blocks, 1, (u64)-1, &ins); |
1834 | (u64)-1, &ins); | ||
1835 | BUG_ON(ret); | 1834 | BUG_ON(ret); |
1836 | ret = btrfs_insert_file_extent(trans, root, inode->i_ino, | 1835 | ret = btrfs_insert_file_extent(trans, root, inode->i_ino, |
1837 | start_pos, ins.objectid, ins.offset); | 1836 | start_pos, ins.objectid, ins.offset); |