Lines Matching refs:path
17 struct btrfs_path *path);
52 struct btrfs_path *path)
64 ret = btrfs_insert_empty_item(trans, root, path, &key, sizeof(*info));
68 leaf = path->nodes[0];
69 info = btrfs_item_ptr(leaf, path->slots[0],
77 btrfs_release_path(path);
85 struct btrfs_path *path, int cow)
96 ret = btrfs_search_slot(trans, root, &key, path, 0, cow);
106 return btrfs_item_ptr(path->nodes[0], path->slots[0],
187 struct btrfs_path *path)
219 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
223 leaf = path->nodes[0];
225 path->slots[0]++;
226 while (path->slots[0] > 0) {
227 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0] - 1);
249 path->slots[0]--;
255 ret = btrfs_del_items(trans, root, path, path->slots[0], nr);
258 btrfs_release_path(path);
261 info = search_free_space_info(trans, block_group, path, 1);
266 leaf = path->nodes[0];
272 btrfs_release_path(path);
300 ret = btrfs_insert_empty_item(trans, root, path, &key,
305 leaf = path->nodes[0];
306 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
310 btrfs_release_path(path);
327 struct btrfs_path *path)
358 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
362 leaf = path->nodes[0];
364 path->slots[0]++;
365 while (path->slots[0] > 0) {
366 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0] - 1);
389 ptr = btrfs_item_ptr_offset(leaf, path->slots[0] - 1);
394 path->slots[0]--;
400 ret = btrfs_del_items(trans, root, path, path->slots[0], nr);
403 btrfs_release_path(path);
406 info = search_free_space_info(trans, block_group, path, 1);
411 leaf = path->nodes[0];
417 btrfs_release_path(path);
430 ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
433 btrfs_release_path(path);
460 struct btrfs_path *path,
471 info = search_free_space_info(trans, block_group, path, 1);
476 flags = btrfs_free_space_flags(path->nodes[0], info);
477 extent_count = btrfs_free_space_extent_count(path->nodes[0], info);
480 btrfs_set_free_space_extent_count(path->nodes[0], info, extent_count);
481 btrfs_mark_buffer_dirty(path->nodes[0]);
482 btrfs_release_path(path);
486 ret = convert_free_space_to_bitmaps(trans, block_group, path);
489 ret = convert_free_space_to_extents(trans, block_group, path);
498 struct btrfs_path *path, u64 offset)
505 leaf = path->nodes[0];
506 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
513 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
520 struct btrfs_path *path, u64 *start, u64 *size,
530 leaf = path->nodes[0];
531 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
542 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
557 * btrfs_next_leaf() doesn't get the path for writing. We can forgo the fancy
588 struct btrfs_path *path,
610 ret = btrfs_search_prev_slot(trans, root, &key, path, 0, 1);
614 prev_bit = free_space_test_bit(block_group, path, prev_block);
617 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
619 ret = free_space_next_bitmap(trans, root, path);
628 ret = btrfs_search_prev_slot(trans, root, &key, path, 0, 1);
642 free_space_set_bits(block_group, path, &cur_start, &cur_size,
646 ret = free_space_next_bitmap(trans, root, path);
657 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
659 ret = free_space_next_bitmap(trans, root, path);
664 next_bit = free_space_test_bit(block_group, path, end);
691 btrfs_release_path(path);
692 ret = update_free_space_extent_count(trans, block_group, path,
701 struct btrfs_path *path,
715 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
719 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
747 ret = btrfs_del_item(trans, root, path);
757 btrfs_release_path(path);
758 ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
770 btrfs_release_path(path);
771 ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
777 btrfs_release_path(path);
778 ret = update_free_space_extent_count(trans, block_group, path,
788 struct btrfs_path *path, u64 start, u64 size)
795 ret = __add_block_group_free_space(trans, block_group, path);
800 info = search_free_space_info(NULL, block_group, path, 0);
803 flags = btrfs_free_space_flags(path->nodes[0], info);
804 btrfs_release_path(path);
807 return modify_free_space_bitmap(trans, block_group, path,
810 return remove_free_space_extent(trans, block_group, path,
819 struct btrfs_path *path;
825 path = btrfs_alloc_path();
826 if (!path) {
839 ret = __remove_from_free_space_tree(trans, block_group, path, start,
845 btrfs_free_path(path);
853 struct btrfs_path *path,
892 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
896 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
900 btrfs_release_path(path);
915 ret = btrfs_del_item(trans, root, path);
922 btrfs_release_path(path);
932 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
936 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
940 btrfs_release_path(path);
956 ret = btrfs_del_item(trans, root, path);
962 btrfs_release_path(path);
966 ret = btrfs_insert_empty_item(trans, root, path, &new_key, 0);
970 btrfs_release_path(path);
971 ret = update_free_space_extent_count(trans, block_group, path,
981 struct btrfs_path *path, u64 start, u64 size)
988 ret = __add_block_group_free_space(trans, block_group, path);
993 info = search_free_space_info(NULL, block_group, path, 0);
996 flags = btrfs_free_space_flags(path->nodes[0], info);
997 btrfs_release_path(path);
1000 return modify_free_space_bitmap(trans, block_group, path,
1003 return add_free_space_extent(trans, block_group, path, start,
1012 struct btrfs_path *path;
1018 path = btrfs_alloc_path();
1019 if (!path) {
1032 ret = __add_to_free_space_tree(trans, block_group, path, start, size);
1037 btrfs_free_path(path);
1052 struct btrfs_path *path, *path2;
1057 path = btrfs_alloc_path();
1058 if (!path)
1060 path->reada = READA_FORWARD;
1064 btrfs_free_path(path);
1085 ret = btrfs_search_slot_for_read(extent_root, &key, path, 1, 0);
1093 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
1119 ret = btrfs_next_item(extent_root, path);
1137 btrfs_free_path(path);
1197 struct btrfs_path *path;
1202 path = btrfs_alloc_path();
1203 if (!path)
1206 path->leave_spinning = 1;
1213 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
1217 nr = btrfs_header_nritems(path->nodes[0]);
1221 path->slots[0] = 0;
1222 ret = btrfs_del_items(trans, root, path, 0, nr);
1226 btrfs_release_path(path);
1231 btrfs_free_path(path);
1278 struct btrfs_path *path)
1284 ret = add_new_free_space_info(trans, block_group, path);
1288 return __add_to_free_space_tree(trans, block_group, path,
1297 struct btrfs_path *path = NULL;
1307 path = btrfs_alloc_path();
1308 if (!path) {
1313 ret = __add_block_group_free_space(trans, block_group, path);
1316 btrfs_free_path(path);
1327 struct btrfs_path *path;
1342 path = btrfs_alloc_path();
1343 if (!path) {
1356 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
1360 leaf = path->nodes[0];
1362 path->slots[0]++;
1363 while (path->slots[0] > 0) {
1364 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0] - 1);
1371 path->slots[0]--;
1379 path->slots[0]--;
1385 ret = btrfs_del_items(trans, root, path, path->slots[0], nr);
1388 btrfs_release_path(path);
1393 btrfs_free_path(path);
1400 struct btrfs_path *path,
1422 ret = btrfs_next_item(root, path);
1428 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
1440 bit = free_space_test_bit(block_group, path, offset);
1481 struct btrfs_path *path,
1500 ret = btrfs_next_item(root, path);
1506 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
1546 struct btrfs_path *path;
1552 path = btrfs_alloc_path();
1553 if (!path)
1560 path->skip_locking = 1;
1561 path->search_commit_root = 1;
1562 path->reada = READA_FORWARD;
1564 info = search_free_space_info(NULL, block_group, path, 0);
1569 extent_count = btrfs_free_space_extent_count(path->nodes[0], info);
1570 flags = btrfs_free_space_flags(path->nodes[0], info);
1573 * We left path pointing to the free space info item, so now
1578 ret = load_free_space_bitmaps(caching_ctl, path, extent_count);
1580 ret = load_free_space_extents(caching_ctl, path, extent_count);
1583 btrfs_free_path(path);