Lines Matching refs:path

84 			  struct btrfs_path *path,
96 ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow);
101 return btrfs_find_name_in_ext_backref(path->nodes[0], path->slots[0],
112 struct btrfs_path *path;
126 path = btrfs_alloc_path();
127 if (!path)
130 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
141 extref = btrfs_find_name_in_ext_backref(path->nodes[0], path->slots[0],
149 leaf = path->nodes[0];
150 item_size = btrfs_item_size(leaf, path->slots[0]);
159 ret = btrfs_del_item(trans, root, path);
164 item_start = btrfs_item_ptr_offset(leaf, path->slots[0]);
169 btrfs_truncate_item(trans, path, item_size - del_len, 1);
172 btrfs_free_path(path);
181 struct btrfs_path *path;
197 path = btrfs_alloc_path();
198 if (!path)
201 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
210 ref = btrfs_find_name_in_backref(path->nodes[0], path->slots[0], name);
216 leaf = path->nodes[0];
217 item_size = btrfs_item_size(leaf, path->slots[0]);
223 ret = btrfs_del_item(trans, root, path);
228 item_start = btrfs_item_ptr_offset(leaf, path->slots[0]);
231 btrfs_truncate_item(trans, path, item_size - sub_item_len, 1);
233 btrfs_free_path(path);
263 struct btrfs_path *path;
271 path = btrfs_alloc_path();
272 if (!path)
275 ret = btrfs_insert_empty_item(trans, root, path, &key,
278 if (btrfs_find_name_in_ext_backref(path->nodes[0],
279 path->slots[0],
284 btrfs_extend_item(trans, path, ins_len);
290 leaf = path->nodes[0];
291 ptr = (unsigned long)btrfs_item_ptr(leaf, path->slots[0], char);
292 ptr += btrfs_item_size(leaf, path->slots[0]) - ins_len;
295 btrfs_set_inode_extref_name_len(path->nodes[0], extref, name->len);
296 btrfs_set_inode_extref_index(path->nodes[0], extref, index);
297 btrfs_set_inode_extref_parent(path->nodes[0], extref, ref_objectid);
300 write_extent_buffer(path->nodes[0], name->name, ptr, name->len);
301 btrfs_mark_buffer_dirty(trans, path->nodes[0]);
304 btrfs_free_path(path);
308 /* Will return 0, -ENOMEM, -EMLINK, or -EEXIST or anything from the CoW path */
314 struct btrfs_path *path;
325 path = btrfs_alloc_path();
326 if (!path)
329 path->skip_release_on_error = 1;
330 ret = btrfs_insert_empty_item(trans, root, path, &key,
334 ref = btrfs_find_name_in_backref(path->nodes[0], path->slots[0],
339 old_size = btrfs_item_size(path->nodes[0], path->slots[0]);
340 btrfs_extend_item(trans, path, ins_len);
341 ref = btrfs_item_ptr(path->nodes[0], path->slots[0],
344 btrfs_set_inode_ref_name_len(path->nodes[0], ref, name->len);
345 btrfs_set_inode_ref_index(path->nodes[0], ref, index);
350 if (btrfs_find_name_in_backref(path->nodes[0],
351 path->slots[0],
359 ref = btrfs_item_ptr(path->nodes[0], path->slots[0],
361 btrfs_set_inode_ref_name_len(path->nodes[0], ref, name->len);
362 btrfs_set_inode_ref_index(path->nodes[0], ref, index);
365 write_extent_buffer(path->nodes[0], name->name, ptr, name->len);
366 btrfs_mark_buffer_dirty(trans, path->nodes[0]);
369 btrfs_free_path(path);
387 struct btrfs_path *path, u64 objectid)
395 ret = btrfs_insert_empty_item(trans, root, path, &key,
401 *root, struct btrfs_path *path,
411 ret = btrfs_search_slot(trans, root, location, path, ins_len, cow);
413 location->offset == (u64)-1 && path->slots[0] != 0) {
414 slot = path->slots[0] - 1;
415 leaf = path->nodes[0];
419 path->slots[0]--;
463 struct btrfs_path *path;
494 path = btrfs_alloc_path();
495 if (!path)
497 path->reada = READA_BACK;
515 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
522 if (path->slots[0] == 0)
524 path->slots[0]--;
532 leaf = path->nodes[0];
533 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
544 fi = btrfs_item_ptr(leaf, path->slots[0],
555 path->slots[0]);
619 btrfs_truncate_item(trans, path, size, 1);
642 * normal truncate path.
655 ((path->slots[0] + 1) == pending_del_slot));
660 pending_del_slot = path->slots[0];
662 } else if (path->slots[0] + 1 == pending_del_slot) {
665 pending_del_slot = path->slots[0];
695 if (path->slots[0] == 0 ||
696 path->slots[0] != pending_del_slot ||
699 ret = btrfs_del_items(trans, root, path,
708 btrfs_release_path(path);
730 path->slots[0]--;
737 err = btrfs_del_items(trans, root, path, pending_del_slot,
749 btrfs_free_path(path);