Lines Matching refs:root

22 int btrfs_readlink(struct btrfs_root *root, u64 ino, char *target)  in btrfs_readlink()  argument
34 ret = btrfs_search_slot(NULL, root, &key, &path, 0, 0); in btrfs_readlink()
56 root->fs_info->sectorsize) { in btrfs_readlink()
74 struct btrfs_root *root = fs_info->tree_root; in lookup_root_ref() local
85 ret = btrfs_search_slot(NULL, root, &key, &path, 0, 0); in lookup_root_ref()
93 ret = btrfs_previous_item(root, &path, rootid, BTRFS_ROOT_BACKREF_KEY); in lookup_root_ref()
119 static int get_parent_inode(struct btrfs_root *root, u64 ino, in get_parent_inode() argument
122 struct btrfs_fs_info *fs_info = root->fs_info; in get_parent_inode()
131 if (root->root_key.objectid == BTRFS_FS_TREE_OBJECTID) { in get_parent_inode()
137 ret = lookup_root_ref(fs_info, root->root_key.objectid, in get_parent_inode()
157 ret = btrfs_search_slot(NULL, root, &key, &path, 0, 0); in get_parent_inode()
165 ret = btrfs_previous_item(root, &path, ino, BTRFS_INODE_REF_KEY); in get_parent_inode()
173 *root_ret = root; in get_parent_inode()
215 static int resolve_one_filename(struct btrfs_root *root, u64 ino, in resolve_one_filename() argument
225 dir_item = btrfs_lookup_dir_item(NULL, root, &path, ino, name, in resolve_one_filename()
244 int btrfs_lookup_path(struct btrfs_root *root, u64 ino, const char *filename, in btrfs_lookup_path() argument
248 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_lookup_path()
260 root = fs_info->fs_root; in btrfs_lookup_path()
261 ino = btrfs_root_dirid(&root->root_item); in btrfs_lookup_path()
280 ret = get_parent_inode(root, ino, &next_root, &next_ino); in btrfs_lookup_path()
283 root = next_root; in btrfs_lookup_path()
291 ret = resolve_one_filename(root, ino, cur, len, &key, &type); in btrfs_lookup_path()
301 root = next_root; in btrfs_lookup_path()
302 ino = btrfs_root_dirid(&root->root_item); in btrfs_lookup_path()
315 ret = btrfs_readlink(root, key.objectid, target); in btrfs_lookup_path()
322 ret = btrfs_lookup_path(root, ino, target, &next_root, in btrfs_lookup_path()
327 root = next_root; in btrfs_lookup_path()
343 *root_ret = root; in btrfs_lookup_path()
520 static int lookup_data_extent(struct btrfs_root *root, struct btrfs_path *path, in lookup_data_extent() argument
528 ASSERT(IS_ALIGNED(file_offset, root->fs_info->sectorsize)); in lookup_data_extent()
533 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in lookup_data_extent()
539 ret = btrfs_previous_item(root, path, ino, in lookup_data_extent()
568 ret = btrfs_next_item(root, path); in lookup_data_extent()
595 ret = btrfs_next_item(root, path); in lookup_data_extent()
649 int btrfs_file_read(struct btrfs_root *root, u64 ino, u64 file_offset, u64 len, in btrfs_file_read() argument
652 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_file_read()
669 ret = lookup_data_extent(root, &path, ino, aligned_start, in btrfs_file_read()
699 ret = lookup_data_extent(root, &path, ino, cur, &next_offset); in btrfs_file_read()
739 ret = lookup_data_extent(root, &path, ino, aligned_end, in btrfs_file_read()