7 struct btrfs_trans_handle;
8 struct btrfs_transaction;
10 #define BTRFS_MAGIC "_BtRfS_M"
12 #define BTRFS_ROOT_TREE_OBJECTID 1ULL
13 #define BTRFS_EXTENT_TREE_OBJECTID 2ULL
14 #define BTRFS_INODE_MAP_OBJECTID 3ULL
15 #define BTRFS_FS_TREE_OBJECTID 4ULL
16 #define BTRFS_FIRST_FREE_OBJECTID 5ULL
19 * we can actually store much bigger names, but lets not confuse the rest
22 #define BTRFS_NAME_LEN 255
25 * the key defines the order in the tree, and so it also defines (optimal)
26 * block layout. objectid corresonds to the inode number. The flags
27 * tells us things about the object, and is a kind of stream selector.
28 * so for a given inode, keys with flags of 1 might refer to the inode
29 * data, flags of 2 may point to file data in the btree and flags == 3
30 * may point to extents.
32 * offset is the starting byte offset for this key in the stream.
34 * btrfs_disk_key is in disk byte order. struct btrfs_key is always
35 * in cpu native order. Otherwise they are identical and their sizes
36 * should be the same (ie both packed)
38 struct btrfs_disk_key {
42 } __attribute__ ((__packed__));
48 } __attribute__ ((__packed__));
51 * every tree block (leaf or node) starts with this header.
54 u8 fsid[16]; /* FS specific uuid */
55 __le64 blocknr; /* which block this node is supposed to live in */
57 __le64 parentid; /* objectid of the tree root */
63 } __attribute__ ((__packed__));
65 #define BTRFS_MAX_LEVEL 8
66 #define BTRFS_NODEPTRS_PER_BLOCK(r) (((r)->blocksize - \
67 sizeof(struct btrfs_header)) / \
68 (sizeof(struct btrfs_disk_key) + sizeof(u64)))
69 #define __BTRFS_LEAF_DATA_SIZE(bs) ((bs) - sizeof(struct btrfs_header))
70 #define BTRFS_LEAF_DATA_SIZE(r) (__BTRFS_LEAF_DATA_SIZE(r->blocksize))
74 * the super block basically lists the main trees of the FS
75 * it currently lacks any block count etc etc
77 struct btrfs_super_block {
78 u8 fsid[16]; /* FS specific uuid */
79 __le64 blocknr; /* this block number */
87 __le64 root_dir_objectid;
88 } __attribute__ ((__packed__));
91 * A leaf is full of items. offset and size tell us where to find
92 * the item in the leaf (relative to the start of the data area)
95 struct btrfs_disk_key key;
98 } __attribute__ ((__packed__));
101 * leaves have an item area and a data area:
102 * [item0, item1....itemN] [free space] [dataN...data1, data0]
104 * The data is separate from the items to get the keys closer together
108 struct btrfs_header header;
109 struct btrfs_item items[];
110 } __attribute__ ((__packed__));
113 * all non-leaf blocks are nodes, they hold only keys and pointers to
116 struct btrfs_key_ptr {
117 struct btrfs_disk_key key;
119 } __attribute__ ((__packed__));
122 struct btrfs_header header;
123 struct btrfs_key_ptr ptrs[];
124 } __attribute__ ((__packed__));
127 * btrfs_paths remember the path taken from the root down to the leaf.
128 * level 0 is always the leaf, and nodes[1...BTRFS_MAX_LEVEL] will point
129 * to any other levels that are present.
131 * The slots array records the index of the item or block pointer
132 * used while walking the tree.
135 struct buffer_head *nodes[BTRFS_MAX_LEVEL];
136 int slots[BTRFS_MAX_LEVEL];
140 * items in the extent btree are used to record the objectid of the
141 * owner of the block and the number of references
143 struct btrfs_extent_item {
146 } __attribute__ ((__packed__));
148 struct btrfs_inode_timespec {
151 } __attribute__ ((__packed__));
154 * there is no padding here on purpose. If you want to extent the inode,
155 * make a new item type
157 struct btrfs_inode_item {
168 struct btrfs_inode_timespec atime;
169 struct btrfs_inode_timespec ctime;
170 struct btrfs_inode_timespec mtime;
171 struct btrfs_inode_timespec otime;
172 } __attribute__ ((__packed__));
174 /* inline data is just a blob of bytes */
175 struct btrfs_inline_data_item {
177 } __attribute__ ((__packed__));
179 struct btrfs_dir_item {
184 } __attribute__ ((__packed__));
186 struct btrfs_root_item {
192 } __attribute__ ((__packed__));
194 struct btrfs_file_extent_item {
197 * disk space consumed by the extent, checksum blocks are included
201 __le64 disk_num_blocks;
203 * the logical offset in file blocks (no csums)
204 * this extent record is for. This allows a file extent to point
205 * into the middle of an existing extent on disk, sharing it
206 * between two snapshots (useful if some bytes in the middle of the
207 * extent have changed
211 * the logical number of file blocks (no csums included)
214 } __attribute__ ((__packed__));
216 struct btrfs_inode_map_item {
217 struct btrfs_disk_key key;
218 } __attribute__ ((__packed__));
220 struct btrfs_fs_info {
221 struct btrfs_root *fs_root;
222 struct btrfs_root *extent_root;
223 struct btrfs_root *tree_root;
224 struct btrfs_root *inode_root;
225 struct btrfs_key current_insert;
226 struct btrfs_key last_insert;
227 struct radix_tree_root pending_del_radix;
228 struct radix_tree_root pinned_radix;
229 u64 last_inode_alloc;
230 u64 last_inode_alloc_dirid;
232 struct btrfs_transaction *running_transaction;
233 struct btrfs_super_block *disk_super;
234 struct buffer_head *sb_buffer;
235 struct super_block *sb;
236 struct inode *btree_inode;
237 struct mutex trans_mutex;
238 struct mutex fs_mutex;
242 * in ram representation of the tree. extent_root is used for all allocations
243 * and for the extent tree extent_root root. current_insert is used
244 * only for the extent tree.
247 struct buffer_head *node;
248 struct buffer_head *commit_root;
249 struct btrfs_root_item root_item;
250 struct btrfs_key root_key;
251 struct btrfs_fs_info *fs_info;
257 /* the lower bits in the key flags defines the item type */
258 #define BTRFS_KEY_TYPE_MAX 256
259 #define BTRFS_KEY_TYPE_MASK (BTRFS_KEY_TYPE_MAX - 1)
262 * inode items have the data typically returned from stat and store other
263 * info about object characteristics. There is one for every file and dir in
266 #define BTRFS_INODE_ITEM_KEY 1
269 * dir items are the name -> inode pointers in a directory. There is one
270 * for every name in a directory.
272 #define BTRFS_DIR_ITEM_KEY 2
274 * inline data is file data that fits in the btree.
276 #define BTRFS_INLINE_DATA_KEY 3
278 * extent data is for data that can't fit in the btree. It points to
279 * a (hopefully) huge chunk of disk
281 #define BTRFS_EXTENT_DATA_KEY 4
283 * root items point to tree roots. There are typically in the root
284 * tree used by the super block to find all the other trees
286 #define BTRFS_ROOT_ITEM_KEY 5
288 * extent items are in the extent map tree. These record which blocks
289 * are used, and how many references there are to each block
291 #define BTRFS_EXTENT_ITEM_KEY 6
294 * the inode map records which inode numbers are in use and where
295 * they actually live on disk
297 #define BTRFS_INODE_MAP_ITEM_KEY 7
299 * string items are for debugging. They just store a short string of
302 #define BTRFS_STRING_ITEM_KEY 8
304 static inline u64 btrfs_inode_generation(struct btrfs_inode_item *i)
306 return le64_to_cpu(i->generation);
309 static inline void btrfs_set_inode_generation(struct btrfs_inode_item *i,
312 i->generation = cpu_to_le64(val);
315 static inline u64 btrfs_inode_size(struct btrfs_inode_item *i)
317 return le64_to_cpu(i->size);
320 static inline void btrfs_set_inode_size(struct btrfs_inode_item *i, u64 val)
322 i->size = cpu_to_le64(val);
325 static inline u64 btrfs_inode_nblocks(struct btrfs_inode_item *i)
327 return le64_to_cpu(i->nblocks);
330 static inline void btrfs_set_inode_nblocks(struct btrfs_inode_item *i, u64 val)
332 i->nblocks = cpu_to_le64(val);
335 static inline u32 btrfs_inode_nlink(struct btrfs_inode_item *i)
337 return le32_to_cpu(i->nlink);
340 static inline void btrfs_set_inode_nlink(struct btrfs_inode_item *i, u32 val)
342 i->nlink = cpu_to_le32(val);
345 static inline u32 btrfs_inode_uid(struct btrfs_inode_item *i)
347 return le32_to_cpu(i->uid);
350 static inline void btrfs_set_inode_uid(struct btrfs_inode_item *i, u32 val)
352 i->uid = cpu_to_le32(val);
355 static inline u32 btrfs_inode_gid(struct btrfs_inode_item *i)
357 return le32_to_cpu(i->gid);
360 static inline void btrfs_set_inode_gid(struct btrfs_inode_item *i, u32 val)
362 i->gid = cpu_to_le32(val);
365 static inline u32 btrfs_inode_mode(struct btrfs_inode_item *i)
367 return le32_to_cpu(i->mode);
370 static inline void btrfs_set_inode_mode(struct btrfs_inode_item *i, u32 val)
372 i->mode = cpu_to_le32(val);
375 static inline u32 btrfs_inode_rdev(struct btrfs_inode_item *i)
377 return le32_to_cpu(i->rdev);
380 static inline void btrfs_set_inode_rdev(struct btrfs_inode_item *i, u32 val)
382 i->rdev = cpu_to_le32(val);
385 static inline u16 btrfs_inode_flags(struct btrfs_inode_item *i)
387 return le16_to_cpu(i->flags);
390 static inline void btrfs_set_inode_flags(struct btrfs_inode_item *i, u16 val)
392 i->flags = cpu_to_le16(val);
395 static inline u16 btrfs_inode_compat_flags(struct btrfs_inode_item *i)
397 return le16_to_cpu(i->compat_flags);
400 static inline void btrfs_set_inode_compat_flags(struct btrfs_inode_item *i,
403 i->compat_flags = cpu_to_le16(val);
406 static inline u32 btrfs_timespec_sec(struct btrfs_inode_timespec *ts)
408 return le32_to_cpu(ts->sec);
411 static inline void btrfs_set_timespec_sec(struct btrfs_inode_timespec *ts,
414 ts->sec = cpu_to_le32(val);
417 static inline u32 btrfs_timespec_nsec(struct btrfs_inode_timespec *ts)
419 return le32_to_cpu(ts->nsec);
422 static inline void btrfs_set_timespec_nsec(struct btrfs_inode_timespec *ts,
425 ts->nsec = cpu_to_le32(val);
430 static inline u64 btrfs_extent_owner(struct btrfs_extent_item *ei)
432 return le64_to_cpu(ei->owner);
435 static inline void btrfs_set_extent_owner(struct btrfs_extent_item *ei, u64 val)
437 ei->owner = cpu_to_le64(val);
440 static inline u32 btrfs_extent_refs(struct btrfs_extent_item *ei)
442 return le32_to_cpu(ei->refs);
445 static inline void btrfs_set_extent_refs(struct btrfs_extent_item *ei, u32 val)
447 ei->refs = cpu_to_le32(val);
450 static inline u64 btrfs_node_blockptr(struct btrfs_node *n, int nr)
452 return le64_to_cpu(n->ptrs[nr].blockptr);
455 static inline void btrfs_set_node_blockptr(struct btrfs_node *n, int nr,
458 n->ptrs[nr].blockptr = cpu_to_le64(val);
461 static inline u32 btrfs_item_offset(struct btrfs_item *item)
463 return le32_to_cpu(item->offset);
466 static inline void btrfs_set_item_offset(struct btrfs_item *item, u32 val)
468 item->offset = cpu_to_le32(val);
471 static inline u32 btrfs_item_end(struct btrfs_item *item)
473 return le32_to_cpu(item->offset) + le16_to_cpu(item->size);
476 static inline u16 btrfs_item_size(struct btrfs_item *item)
478 return le16_to_cpu(item->size);
481 static inline void btrfs_set_item_size(struct btrfs_item *item, u16 val)
483 item->size = cpu_to_le16(val);
486 static inline u64 btrfs_dir_objectid(struct btrfs_dir_item *d)
488 return le64_to_cpu(d->objectid);
491 static inline void btrfs_set_dir_objectid(struct btrfs_dir_item *d, u64 val)
493 d->objectid = cpu_to_le64(val);
496 static inline u16 btrfs_dir_flags(struct btrfs_dir_item *d)
498 return le16_to_cpu(d->flags);
501 static inline void btrfs_set_dir_flags(struct btrfs_dir_item *d, u16 val)
503 d->flags = cpu_to_le16(val);
506 static inline u8 btrfs_dir_type(struct btrfs_dir_item *d)
511 static inline void btrfs_set_dir_type(struct btrfs_dir_item *d, u8 val)
516 static inline u16 btrfs_dir_name_len(struct btrfs_dir_item *d)
518 return le16_to_cpu(d->name_len);
521 static inline void btrfs_set_dir_name_len(struct btrfs_dir_item *d, u16 val)
523 d->name_len = cpu_to_le16(val);
526 static inline void btrfs_disk_key_to_cpu(struct btrfs_key *cpu,
527 struct btrfs_disk_key *disk)
529 cpu->offset = le64_to_cpu(disk->offset);
530 cpu->flags = le32_to_cpu(disk->flags);
531 cpu->objectid = le64_to_cpu(disk->objectid);
534 static inline void btrfs_cpu_key_to_disk(struct btrfs_disk_key *disk,
535 struct btrfs_key *cpu)
537 disk->offset = cpu_to_le64(cpu->offset);
538 disk->flags = cpu_to_le32(cpu->flags);
539 disk->objectid = cpu_to_le64(cpu->objectid);
542 static inline u64 btrfs_disk_key_objectid(struct btrfs_disk_key *disk)
544 return le64_to_cpu(disk->objectid);
547 static inline void btrfs_set_disk_key_objectid(struct btrfs_disk_key *disk,
550 disk->objectid = cpu_to_le64(val);
553 static inline u64 btrfs_disk_key_offset(struct btrfs_disk_key *disk)
555 return le64_to_cpu(disk->offset);
558 static inline void btrfs_set_disk_key_offset(struct btrfs_disk_key *disk,
561 disk->offset = cpu_to_le64(val);
564 static inline u32 btrfs_disk_key_flags(struct btrfs_disk_key *disk)
566 return le32_to_cpu(disk->flags);
569 static inline void btrfs_set_disk_key_flags(struct btrfs_disk_key *disk,
572 disk->flags = cpu_to_le32(val);
575 static inline u32 btrfs_key_type(struct btrfs_key *key)
577 return key->flags & BTRFS_KEY_TYPE_MASK;
580 static inline u32 btrfs_disk_key_type(struct btrfs_disk_key *key)
582 return le32_to_cpu(key->flags) & BTRFS_KEY_TYPE_MASK;
585 static inline void btrfs_set_key_type(struct btrfs_key *key, u32 type)
587 BUG_ON(type >= BTRFS_KEY_TYPE_MAX);
588 key->flags = (key->flags & ~((u64)BTRFS_KEY_TYPE_MASK)) | type;
591 static inline void btrfs_set_disk_key_type(struct btrfs_disk_key *key, u32 type)
593 u32 flags = btrfs_disk_key_flags(key);
594 BUG_ON(type >= BTRFS_KEY_TYPE_MAX);
595 flags = (flags & ~((u64)BTRFS_KEY_TYPE_MASK)) | type;
596 btrfs_set_disk_key_flags(key, flags);
599 static inline u64 btrfs_header_blocknr(struct btrfs_header *h)
601 return le64_to_cpu(h->blocknr);
604 static inline void btrfs_set_header_blocknr(struct btrfs_header *h, u64 blocknr)
606 h->blocknr = cpu_to_le64(blocknr);
609 static inline u64 btrfs_header_generation(struct btrfs_header *h)
611 return le64_to_cpu(h->generation);
614 static inline void btrfs_set_header_generation(struct btrfs_header *h,
617 h->generation = cpu_to_le64(val);
620 static inline u64 btrfs_header_parentid(struct btrfs_header *h)
622 return le64_to_cpu(h->parentid);
625 static inline void btrfs_set_header_parentid(struct btrfs_header *h,
628 h->parentid = cpu_to_le64(parentid);
631 static inline u16 btrfs_header_nritems(struct btrfs_header *h)
633 return le16_to_cpu(h->nritems);
636 static inline void btrfs_set_header_nritems(struct btrfs_header *h, u16 val)
638 h->nritems = cpu_to_le16(val);
641 static inline u16 btrfs_header_flags(struct btrfs_header *h)
643 return le16_to_cpu(h->flags);
646 static inline void btrfs_set_header_flags(struct btrfs_header *h, u16 val)
648 h->flags = cpu_to_le16(val);
651 static inline int btrfs_header_level(struct btrfs_header *h)
656 static inline void btrfs_set_header_level(struct btrfs_header *h, int level)
658 BUG_ON(level > BTRFS_MAX_LEVEL);
662 static inline int btrfs_is_leaf(struct btrfs_node *n)
664 return (btrfs_header_level(&n->header) == 0);
667 static inline u64 btrfs_root_blocknr(struct btrfs_root_item *item)
669 return le64_to_cpu(item->blocknr);
672 static inline void btrfs_set_root_blocknr(struct btrfs_root_item *item, u64 val)
674 item->blocknr = cpu_to_le64(val);
677 static inline u32 btrfs_root_refs(struct btrfs_root_item *item)
679 return le32_to_cpu(item->refs);
682 static inline void btrfs_set_root_refs(struct btrfs_root_item *item, u32 val)
684 item->refs = cpu_to_le32(val);
687 static inline u64 btrfs_super_blocknr(struct btrfs_super_block *s)
689 return le64_to_cpu(s->blocknr);
692 static inline void btrfs_set_super_blocknr(struct btrfs_super_block *s, u64 val)
694 s->blocknr = cpu_to_le64(val);
697 static inline u64 btrfs_super_root(struct btrfs_super_block *s)
699 return le64_to_cpu(s->root);
702 static inline void btrfs_set_super_root(struct btrfs_super_block *s, u64 val)
704 s->root = cpu_to_le64(val);
707 static inline u64 btrfs_super_total_blocks(struct btrfs_super_block *s)
709 return le64_to_cpu(s->total_blocks);
712 static inline void btrfs_set_super_total_blocks(struct btrfs_super_block *s,
715 s->total_blocks = cpu_to_le64(val);
718 static inline u64 btrfs_super_blocks_used(struct btrfs_super_block *s)
720 return le64_to_cpu(s->blocks_used);
723 static inline void btrfs_set_super_blocks_used(struct btrfs_super_block *s,
726 s->blocks_used = cpu_to_le64(val);
729 static inline u32 btrfs_super_blocksize(struct btrfs_super_block *s)
731 return le32_to_cpu(s->blocksize);
734 static inline void btrfs_set_super_blocksize(struct btrfs_super_block *s,
737 s->blocksize = cpu_to_le32(val);
740 static inline u64 btrfs_super_root_dir(struct btrfs_super_block *s)
742 return le64_to_cpu(s->root_dir_objectid);
745 static inline void btrfs_set_super_root_dir(struct btrfs_super_block *s, u64
748 s->root_dir_objectid = cpu_to_le64(val);
751 static inline u8 *btrfs_leaf_data(struct btrfs_leaf *l)
753 return (u8 *)l->items;
756 static inline u64 btrfs_file_extent_disk_blocknr(struct btrfs_file_extent_item
759 return le64_to_cpu(e->disk_blocknr);
762 static inline void btrfs_set_file_extent_disk_blocknr(struct
763 btrfs_file_extent_item
766 e->disk_blocknr = cpu_to_le64(val);
769 static inline u64 btrfs_file_extent_generation(struct btrfs_file_extent_item *e)
771 return le64_to_cpu(e->generation);
774 static inline void btrfs_set_file_extent_generation(struct
775 btrfs_file_extent_item *e,
778 e->generation = cpu_to_le64(val);
781 static inline u64 btrfs_file_extent_disk_num_blocks(struct
782 btrfs_file_extent_item *e)
784 return le64_to_cpu(e->disk_num_blocks);
787 static inline void btrfs_set_file_extent_disk_num_blocks(struct
788 btrfs_file_extent_item
791 e->disk_num_blocks = cpu_to_le64(val);
794 static inline u64 btrfs_file_extent_offset(struct btrfs_file_extent_item *e)
796 return le64_to_cpu(e->offset);
799 static inline void btrfs_set_file_extent_offset(struct btrfs_file_extent_item
802 e->offset = cpu_to_le64(val);
805 static inline u64 btrfs_file_extent_num_blocks(struct btrfs_file_extent_item
808 return le64_to_cpu(e->num_blocks);
811 static inline void btrfs_set_file_extent_num_blocks(struct
812 btrfs_file_extent_item *e,
815 e->num_blocks = cpu_to_le64(val);
818 static inline struct btrfs_root *btrfs_sb(struct super_block *sb)
820 return sb->s_fs_info;
823 /* helper function to cast into the data area of the leaf. */
824 #define btrfs_item_ptr(leaf, slot, type) \
825 ((type *)(btrfs_leaf_data(leaf) + \
826 btrfs_item_offset((leaf)->items + (slot))))
829 struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
830 struct btrfs_root *root);
831 int btrfs_alloc_extent(struct btrfs_trans_handle *trans, struct btrfs_root
832 *root, u64 num_blocks, u64 search_start, u64
833 search_end, u64 owner, struct btrfs_key *ins);
834 int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
835 struct buffer_head *buf);
836 int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
837 *root, u64 blocknr, u64 num_blocks, int pin);
838 int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct
841 int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
842 *root, struct btrfs_key *key, struct btrfs_path *p, int
844 void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p);
845 void btrfs_init_path(struct btrfs_path *p);
846 int btrfs_del_item(struct btrfs_trans_handle *trans, struct btrfs_root *root,
847 struct btrfs_path *path);
848 int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root
849 *root, struct btrfs_key *key, void *data, u32 data_size);
850 int btrfs_insert_empty_item(struct btrfs_trans_handle *trans, struct btrfs_root
851 *root, struct btrfs_path *path, struct btrfs_key
852 *cpu_key, u32 data_size);
853 int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path);
854 int btrfs_leaf_free_space(struct btrfs_root *root, struct btrfs_leaf *leaf);
855 int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
856 *root, struct buffer_head *snap);
858 int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
859 struct btrfs_key *key);
860 int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root
861 *root, struct btrfs_key *key, struct btrfs_root_item
863 int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
864 *root, struct btrfs_key *key, struct btrfs_root_item
866 int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct
867 btrfs_root_item *item, struct btrfs_key *key);
869 int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
870 *root, const char *name, int name_len, u64 dir, u64
872 int btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
873 *root, struct btrfs_path *path, u64 dir,
874 const char *name, int name_len, int mod);
875 int btrfs_match_dir_item_name(struct btrfs_root *root, struct btrfs_path *path,
876 const char *name, int name_len);
878 int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
879 struct btrfs_root *fs_root,
880 u64 dirid, u64 *objectid);
881 int btrfs_insert_inode_map(struct btrfs_trans_handle *trans,
882 struct btrfs_root *root,
883 u64 objectid, struct btrfs_key *location);
884 int btrfs_lookup_inode_map(struct btrfs_trans_handle *trans,
885 struct btrfs_root *root, struct btrfs_path *path,
886 u64 objectid, int mod);
888 int btrfs_insert_inode(struct btrfs_trans_handle *trans, struct btrfs_root
889 *root, u64 objectid, struct btrfs_inode_item
891 int btrfs_lookup_inode(struct btrfs_trans_handle *trans, struct btrfs_root
892 *root, struct btrfs_path *path, u64 objectid, int mod);
895 int btrfs_alloc_file_extent(struct btrfs_trans_handle *trans,
896 struct btrfs_root *root,
897 u64 objectid, u64 offset,
898 u64 num_blocks, u64 hint_block,
900 int btrfs_lookup_file_extent(struct btrfs_trans_handle *trans,
901 struct btrfs_root *root,
902 struct btrfs_path *path, u64 objectid,
903 u64 blocknr, int mod);