Skip to content

Commit c62a192

Browse files
chrismason-xxDavid Woodhouse
authored andcommitted
Btrfs: get rid of the extent_item type field
Signed-off-by: Chris Mason <[email protected]>
1 parent b513386 commit c62a192

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

fs/btrfs/ctree.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,13 @@ struct btrfs_path {
152152
int slots[BTRFS_MAX_LEVEL];
153153
};
154154

155-
/* values for the type field in btrfs_extent_item */
156-
#define BTRFS_EXTENT_TREE 1
157-
#define BTRFS_EXTENT_FILE 2
158155
/*
159156
* items in the extent btree are used to record the objectid of the
160157
* owner of the block and the number of references
161158
*/
162159
struct btrfs_extent_item {
163160
__le32 refs;
164161
__le64 owner;
165-
u8 type;
166162
} __attribute__ ((__packed__));
167163

168164
struct btrfs_inode_timespec {
@@ -489,16 +485,6 @@ static inline void btrfs_set_extent_owner(struct btrfs_extent_item *ei, u64 val)
489485
ei->owner = cpu_to_le64(val);
490486
}
491487

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-
502488
static inline u64 btrfs_node_blockptr(struct btrfs_node *n, int nr)
503489
{
504490
return le64_to_cpu(n->ptrs[nr].blockptr);
@@ -1036,7 +1022,7 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
10361022
struct btrfs_root *root);
10371023
int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
10381024
struct btrfs_root *root, u64 owner,
1039-
u8 type, u64 num_blocks, u64 search_start,
1025+
u64 num_blocks, u64 search_start,
10401026
u64 search_end, struct btrfs_key *ins);
10411027
int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
10421028
struct buffer_head *buf);

fs/btrfs/extent-tree.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, struct
167167
ins.offset = 1;
168168
ins.flags = 0;
169169
btrfs_set_key_type(&ins, BTRFS_EXTENT_ITEM_KEY);
170-
btrfs_set_extent_type(&extent_item, BTRFS_EXTENT_TREE);
171170
btrfs_set_extent_owner(&extent_item, extent_root->root_key.objectid);
172171

173172
for (i = 0; i < extent_root->fs_info->current_insert.flags; i++) {
@@ -464,7 +463,7 @@ static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
464463
*/
465464
int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
466465
struct btrfs_root *root, u64 owner,
467-
u8 type, u64 num_blocks, u64 search_start,
466+
u64 num_blocks, u64 search_start,
468467
u64 search_end, struct btrfs_key *ins)
469468
{
470469
int ret;
@@ -476,7 +475,6 @@ int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
476475

477476
btrfs_set_extent_refs(&extent_item, 1);
478477
btrfs_set_extent_owner(&extent_item, owner);
479-
btrfs_set_extent_type(&extent_item, type);
480478

481479
if (root == extent_root) {
482480
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,
520518
struct buffer_head *buf;
521519

522520
ret = btrfs_alloc_extent(trans, root, root->root_key.objectid,
523-
BTRFS_EXTENT_TREE,
524521
1, 0, (unsigned long)-1, &ins);
525522
if (ret) {
526523
BUG();

fs/btrfs/super.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,8 +1830,7 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
18301830
if (inode->i_size >= PAGE_CACHE_SIZE || pos + count < inode->i_size ||
18311831
pos + count - start_pos > BTRFS_MAX_INLINE_DATA_SIZE(root)) {
18321832
ret = btrfs_alloc_extent(trans, root, inode->i_ino,
1833-
BTRFS_EXTENT_FILE, num_blocks, 1,
1834-
(u64)-1, &ins);
1833+
num_blocks, 1, (u64)-1, &ins);
18351834
BUG_ON(ret);
18361835
ret = btrfs_insert_file_extent(trans, root, inode->i_ino,
18371836
start_pos, ins.objectid, ins.offset);

0 commit comments

Comments
 (0)