3 #include "kerncompat.h"
4 #include "radix-tree.h"
7 #include "transaction.h"
9 int btrfs_insert_inode(struct btrfs_trans_handle
*trans
, struct btrfs_root
10 *root
, u64 objectid
, struct btrfs_inode_item
13 struct btrfs_path path
;
16 key
.objectid
= objectid
;
18 btrfs_set_key_type(&key
, BTRFS_INODE_ITEM_KEY
);
21 btrfs_init_path(&path
);
22 ret
= btrfs_insert_item(trans
, root
, &key
, inode_item
,
24 btrfs_release_path(root
, &path
);
28 int btrfs_lookup_inode(struct btrfs_trans_handle
*trans
, struct btrfs_root
29 *root
, struct btrfs_path
*path
, u64 objectid
, int mod
)
32 int ins_len
= mod
< 0 ? -1 : 0;
35 key
.objectid
= objectid
;
37 btrfs_set_key_type(&key
, BTRFS_INODE_ITEM_KEY
);
39 return btrfs_search_slot(trans
, root
, &key
, path
, ins_len
, cow
);