• Home
  • Raw
  • Download

Lines Matching refs:path

55 			     struct btrfs_path *path, u64 objectid);
234 struct btrfs_path *path, in overwrite_item() argument
253 ret = btrfs_search_slot(NULL, root, key, path, 0, 0); in overwrite_item()
257 u32 dst_size = btrfs_item_size_nr(path->nodes[0], in overwrite_item()
258 path->slots[0]); in overwrite_item()
263 btrfs_release_path(root, path); in overwrite_item()
271 dst_ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in overwrite_item()
272 read_extent_buffer(path->nodes[0], dst_copy, dst_ptr, in overwrite_item()
285 btrfs_release_path(root, path); in overwrite_item()
291 btrfs_release_path(root, path); in overwrite_item()
293 ret = btrfs_insert_empty_item(trans, root, path, in overwrite_item()
299 found_size = btrfs_item_size_nr(path->nodes[0], in overwrite_item()
300 path->slots[0]); in overwrite_item()
302 btrfs_truncate_item(trans, root, path, item_size, 1); in overwrite_item()
304 ret = btrfs_extend_item(trans, root, path, in overwrite_item()
311 dst_ptr = btrfs_item_ptr_offset(path->nodes[0], in overwrite_item()
312 path->slots[0]); in overwrite_item()
335 S_ISDIR(btrfs_inode_mode(path->nodes[0], dst_item))) { in overwrite_item()
337 saved_i_size = btrfs_inode_size(path->nodes[0], in overwrite_item()
342 copy_extent_buffer(path->nodes[0], eb, dst_ptr, in overwrite_item()
348 btrfs_set_inode_size(path->nodes[0], dst_item, saved_i_size); in overwrite_item()
355 if (btrfs_inode_generation(path->nodes[0], dst_item) == 0) { in overwrite_item()
356 btrfs_set_inode_generation(path->nodes[0], dst_item, in overwrite_item()
361 btrfs_mark_buffer_dirty(path->nodes[0]); in overwrite_item()
362 btrfs_release_path(root, path); in overwrite_item()
405 struct btrfs_path *path, in replay_one_extent() argument
445 ret = btrfs_lookup_file_extent(trans, root, path, inode->i_ino, in replay_one_extent()
456 leaf = path->nodes[0]; in replay_one_extent()
457 existing = btrfs_item_ptr(leaf, path->slots[0], in replay_one_extent()
470 btrfs_release_path(root, path); in replay_one_extent()
474 btrfs_release_path(root, path); in replay_one_extent()
487 ret = btrfs_insert_empty_item(trans, root, path, key, in replay_one_extent()
490 dest_offset = btrfs_item_ptr_offset(path->nodes[0], in replay_one_extent()
491 path->slots[0]); in replay_one_extent()
492 copy_extent_buffer(path->nodes[0], eb, dest_offset, in replay_one_extent()
512 path->nodes[0]->start, in replay_one_extent()
521 path->nodes[0]->start, in replay_one_extent()
527 btrfs_release_path(root, path); in replay_one_extent()
556 btrfs_release_path(root, path); in replay_one_extent()
560 ret = overwrite_item(trans, root, path, eb, slot, key); in replay_one_extent()
582 struct btrfs_path *path, in drop_one_dir_item() argument
593 leaf = path->nodes[0]; in drop_one_dir_item()
599 btrfs_release_path(root, path); in drop_one_dir_item()
604 ret = link_to_fixup_dir(trans, root, path, location.objectid); in drop_one_dir_item()
620 struct btrfs_path *path, in inode_in_dir() argument
628 di = btrfs_lookup_dir_index_item(NULL, root, path, dirid, in inode_in_dir()
631 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
636 btrfs_release_path(root, path); in inode_in_dir()
638 di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0); in inode_in_dir()
640 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
647 btrfs_release_path(root, path); in inode_in_dir()
665 struct btrfs_path *path; in backref_in_log() local
675 path = btrfs_alloc_path(); in backref_in_log()
676 ret = btrfs_search_slot(NULL, log, key, path, 0, 0); in backref_in_log()
680 item_size = btrfs_item_size_nr(path->nodes[0], path->slots[0]); in backref_in_log()
681 ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in backref_in_log()
685 found_name_len = btrfs_inode_ref_name_len(path->nodes[0], ref); in backref_in_log()
688 ret = memcmp_extent_buffer(path->nodes[0], name, in backref_in_log()
698 btrfs_free_path(path); in backref_in_log()
712 struct btrfs_path *path, in add_inode_ref() argument
757 if (inode_in_dir(root, path, dir->i_ino, inode->i_ino, in add_inode_ref()
771 ret = btrfs_search_slot(NULL, root, key, path, 0, 0); in add_inode_ref()
778 struct extent_buffer *leaf = path->nodes[0]; in add_inode_ref()
790 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in add_inode_ref()
791 ptr_end = ptr + btrfs_item_size_nr(leaf, path->slots[0]); in add_inode_ref()
806 btrfs_release_path(root, path); in add_inode_ref()
811 btrfs_release_path(root, path); in add_inode_ref()
819 btrfs_release_path(root, path); in add_inode_ref()
822 di = btrfs_lookup_dir_index_item(trans, root, path, dir->i_ino, in add_inode_ref()
826 ret = drop_one_dir_item(trans, root, path, dir, di); in add_inode_ref()
829 btrfs_release_path(root, path); in add_inode_ref()
833 di = btrfs_lookup_dir_item(trans, root, path, dir->i_ino, in add_inode_ref()
836 ret = drop_one_dir_item(trans, root, path, dir, di); in add_inode_ref()
839 btrfs_release_path(root, path); in add_inode_ref()
855 ret = overwrite_item(trans, root, path, eb, slot, key); in add_inode_ref()
859 btrfs_release_path(root, path); in add_inode_ref()
879 struct btrfs_path *path; in fixup_inode_link_count() local
891 path = btrfs_alloc_path(); in fixup_inode_link_count()
894 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in fixup_inode_link_count()
898 if (path->slots[0] == 0) in fixup_inode_link_count()
900 path->slots[0]--; in fixup_inode_link_count()
902 btrfs_item_key_to_cpu(path->nodes[0], &key, in fixup_inode_link_count()
903 path->slots[0]); in fixup_inode_link_count()
907 ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in fixup_inode_link_count()
908 ptr_end = ptr + btrfs_item_size_nr(path->nodes[0], in fixup_inode_link_count()
909 path->slots[0]); in fixup_inode_link_count()
914 name_len = btrfs_inode_ref_name_len(path->nodes[0], in fixup_inode_link_count()
923 btrfs_release_path(root, path); in fixup_inode_link_count()
925 btrfs_free_path(path); in fixup_inode_link_count()
937 struct btrfs_path *path) in fixup_inode_link_counts() argument
947 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in fixup_inode_link_counts()
952 if (path->slots[0] == 0) in fixup_inode_link_counts()
954 path->slots[0]--; in fixup_inode_link_counts()
957 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in fixup_inode_link_counts()
962 ret = btrfs_del_item(trans, root, path); in fixup_inode_link_counts()
965 btrfs_release_path(root, path); in fixup_inode_link_counts()
978 btrfs_release_path(root, path); in fixup_inode_link_counts()
990 struct btrfs_path *path, in link_to_fixup_dir() argument
1004 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); in link_to_fixup_dir()
1006 btrfs_release_path(root, path); in link_to_fixup_dir()
1027 struct btrfs_path *path, in insert_one_name() argument
1069 struct btrfs_path *path, in replay_one_name() argument
1094 exists = btrfs_lookup_inode(trans, root, path, &log_key, 0); in replay_one_name()
1099 btrfs_release_path(root, path); in replay_one_name()
1102 dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid, in replay_one_name()
1105 dst_di = btrfs_lookup_dir_index_item(trans, root, path, in replay_one_name()
1121 btrfs_dir_item_key_to_cpu(path->nodes[0], dst_di, &found_key); in replay_one_name()
1126 btrfs_dir_type(path->nodes[0], dst_di) == log_type) { in replay_one_name()
1137 ret = drop_one_dir_item(trans, root, path, dir, dst_di); in replay_one_name()
1143 btrfs_release_path(root, path); in replay_one_name()
1149 btrfs_release_path(root, path); in replay_one_name()
1150 ret = insert_one_name(trans, root, path, key->objectid, key->offset, in replay_one_name()
1166 struct btrfs_path *path, in replay_one_dir_item() argument
1182 ret = replay_one_name(trans, root, path, eb, di, key); in replay_one_dir_item()
1202 struct btrfs_path *path, in find_dir_range() argument
1219 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in find_dir_range()
1223 if (path->slots[0] == 0) in find_dir_range()
1225 path->slots[0]--; in find_dir_range()
1228 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in find_dir_range()
1234 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_dir_range()
1236 found_end = btrfs_dir_log_end(path->nodes[0], item); in find_dir_range()
1247 nritems = btrfs_header_nritems(path->nodes[0]); in find_dir_range()
1248 if (path->slots[0] >= nritems) { in find_dir_range()
1249 ret = btrfs_next_leaf(root, path); in find_dir_range()
1253 path->slots[0]++; in find_dir_range()
1256 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in find_dir_range()
1262 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_dir_range()
1264 found_end = btrfs_dir_log_end(path->nodes[0], item); in find_dir_range()
1269 btrfs_release_path(root, path); in find_dir_range()
1281 struct btrfs_path *path, in check_item_in_log() argument
1300 eb = path->nodes[0]; in check_item_in_log()
1301 slot = path->slots[0]; in check_item_in_log()
1329 btrfs_release_path(root, path); in check_item_in_log()
1335 path, location.objectid); in check_item_in_log()
1347 ret = btrfs_search_slot(NULL, root, dir_key, path, in check_item_in_log()
1362 btrfs_release_path(root, path); in check_item_in_log()
1380 struct btrfs_path *path, in replay_dir_deletes() argument
1411 ret = find_dir_range(log, path, dirid, key_type, in replay_dir_deletes()
1419 ret = btrfs_search_slot(NULL, root, &dir_key, path, in replay_dir_deletes()
1424 nritems = btrfs_header_nritems(path->nodes[0]); in replay_dir_deletes()
1425 if (path->slots[0] >= nritems) { in replay_dir_deletes()
1426 ret = btrfs_next_leaf(root, path); in replay_dir_deletes()
1430 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in replay_dir_deletes()
1431 path->slots[0]); in replay_dir_deletes()
1439 ret = check_item_in_log(trans, root, log, path, in replay_dir_deletes()
1446 btrfs_release_path(root, path); in replay_dir_deletes()
1457 btrfs_release_path(root, path); in replay_dir_deletes()
1461 btrfs_release_path(root, path); in replay_dir_deletes()
1482 struct btrfs_path *path; in replay_one_buffer() local
1497 path = btrfs_alloc_path(); in replay_one_buffer()
1498 BUG_ON(!path); in replay_one_buffer()
1517 root, log, path, key.objectid); in replay_one_buffer()
1520 ret = overwrite_item(wc->trans, root, path, in replay_one_buffer()
1539 path, key.objectid); in replay_one_buffer()
1547 ret = overwrite_item(wc->trans, root, path, in replay_one_buffer()
1551 ret = add_inode_ref(wc->trans, root, log, path, in replay_one_buffer()
1555 ret = replay_one_extent(wc->trans, root, path, in replay_one_buffer()
1560 ret = replay_one_dir_item(wc->trans, root, path, in replay_one_buffer()
1565 btrfs_free_path(path); in replay_one_buffer()
1571 struct btrfs_path *path, int *level, in walk_down_log_tree() argument
1590 cur = path->nodes[*level]; in walk_down_log_tree()
1595 if (path->slots[*level] >= in walk_down_log_tree()
1599 bytenr = btrfs_node_blockptr(cur, path->slots[*level]); in walk_down_log_tree()
1600 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]); in walk_down_log_tree()
1603 parent = path->nodes[*level]; in walk_down_log_tree()
1612 path->slots[*level]++; in walk_down_log_tree()
1637 if (path->nodes[*level-1]) in walk_down_log_tree()
1638 free_extent_buffer(path->nodes[*level-1]); in walk_down_log_tree()
1639 path->nodes[*level-1] = next; in walk_down_log_tree()
1641 path->slots[*level] = 0; in walk_down_log_tree()
1647 if (path->nodes[*level] == root->node) in walk_down_log_tree()
1648 parent = path->nodes[*level]; in walk_down_log_tree()
1650 parent = path->nodes[*level + 1]; in walk_down_log_tree()
1652 bytenr = path->nodes[*level]->start; in walk_down_log_tree()
1658 wc->process_func(root, path->nodes[*level], wc, in walk_down_log_tree()
1659 btrfs_header_generation(path->nodes[*level])); in walk_down_log_tree()
1662 next = path->nodes[*level]; in walk_down_log_tree()
1677 free_extent_buffer(path->nodes[*level]); in walk_down_log_tree()
1678 path->nodes[*level] = NULL; in walk_down_log_tree()
1687 struct btrfs_path *path, int *level, in walk_up_log_tree() argument
1696 for (i = *level; i < BTRFS_MAX_LEVEL - 1 && path->nodes[i]; i++) { in walk_up_log_tree()
1697 slot = path->slots[i]; in walk_up_log_tree()
1698 if (slot < btrfs_header_nritems(path->nodes[i]) - 1) { in walk_up_log_tree()
1700 node = path->nodes[i]; in walk_up_log_tree()
1701 path->slots[i]++; in walk_up_log_tree()
1707 if (path->nodes[*level] == root->node) in walk_up_log_tree()
1708 parent = path->nodes[*level]; in walk_up_log_tree()
1710 parent = path->nodes[*level + 1]; in walk_up_log_tree()
1714 wc->process_func(root, path->nodes[*level], wc, in walk_up_log_tree()
1715 btrfs_header_generation(path->nodes[*level])); in walk_up_log_tree()
1719 next = path->nodes[*level]; in walk_up_log_tree()
1735 path->nodes[*level]->start, in walk_up_log_tree()
1736 path->nodes[*level]->len); in walk_up_log_tree()
1739 free_extent_buffer(path->nodes[*level]); in walk_up_log_tree()
1740 path->nodes[*level] = NULL; in walk_up_log_tree()
1758 struct btrfs_path *path; in walk_log_tree() local
1762 path = btrfs_alloc_path(); in walk_log_tree()
1763 BUG_ON(!path); in walk_log_tree()
1767 path->nodes[level] = log->node; in walk_log_tree()
1769 path->slots[level] = 0; in walk_log_tree()
1772 wret = walk_down_log_tree(trans, log, path, &level, wc); in walk_log_tree()
1778 wret = walk_up_log_tree(trans, log, path, &level, wc); in walk_log_tree()
1786 if (path->nodes[orig_level]) { in walk_log_tree()
1787 wc->process_func(log, path->nodes[orig_level], wc, in walk_log_tree()
1788 btrfs_header_generation(path->nodes[orig_level])); in walk_log_tree()
1792 next = path->nodes[orig_level]; in walk_log_tree()
1814 if (path->nodes[i]) { in walk_log_tree()
1815 free_extent_buffer(path->nodes[i]); in walk_log_tree()
1816 path->nodes[i] = NULL; in walk_log_tree()
1819 btrfs_free_path(path); in walk_log_tree()
2072 struct btrfs_path *path; in btrfs_del_dir_entries_in_log() local
2086 path = btrfs_alloc_path(); in btrfs_del_dir_entries_in_log()
2087 di = btrfs_lookup_dir_item(trans, log, path, dir->i_ino, in btrfs_del_dir_entries_in_log()
2090 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
2094 btrfs_release_path(log, path); in btrfs_del_dir_entries_in_log()
2095 di = btrfs_lookup_dir_index_item(trans, log, path, dir->i_ino, in btrfs_del_dir_entries_in_log()
2098 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
2112 btrfs_release_path(log, path); in btrfs_del_dir_entries_in_log()
2114 ret = btrfs_search_slot(trans, log, &key, path, 0, 1); in btrfs_del_dir_entries_in_log()
2119 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in btrfs_del_dir_entries_in_log()
2121 i_size = btrfs_inode_size(path->nodes[0], item); in btrfs_del_dir_entries_in_log()
2126 btrfs_set_inode_size(path->nodes[0], item, i_size); in btrfs_del_dir_entries_in_log()
2127 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_del_dir_entries_in_log()
2130 btrfs_release_path(log, path); in btrfs_del_dir_entries_in_log()
2133 btrfs_free_path(path); in btrfs_del_dir_entries_in_log()
2174 struct btrfs_path *path, in insert_dir_log_key() argument
2188 ret = btrfs_insert_empty_item(trans, log, path, &key, sizeof(*item)); in insert_dir_log_key()
2191 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in insert_dir_log_key()
2193 btrfs_set_dir_log_end(path->nodes[0], item, last_offset); in insert_dir_log_key()
2194 btrfs_mark_buffer_dirty(path->nodes[0]); in insert_dir_log_key()
2195 btrfs_release_path(log, path); in insert_dir_log_key()
2206 struct btrfs_path *path, in log_dir_items() argument
2229 path->keep_locks = 1; in log_dir_items()
2232 path, 0, trans->transid); in log_dir_items()
2243 btrfs_release_path(root, path); in log_dir_items()
2244 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
2246 btrfs_release_path(root, path); in log_dir_items()
2249 ret = btrfs_previous_item(root, path, inode->i_ino, key_type); in log_dir_items()
2258 btrfs_item_key_to_cpu(path->nodes[0], &tmp, in log_dir_items()
2259 path->slots[0]); in log_dir_items()
2267 ret = btrfs_previous_item(root, path, inode->i_ino, key_type); in log_dir_items()
2270 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
2274 path->nodes[0], path->slots[0], in log_dir_items()
2278 btrfs_release_path(root, path); in log_dir_items()
2281 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
2293 src = path->nodes[0]; in log_dir_items()
2295 for (i = path->slots[0]; i < nritems; i++) { in log_dir_items()
2305 path->slots[0] = nritems; in log_dir_items()
2311 ret = btrfs_next_leaf(root, path); in log_dir_items()
2316 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
2321 if (btrfs_header_generation(path->nodes[0]) != trans->transid) { in log_dir_items()
2323 path->nodes[0], path->slots[0], in log_dir_items()
2333 btrfs_release_path(root, path); in log_dir_items()
2337 ret = insert_dir_log_key(trans, log, path, key_type, inode->i_ino, in log_dir_items()
2357 struct btrfs_path *path, in log_directory_changes() argument
2369 ret = log_dir_items(trans, root, inode, path, in log_directory_changes()
2393 struct btrfs_path *path, in drop_objectid_items() argument
2405 ret = btrfs_search_slot(trans, log, &key, path, -1, 1); in drop_objectid_items()
2410 if (path->slots[0] == 0) in drop_objectid_items()
2413 path->slots[0]--; in drop_objectid_items()
2414 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in drop_objectid_items()
2415 path->slots[0]); in drop_objectid_items()
2420 ret = btrfs_del_item(trans, log, path); in drop_objectid_items()
2422 btrfs_release_path(log, path); in drop_objectid_items()
2424 btrfs_release_path(log, path); in drop_objectid_items()
2566 struct btrfs_path *path; in __btrfs_log_inode() local
2580 path = btrfs_alloc_path(); in __btrfs_log_inode()
2606 btrfs_free_path(path); in __btrfs_log_inode()
2621 ret = drop_objectid_items(trans, log, path, in __btrfs_log_inode()
2627 path->keep_locks = 1; in __btrfs_log_inode()
2632 path, 0, trans->transid); in __btrfs_log_inode()
2642 src = path->nodes[0]; in __btrfs_log_inode()
2643 size = btrfs_item_size_nr(src, path->slots[0]); in __btrfs_log_inode()
2644 if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) { in __btrfs_log_inode()
2648 ins_start_slot = path->slots[0]; in __btrfs_log_inode()
2657 ins_start_slot = path->slots[0]; in __btrfs_log_inode()
2660 nritems = btrfs_header_nritems(path->nodes[0]); in __btrfs_log_inode()
2661 path->slots[0]++; in __btrfs_log_inode()
2662 if (path->slots[0] < nritems) { in __btrfs_log_inode()
2663 btrfs_item_key_to_cpu(path->nodes[0], &min_key, in __btrfs_log_inode()
2664 path->slots[0]); in __btrfs_log_inode()
2674 btrfs_release_path(root, path); in __btrfs_log_inode()
2694 btrfs_release_path(root, path); in __btrfs_log_inode()
2697 ret = log_directory_changes(trans, root, inode, path, dst_path); in __btrfs_log_inode()
2703 btrfs_free_path(path); in __btrfs_log_inode()
2778 struct btrfs_path *path; in btrfs_recover_log_trees() local
2792 path = btrfs_alloc_path(); in btrfs_recover_log_trees()
2793 BUG_ON(!path); in btrfs_recover_log_trees()
2808 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
2812 if (path->slots[0] == 0) in btrfs_recover_log_trees()
2814 path->slots[0]--; in btrfs_recover_log_trees()
2816 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in btrfs_recover_log_trees()
2817 path->slots[0]); in btrfs_recover_log_trees()
2818 btrfs_release_path(log_root_tree, path); in btrfs_recover_log_trees()
2843 path); in btrfs_recover_log_trees()
2860 btrfs_release_path(log_root_tree, path); in btrfs_recover_log_trees()
2875 btrfs_free_path(path); in btrfs_recover_log_trees()