Lines Matching refs:path
22 struct btrfs_path *path);
71 struct btrfs_path *path)
83 ret = btrfs_insert_empty_item(trans, root, path, &key, sizeof(*info));
87 leaf = path->nodes[0];
88 info = btrfs_item_ptr(leaf, path->slots[0],
96 btrfs_release_path(path);
104 struct btrfs_path *path, int cow)
115 ret = btrfs_search_slot(trans, root, &key, path, 0, cow);
125 return btrfs_item_ptr(path->nodes[0], path->slots[0],
207 struct btrfs_path *path)
238 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
242 leaf = path->nodes[0];
244 path->slots[0]++;
245 while (path->slots[0] > 0) {
246 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0] - 1);
268 path->slots[0]--;
274 ret = btrfs_del_items(trans, root, path, path->slots[0], nr);
277 btrfs_release_path(path);
280 info = search_free_space_info(trans, block_group, path, 1);
285 leaf = path->nodes[0];
291 btrfs_release_path(path);
318 ret = btrfs_insert_empty_item(trans, root, path, &key,
323 leaf = path->nodes[0];
324 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
328 btrfs_release_path(path);
345 struct btrfs_path *path)
375 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
379 leaf = path->nodes[0];
381 path->slots[0]++;
382 while (path->slots[0] > 0) {
383 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0] - 1);
406 ptr = btrfs_item_ptr_offset(leaf, path->slots[0] - 1);
411 path->slots[0]--;
417 ret = btrfs_del_items(trans, root, path, path->slots[0], nr);
420 btrfs_release_path(path);
423 info = search_free_space_info(trans, block_group, path, 1);
428 leaf = path->nodes[0];
434 btrfs_release_path(path);
447 ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
450 btrfs_release_path(path);
477 struct btrfs_path *path,
488 info = search_free_space_info(trans, block_group, path, 1);
493 flags = btrfs_free_space_flags(path->nodes[0], info);
494 extent_count = btrfs_free_space_extent_count(path->nodes[0], info);
497 btrfs_set_free_space_extent_count(path->nodes[0], info, extent_count);
498 btrfs_mark_buffer_dirty(trans, path->nodes[0]);
499 btrfs_release_path(path);
503 ret = convert_free_space_to_bitmaps(trans, block_group, path);
506 ret = convert_free_space_to_extents(trans, block_group, path);
515 struct btrfs_path *path, u64 offset)
522 leaf = path->nodes[0];
523 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
530 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
538 struct btrfs_path *path, u64 *start, u64 *size,
548 leaf = path->nodes[0];
549 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
560 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
575 * btrfs_next_leaf() doesn't get the path for writing. We can forgo the fancy
606 struct btrfs_path *path,
628 ret = btrfs_search_prev_slot(trans, root, &key, path, 0, 1);
632 prev_bit = free_space_test_bit(block_group, path, prev_block);
635 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
637 ret = free_space_next_bitmap(trans, root, path);
646 ret = btrfs_search_prev_slot(trans, root, &key, path, 0, 1);
660 free_space_set_bits(trans, block_group, path, &cur_start, &cur_size,
664 ret = free_space_next_bitmap(trans, root, path);
675 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
677 ret = free_space_next_bitmap(trans, root, path);
682 next_bit = free_space_test_bit(block_group, path, end);
709 btrfs_release_path(path);
710 ret = update_free_space_extent_count(trans, block_group, path,
719 struct btrfs_path *path,
733 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
737 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
765 ret = btrfs_del_item(trans, root, path);
775 btrfs_release_path(path);
776 ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
788 btrfs_release_path(path);
789 ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
795 btrfs_release_path(path);
796 ret = update_free_space_extent_count(trans, block_group, path,
806 struct btrfs_path *path, u64 start, u64 size)
813 ret = __add_block_group_free_space(trans, block_group, path);
818 info = search_free_space_info(NULL, block_group, path, 0);
821 flags = btrfs_free_space_flags(path->nodes[0], info);
822 btrfs_release_path(path);
825 return modify_free_space_bitmap(trans, block_group, path,
828 return remove_free_space_extent(trans, block_group, path,
837 struct btrfs_path *path;
843 path = btrfs_alloc_path();
844 if (!path) {
857 ret = __remove_from_free_space_tree(trans, block_group, path, start,
863 btrfs_free_path(path);
871 struct btrfs_path *path,
910 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
914 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
918 btrfs_release_path(path);
933 ret = btrfs_del_item(trans, root, path);
940 btrfs_release_path(path);
950 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
954 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
958 btrfs_release_path(path);
974 ret = btrfs_del_item(trans, root, path);
980 btrfs_release_path(path);
984 ret = btrfs_insert_empty_item(trans, root, path, &new_key, 0);
988 btrfs_release_path(path);
989 ret = update_free_space_extent_count(trans, block_group, path,
999 struct btrfs_path *path, u64 start, u64 size)
1006 ret = __add_block_group_free_space(trans, block_group, path);
1011 info = search_free_space_info(NULL, block_group, path, 0);
1014 flags = btrfs_free_space_flags(path->nodes[0], info);
1015 btrfs_release_path(path);
1018 return modify_free_space_bitmap(trans, block_group, path,
1021 return add_free_space_extent(trans, block_group, path, start,
1030 struct btrfs_path *path;
1036 path = btrfs_alloc_path();
1037 if (!path) {
1050 ret = __add_to_free_space_tree(trans, block_group, path, start, size);
1055 btrfs_free_path(path);
1070 struct btrfs_path *path, *path2;
1075 path = btrfs_alloc_path();
1076 if (!path)
1078 path->reada = READA_FORWARD;
1082 btrfs_free_path(path);
1104 ret = btrfs_search_slot_for_read(extent_root, &key, path, 1, 0);
1112 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
1138 ret = btrfs_next_item(extent_root, path);
1156 btrfs_free_path(path);
1220 struct btrfs_path *path;
1225 path = btrfs_alloc_path();
1226 if (!path)
1234 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
1238 nr = btrfs_header_nritems(path->nodes[0]);
1242 path->slots[0] = 0;
1243 ret = btrfs_del_items(trans, root, path, 0, nr);
1247 btrfs_release_path(path);
1252 btrfs_free_path(path);
1355 struct btrfs_path *path)
1361 ret = add_new_free_space_info(trans, block_group, path);
1365 return __add_to_free_space_tree(trans, block_group, path,
1374 struct btrfs_path *path = NULL;
1384 path = btrfs_alloc_path();
1385 if (!path) {
1390 ret = __add_block_group_free_space(trans, block_group, path);
1393 btrfs_free_path(path);
1404 struct btrfs_path *path;
1419 path = btrfs_alloc_path();
1420 if (!path) {
1433 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
1437 leaf = path->nodes[0];
1439 path->slots[0]++;
1440 while (path->slots[0] > 0) {
1441 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0] - 1);
1448 path->slots[0]--;
1456 path->slots[0]--;
1462 ret = btrfs_del_items(trans, root, path, path->slots[0], nr);
1465 btrfs_release_path(path);
1470 btrfs_free_path(path);
1477 struct btrfs_path *path,
1499 ret = btrfs_next_item(root, path);
1505 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
1515 bit = free_space_test_bit(block_group, path, offset);
1561 struct btrfs_path *path,
1582 ret = btrfs_next_item(root, path);
1588 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
1628 struct btrfs_path *path;
1634 path = btrfs_alloc_path();
1635 if (!path)
1642 path->skip_locking = 1;
1643 path->search_commit_root = 1;
1644 path->reada = READA_FORWARD;
1646 info = search_free_space_info(NULL, block_group, path, 0);
1651 extent_count = btrfs_free_space_extent_count(path->nodes[0], info);
1652 flags = btrfs_free_space_flags(path->nodes[0], info);
1655 * We left path pointing to the free space info item, so now
1660 ret = load_free_space_bitmaps(caching_ctl, path, extent_count);
1662 ret = load_free_space_extents(caching_ctl, path, extent_count);
1665 btrfs_free_path(path);