• Home
  • Raw
  • Download

Lines Matching refs:ret

58 	int ret;  in add_new_free_space_info()  local
64 ret = btrfs_insert_empty_item(trans, root, path, &key, sizeof(*info)); in add_new_free_space_info()
65 if (ret) in add_new_free_space_info()
75 ret = 0; in add_new_free_space_info()
78 return ret; in add_new_free_space_info()
90 int ret; in search_free_space_info() local
96 ret = btrfs_search_slot(trans, root, &key, path, 0, cow); in search_free_space_info()
97 if (ret < 0) in search_free_space_info()
98 return ERR_PTR(ret); in search_free_space_info()
99 if (ret != 0) { in search_free_space_info()
119 int ret; in btrfs_search_prev_slot() local
121 ret = btrfs_search_slot(trans, root, key, p, ins_len, cow); in btrfs_search_prev_slot()
122 if (ret < 0) in btrfs_search_prev_slot()
123 return ret; in btrfs_search_prev_slot()
125 if (ret == 0) { in btrfs_search_prev_slot()
146 unsigned long *ret; in alloc_bitmap() local
159 ret = kvzalloc(bitmap_rounded_size, GFP_KERNEL); in alloc_bitmap()
161 return ret; in alloc_bitmap()
201 int ret; in convert_free_space_to_bitmaps() local
207 ret = -ENOMEM; in convert_free_space_to_bitmaps()
219 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1); in convert_free_space_to_bitmaps()
220 if (ret) in convert_free_space_to_bitmaps()
255 ret = btrfs_del_items(trans, root, path, path->slots[0], nr); in convert_free_space_to_bitmaps()
256 if (ret) in convert_free_space_to_bitmaps()
263 ret = PTR_ERR(info); in convert_free_space_to_bitmaps()
280 ret = -EIO; in convert_free_space_to_bitmaps()
300 ret = btrfs_insert_empty_item(trans, root, path, &key, in convert_free_space_to_bitmaps()
302 if (ret) in convert_free_space_to_bitmaps()
316 ret = 0; in convert_free_space_to_bitmaps()
319 if (ret) in convert_free_space_to_bitmaps()
320 btrfs_abort_transaction(trans, ret); in convert_free_space_to_bitmaps()
321 return ret; in convert_free_space_to_bitmaps()
340 int ret; in convert_free_space_to_extents() local
346 ret = -ENOMEM; in convert_free_space_to_extents()
358 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1); in convert_free_space_to_extents()
359 if (ret) in convert_free_space_to_extents()
400 ret = btrfs_del_items(trans, root, path, path->slots[0], nr); in convert_free_space_to_extents()
401 if (ret) in convert_free_space_to_extents()
408 ret = PTR_ERR(info); in convert_free_space_to_extents()
430 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); in convert_free_space_to_extents()
431 if (ret) in convert_free_space_to_extents()
446 ret = -EIO; in convert_free_space_to_extents()
450 ret = 0; in convert_free_space_to_extents()
453 if (ret) in convert_free_space_to_extents()
454 btrfs_abort_transaction(trans, ret); in convert_free_space_to_extents()
455 return ret; in convert_free_space_to_extents()
466 int ret = 0; in update_free_space_extent_count() local
473 ret = PTR_ERR(info); in update_free_space_extent_count()
486 ret = convert_free_space_to_bitmaps(trans, block_group, path); in update_free_space_extent_count()
489 ret = convert_free_space_to_extents(trans, block_group, path); in update_free_space_extent_count()
493 return ret; in update_free_space_extent_count()
597 int ret; in modify_free_space_bitmap() local
610 ret = btrfs_search_prev_slot(trans, root, &key, path, 0, 1); in modify_free_space_bitmap()
611 if (ret) in modify_free_space_bitmap()
619 ret = free_space_next_bitmap(trans, root, path); in modify_free_space_bitmap()
620 if (ret) in modify_free_space_bitmap()
628 ret = btrfs_search_prev_slot(trans, root, &key, path, 0, 1); in modify_free_space_bitmap()
629 if (ret) in modify_free_space_bitmap()
646 ret = free_space_next_bitmap(trans, root, path); in modify_free_space_bitmap()
647 if (ret) in modify_free_space_bitmap()
659 ret = free_space_next_bitmap(trans, root, path); in modify_free_space_bitmap()
660 if (ret) in modify_free_space_bitmap()
692 ret = update_free_space_extent_count(trans, block_group, path, in modify_free_space_bitmap()
696 return ret; in modify_free_space_bitmap()
709 int ret; in remove_free_space_extent() local
715 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1); in remove_free_space_extent()
716 if (ret) in remove_free_space_extent()
747 ret = btrfs_del_item(trans, root, path); in remove_free_space_extent()
748 if (ret) in remove_free_space_extent()
758 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); in remove_free_space_extent()
759 if (ret) in remove_free_space_extent()
771 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); in remove_free_space_extent()
772 if (ret) in remove_free_space_extent()
778 ret = update_free_space_extent_count(trans, block_group, path, in remove_free_space_extent()
782 return ret; in remove_free_space_extent()
792 int ret; in __remove_from_free_space_tree() local
795 ret = __add_block_group_free_space(trans, block_group, path); in __remove_from_free_space_tree()
796 if (ret) in __remove_from_free_space_tree()
797 return ret; in __remove_from_free_space_tree()
820 int ret; in remove_from_free_space_tree() local
827 ret = -ENOMEM; in remove_from_free_space_tree()
834 ret = -ENOENT; in remove_from_free_space_tree()
839 ret = __remove_from_free_space_tree(trans, block_group, path, start, in remove_from_free_space_tree()
846 if (ret) in remove_from_free_space_tree()
847 btrfs_abort_transaction(trans, ret); in remove_from_free_space_tree()
848 return ret; in remove_from_free_space_tree()
861 int ret; in add_free_space_extent() local
892 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1); in add_free_space_extent()
893 if (ret) in add_free_space_extent()
915 ret = btrfs_del_item(trans, root, path); in add_free_space_extent()
916 if (ret) in add_free_space_extent()
932 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1); in add_free_space_extent()
933 if (ret) in add_free_space_extent()
956 ret = btrfs_del_item(trans, root, path); in add_free_space_extent()
957 if (ret) in add_free_space_extent()
966 ret = btrfs_insert_empty_item(trans, root, path, &new_key, 0); in add_free_space_extent()
967 if (ret) in add_free_space_extent()
971 ret = update_free_space_extent_count(trans, block_group, path, in add_free_space_extent()
975 return ret; in add_free_space_extent()
985 int ret; in __add_to_free_space_tree() local
988 ret = __add_block_group_free_space(trans, block_group, path); in __add_to_free_space_tree()
989 if (ret) in __add_to_free_space_tree()
990 return ret; in __add_to_free_space_tree()
1013 int ret; in add_to_free_space_tree() local
1020 ret = -ENOMEM; in add_to_free_space_tree()
1027 ret = -ENOENT; in add_to_free_space_tree()
1032 ret = __add_to_free_space_tree(trans, block_group, path, start, size); in add_to_free_space_tree()
1038 if (ret) in add_to_free_space_tree()
1039 btrfs_abort_transaction(trans, ret); in add_to_free_space_tree()
1040 return ret; in add_to_free_space_tree()
1055 int ret; in populate_free_space_tree() local
1068 ret = add_new_free_space_info(trans, block_group, path2); in populate_free_space_tree()
1069 if (ret) in populate_free_space_tree()
1085 ret = btrfs_search_slot_for_read(extent_root, &key, path, 1, 0); in populate_free_space_tree()
1086 if (ret < 0) in populate_free_space_tree()
1088 ASSERT(ret == 0); in populate_free_space_tree()
1101 ret = __add_to_free_space_tree(trans, in populate_free_space_tree()
1106 if (ret) in populate_free_space_tree()
1119 ret = btrfs_next_item(extent_root, path); in populate_free_space_tree()
1120 if (ret < 0) in populate_free_space_tree()
1122 if (ret) in populate_free_space_tree()
1126 ret = __add_to_free_space_tree(trans, block_group, path2, in populate_free_space_tree()
1128 if (ret) in populate_free_space_tree()
1132 ret = 0; in populate_free_space_tree()
1138 return ret; in populate_free_space_tree()
1148 int ret; in btrfs_create_free_space_tree() local
1159 ret = PTR_ERR(free_space_root); in btrfs_create_free_space_tree()
1168 ret = populate_free_space_tree(trans, block_group); in btrfs_create_free_space_tree()
1169 if (ret) in btrfs_create_free_space_tree()
1177 ret = btrfs_commit_transaction(trans); in btrfs_create_free_space_tree()
1184 return ret; in btrfs_create_free_space_tree()
1189 btrfs_abort_transaction(trans, ret); in btrfs_create_free_space_tree()
1191 return ret; in btrfs_create_free_space_tree()
1200 int ret; in clear_free_space_tree() local
1213 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in clear_free_space_tree()
1214 if (ret < 0) in clear_free_space_tree()
1222 ret = btrfs_del_items(trans, root, path, 0, nr); in clear_free_space_tree()
1223 if (ret) in clear_free_space_tree()
1229 ret = 0; in clear_free_space_tree()
1232 return ret; in clear_free_space_tree()
1240 int ret; in btrfs_clear_free_space_tree() local
1250 ret = clear_free_space_tree(trans, free_space_root); in btrfs_clear_free_space_tree()
1251 if (ret) in btrfs_clear_free_space_tree()
1254 ret = btrfs_del_root(trans, &free_space_root->root_key); in btrfs_clear_free_space_tree()
1255 if (ret) in btrfs_clear_free_space_tree()
1271 btrfs_abort_transaction(trans, ret); in btrfs_clear_free_space_tree()
1273 return ret; in btrfs_clear_free_space_tree()
1280 int ret; in __add_block_group_free_space() local
1284 ret = add_new_free_space_info(trans, block_group, path); in __add_block_group_free_space()
1285 if (ret) in __add_block_group_free_space()
1286 return ret; in __add_block_group_free_space()
1298 int ret = 0; in add_block_group_free_space() local
1309 ret = -ENOMEM; in add_block_group_free_space()
1313 ret = __add_block_group_free_space(trans, block_group, path); in add_block_group_free_space()
1318 if (ret) in add_block_group_free_space()
1319 btrfs_abort_transaction(trans, ret); in add_block_group_free_space()
1320 return ret; in add_block_group_free_space()
1332 int ret; in remove_block_group_free_space() local
1344 ret = -ENOMEM; in remove_block_group_free_space()
1356 ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1); in remove_block_group_free_space()
1357 if (ret) in remove_block_group_free_space()
1385 ret = btrfs_del_items(trans, root, path, path->slots[0], nr); in remove_block_group_free_space()
1386 if (ret) in remove_block_group_free_space()
1391 ret = 0; in remove_block_group_free_space()
1394 if (ret) in remove_block_group_free_space()
1395 btrfs_abort_transaction(trans, ret); in remove_block_group_free_space()
1396 return ret; in remove_block_group_free_space()
1413 int ret; in load_free_space_bitmaps() local
1422 ret = btrfs_next_item(root, path); in load_free_space_bitmaps()
1423 if (ret < 0) in load_free_space_bitmaps()
1425 if (ret) in load_free_space_bitmaps()
1469 ret = -EIO; in load_free_space_bitmaps()
1475 ret = 0; in load_free_space_bitmaps()
1477 return ret; in load_free_space_bitmaps()
1491 int ret; in load_free_space_extents() local
1500 ret = btrfs_next_item(root, path); in load_free_space_extents()
1501 if (ret < 0) in load_free_space_extents()
1503 if (ret) in load_free_space_extents()
1531 ret = -EIO; in load_free_space_extents()
1537 ret = 0; in load_free_space_extents()
1539 return ret; in load_free_space_extents()
1548 int ret; in load_free_space_tree() local
1566 ret = PTR_ERR(info); in load_free_space_tree()
1578 ret = load_free_space_bitmaps(caching_ctl, path, extent_count); in load_free_space_tree()
1580 ret = load_free_space_extents(caching_ctl, path, extent_count); in load_free_space_tree()
1584 return ret; in load_free_space_tree()