Lines Matching refs:path
76 struct btrfs_path *path, in btrfs_lookup_inode_extref() argument
88 ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow); in btrfs_lookup_inode_extref()
93 return btrfs_find_name_in_ext_backref(path->nodes[0], path->slots[0], in btrfs_lookup_inode_extref()
104 struct btrfs_path *path; in btrfs_del_inode_extref() local
118 path = btrfs_alloc_path(); in btrfs_del_inode_extref()
119 if (!path) in btrfs_del_inode_extref()
122 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_del_inode_extref()
133 extref = btrfs_find_name_in_ext_backref(path->nodes[0], path->slots[0], in btrfs_del_inode_extref()
141 leaf = path->nodes[0]; in btrfs_del_inode_extref()
142 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_del_inode_extref()
151 ret = btrfs_del_item(trans, root, path); in btrfs_del_inode_extref()
156 item_start = btrfs_item_ptr_offset(leaf, path->slots[0]); in btrfs_del_inode_extref()
161 btrfs_truncate_item(path, item_size - del_len, 1); in btrfs_del_inode_extref()
164 btrfs_free_path(path); in btrfs_del_inode_extref()
174 struct btrfs_path *path; in btrfs_del_inode_ref() local
190 path = btrfs_alloc_path(); in btrfs_del_inode_ref()
191 if (!path) in btrfs_del_inode_ref()
194 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_del_inode_ref()
203 ref = btrfs_find_name_in_backref(path->nodes[0], path->slots[0], name, in btrfs_del_inode_ref()
210 leaf = path->nodes[0]; in btrfs_del_inode_ref()
211 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_del_inode_ref()
217 ret = btrfs_del_item(trans, root, path); in btrfs_del_inode_ref()
222 item_start = btrfs_item_ptr_offset(leaf, path->slots[0]); in btrfs_del_inode_ref()
225 btrfs_truncate_item(path, item_size - sub_item_len, 1); in btrfs_del_inode_ref()
227 btrfs_free_path(path); in btrfs_del_inode_ref()
256 struct btrfs_path *path; in btrfs_insert_inode_extref() local
265 path = btrfs_alloc_path(); in btrfs_insert_inode_extref()
266 if (!path) in btrfs_insert_inode_extref()
269 ret = btrfs_insert_empty_item(trans, root, path, &key, in btrfs_insert_inode_extref()
272 if (btrfs_find_name_in_ext_backref(path->nodes[0], in btrfs_insert_inode_extref()
273 path->slots[0], in btrfs_insert_inode_extref()
278 btrfs_extend_item(path, ins_len); in btrfs_insert_inode_extref()
284 leaf = path->nodes[0]; in btrfs_insert_inode_extref()
285 item = btrfs_item_nr(path->slots[0]); in btrfs_insert_inode_extref()
286 ptr = (unsigned long)btrfs_item_ptr(leaf, path->slots[0], char); in btrfs_insert_inode_extref()
290 btrfs_set_inode_extref_name_len(path->nodes[0], extref, name_len); in btrfs_insert_inode_extref()
291 btrfs_set_inode_extref_index(path->nodes[0], extref, index); in btrfs_insert_inode_extref()
292 btrfs_set_inode_extref_parent(path->nodes[0], extref, ref_objectid); in btrfs_insert_inode_extref()
295 write_extent_buffer(path->nodes[0], name, ptr, name_len); in btrfs_insert_inode_extref()
296 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_insert_inode_extref()
299 btrfs_free_path(path); in btrfs_insert_inode_extref()
310 struct btrfs_path *path; in btrfs_insert_inode_ref() local
321 path = btrfs_alloc_path(); in btrfs_insert_inode_ref()
322 if (!path) in btrfs_insert_inode_ref()
325 path->skip_release_on_error = 1; in btrfs_insert_inode_ref()
326 ret = btrfs_insert_empty_item(trans, root, path, &key, in btrfs_insert_inode_ref()
330 ref = btrfs_find_name_in_backref(path->nodes[0], path->slots[0], in btrfs_insert_inode_ref()
335 old_size = btrfs_item_size_nr(path->nodes[0], path->slots[0]); in btrfs_insert_inode_ref()
336 btrfs_extend_item(path, ins_len); in btrfs_insert_inode_ref()
337 ref = btrfs_item_ptr(path->nodes[0], path->slots[0], in btrfs_insert_inode_ref()
340 btrfs_set_inode_ref_name_len(path->nodes[0], ref, name_len); in btrfs_insert_inode_ref()
341 btrfs_set_inode_ref_index(path->nodes[0], ref, index); in btrfs_insert_inode_ref()
346 if (btrfs_find_name_in_backref(path->nodes[0], in btrfs_insert_inode_ref()
347 path->slots[0], in btrfs_insert_inode_ref()
355 ref = btrfs_item_ptr(path->nodes[0], path->slots[0], in btrfs_insert_inode_ref()
357 btrfs_set_inode_ref_name_len(path->nodes[0], ref, name_len); in btrfs_insert_inode_ref()
358 btrfs_set_inode_ref_index(path->nodes[0], ref, index); in btrfs_insert_inode_ref()
361 write_extent_buffer(path->nodes[0], name, ptr, name_len); in btrfs_insert_inode_ref()
362 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_insert_inode_ref()
365 btrfs_free_path(path); in btrfs_insert_inode_ref()
384 struct btrfs_path *path, u64 objectid) in btrfs_insert_empty_inode() argument
392 ret = btrfs_insert_empty_item(trans, root, path, &key, in btrfs_insert_empty_inode()
398 *root, struct btrfs_path *path, in btrfs_lookup_inode() argument
408 ret = btrfs_search_slot(trans, root, location, path, ins_len, cow); in btrfs_lookup_inode()
410 location->offset == (u64)-1 && path->slots[0] != 0) { in btrfs_lookup_inode()
411 slot = path->slots[0] - 1; in btrfs_lookup_inode()
412 leaf = path->nodes[0]; in btrfs_lookup_inode()
416 path->slots[0]--; in btrfs_lookup_inode()