int slots[BTRFS_MAX_LEVEL];
};
-/* values for the type field in btrfs_extent_item */
-#define BTRFS_EXTENT_TREE 1
-#define BTRFS_EXTENT_FILE 2
/*
* items in the extent btree are used to record the objectid of the
* owner of the block and the number of references
struct btrfs_extent_item {
__le32 refs;
__le64 owner;
- u8 type;
} __attribute__ ((__packed__));
struct btrfs_inode_timespec {
ei->owner = cpu_to_le64(val);
}
-static inline u8 btrfs_extent_type(struct btrfs_extent_item *ei)
-{
- return ei->type;
-}
-
-static inline void btrfs_set_extent_type(struct btrfs_extent_item *ei, u8 val)
-{
- ei->type = val;
-}
-
static inline u64 btrfs_node_blockptr(struct btrfs_node *n, int nr)
{
return le64_to_cpu(n->ptrs[nr].blockptr);
struct btrfs_root *root);
int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
struct btrfs_root *root, u64 owner,
- u8 type, u64 num_blocks, u64 search_start,
+ u64 num_blocks, u64 search_start,
u64 search_end, struct btrfs_key *ins);
int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
struct buffer_head *buf);
ins.offset = 1;
ins.flags = 0;
btrfs_set_key_type(&ins, BTRFS_EXTENT_ITEM_KEY);
- btrfs_set_extent_type(&extent_item, BTRFS_EXTENT_TREE);
btrfs_set_extent_owner(&extent_item, extent_root->root_key.objectid);
for (i = 0; i < extent_root->fs_info->current_insert.flags; i++) {
*/
int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
struct btrfs_root *root, u64 owner,
- u8 type, u64 num_blocks, u64 search_start,
+ u64 num_blocks, u64 search_start,
u64 search_end, struct btrfs_key *ins)
{
int ret;
btrfs_set_extent_refs(&extent_item, 1);
btrfs_set_extent_owner(&extent_item, owner);
- btrfs_set_extent_type(&extent_item, type);
if (root == extent_root) {
BUG_ON(extent_root->fs_info->current_insert.offset == 0);
struct buffer_head *buf;
ret = btrfs_alloc_extent(trans, root, root->root_key.objectid,
- BTRFS_EXTENT_TREE,
1, 0, (unsigned long)-1, &ins);
if (ret) {
BUG();
if (inode->i_size >= PAGE_CACHE_SIZE || pos + count < inode->i_size ||
pos + count - start_pos > BTRFS_MAX_INLINE_DATA_SIZE(root)) {
ret = btrfs_alloc_extent(trans, root, inode->i_ino,
- BTRFS_EXTENT_FILE, num_blocks, 1,
- (u64)-1, &ins);
+ num_blocks, 1, (u64)-1, &ins);
BUG_ON(ret);
ret = btrfs_insert_file_extent(trans, root, inode->i_ino,
start_pos, ins.objectid, ins.offset);