Lines Matching refs:r
239 int r; in sm_ll_extend() local
261 r = dm_tm_new_block(ll->tm, &dm_sm_bitmap_validator, &b); in sm_ll_extend()
262 if (r < 0) in sm_ll_extend()
263 return r; in sm_ll_extend()
272 r = ll->save_ie(ll, i, &idx); in sm_ll_extend()
273 if (r < 0) in sm_ll_extend()
274 return r; in sm_ll_extend()
282 int r; in sm_ll_lookup_bitmap() local
293 r = ll->load_ie(ll, index, &ie_disk); in sm_ll_lookup_bitmap()
294 if (r < 0) in sm_ll_lookup_bitmap()
295 return r; in sm_ll_lookup_bitmap()
297 r = dm_tm_read_lock(ll->tm, le64_to_cpu(ie_disk.blocknr), in sm_ll_lookup_bitmap()
299 if (r < 0) in sm_ll_lookup_bitmap()
300 return r; in sm_ll_lookup_bitmap()
313 int r; in sm_ll_lookup_big_ref_count() local
315 r = dm_btree_lookup(&ll->ref_count_info, ll->ref_count_root, &b, &le_rc); in sm_ll_lookup_big_ref_count()
316 if (r < 0) in sm_ll_lookup_big_ref_count()
317 return r; in sm_ll_lookup_big_ref_count()
321 return r; in sm_ll_lookup_big_ref_count()
326 int r = sm_ll_lookup_bitmap(ll, b, result); in sm_ll_lookup() local
328 if (r) in sm_ll_lookup()
329 return r; in sm_ll_lookup()
332 return r; in sm_ll_lookup()
340 int r; in sm_ll_find_free_block() local
358 r = ll->load_ie(ll, i, &ie_disk); in sm_ll_find_free_block()
359 if (r < 0) in sm_ll_find_free_block()
360 return r; in sm_ll_find_free_block()
365 r = dm_tm_read_lock(ll->tm, le64_to_cpu(ie_disk.blocknr), in sm_ll_find_free_block()
367 if (r < 0) in sm_ll_find_free_block()
368 return r; in sm_ll_find_free_block()
372 r = sm_find_free(dm_bitmap_data(blk), in sm_ll_find_free_block()
375 if (r == -ENOSPC) { in sm_ll_find_free_block()
396 int r; in sm_ll_find_common_free_block() local
400 r = sm_ll_find_free_block(new_ll, begin, new_ll->nr_blocks, b); in sm_ll_find_common_free_block()
401 if (r) in sm_ll_find_common_free_block()
408 r = sm_ll_lookup(old_ll, *b, &count); in sm_ll_find_common_free_block()
409 if (r) in sm_ll_find_common_free_block()
417 return r; in sm_ll_find_common_free_block()
425 int r; in sm_ll_insert() local
434 r = ll->load_ie(ll, index, &ie_disk); in sm_ll_insert()
435 if (r < 0) in sm_ll_insert()
436 return r; in sm_ll_insert()
438 r = dm_tm_shadow_block(ll->tm, le64_to_cpu(ie_disk.blocknr), in sm_ll_insert()
440 if (r < 0) { in sm_ll_insert()
442 return r; in sm_ll_insert()
449 r = sm_ll_lookup_big_ref_count(ll, b, &old); in sm_ll_insert()
450 if (r < 0) { in sm_ll_insert()
452 return r; in sm_ll_insert()
456 if (r) { in sm_ll_insert()
458 return r; in sm_ll_insert()
466 r = dm_btree_remove(&ll->ref_count_info, in sm_ll_insert()
469 if (r) in sm_ll_insert()
470 return r; in sm_ll_insert()
480 r = dm_btree_insert(&ll->ref_count_info, ll->ref_count_root, in sm_ll_insert()
482 if (r < 0) { in sm_ll_insert()
484 return r; in sm_ll_insert()
553 int r; in __sm_ll_inc_overflow() local
565 r = btree_get_overwrite_leaf(&ll->ref_count_info, ll->ref_count_root, in __sm_ll_inc_overflow()
567 if (r < 0) in __sm_ll_inc_overflow()
568 return r; in __sm_ll_inc_overflow()
611 int r, inc; in shadow_bitmap() local
613 r = dm_tm_shadow_block(ll->tm, le64_to_cpu(ic->ie_disk.blocknr), in shadow_bitmap()
615 if (r < 0) { in shadow_bitmap()
617 return r; in shadow_bitmap()
632 int r = dm_bm_write_lock(dm_tm_get_bm(ll->tm), le64_to_cpu(ic->ie_disk.blocknr), in ensure_bitmap() local
634 if (r) { in ensure_bitmap()
636 return r; in ensure_bitmap()
652 int r; in sm_ll_inc_bitmap() local
662 r = ensure_bitmap(ll, ic); in sm_ll_inc_bitmap()
663 if (r) in sm_ll_inc_bitmap()
664 return r; in sm_ll_inc_bitmap()
690 r = dm_btree_insert(&ll->ref_count_info, ll->ref_count_root, in sm_ll_inc_bitmap()
692 if (r < 0) { in sm_ll_inc_bitmap()
694 return r; in sm_ll_inc_bitmap()
702 r = sm_ll_inc_overflow(ll, b, ic); in sm_ll_inc_bitmap()
703 if (r < 0) in sm_ll_inc_bitmap()
704 return r; in sm_ll_inc_bitmap()
719 int r; in __sm_ll_inc() local
727 r = ll->load_ie(ll, index, &ic.ie_disk); in __sm_ll_inc()
728 if (r < 0) in __sm_ll_inc()
729 return r; in __sm_ll_inc()
731 r = shadow_bitmap(ll, &ic); in __sm_ll_inc()
732 if (r) in __sm_ll_inc()
733 return r; in __sm_ll_inc()
736 r = sm_ll_inc_bitmap(ll, b, bit, bit_end, nr_allocations, new_b, &ic); in __sm_ll_inc()
740 if (r) in __sm_ll_inc()
741 return r; in __sm_ll_inc()
751 int r = __sm_ll_inc(ll, b, e, nr_allocations, &b); in sm_ll_inc() local
753 if (r) in sm_ll_inc()
754 return r; in sm_ll_inc()
773 int r; in __sm_ll_dec_overflow() local
780 r = btree_get_overwrite_leaf(&ll->ref_count_info, ll->ref_count_root, in __sm_ll_dec_overflow()
782 if (r < 0) in __sm_ll_dec_overflow()
783 return r; in __sm_ll_dec_overflow()
845 int r; in sm_ll_dec_bitmap() local
854 r = ensure_bitmap(ll, ic); in sm_ll_dec_bitmap()
855 if (r) in sm_ll_dec_bitmap()
856 return r; in sm_ll_dec_bitmap()
880 r = sm_ll_dec_overflow(ll, b, ic, &old); in sm_ll_dec_bitmap()
881 if (r < 0) in sm_ll_dec_bitmap()
882 return r; in sm_ll_dec_bitmap()
885 r = ensure_bitmap(ll, ic); in sm_ll_dec_bitmap()
886 if (r) in sm_ll_dec_bitmap()
887 return r; in sm_ll_dec_bitmap()
902 int r; in __sm_ll_dec() local
910 r = ll->load_ie(ll, index, &ic.ie_disk); in __sm_ll_dec()
911 if (r < 0) in __sm_ll_dec()
912 return r; in __sm_ll_dec()
914 r = shadow_bitmap(ll, &ic); in __sm_ll_dec()
915 if (r) in __sm_ll_dec()
916 return r; in __sm_ll_dec()
919 r = sm_ll_dec_bitmap(ll, b, bit, bit_end, &ic, nr_allocations, new_b); in __sm_ll_dec()
922 if (r) in __sm_ll_dec()
923 return r; in __sm_ll_dec()
933 int r = __sm_ll_dec(ll, b, e, nr_allocations, &b); in sm_ll_dec() local
935 if (r) in sm_ll_dec()
936 return r; in sm_ll_dec()
946 int r = 0; in sm_ll_commit() local
949 r = ll->commit(ll); in sm_ll_commit()
950 if (!r) in sm_ll_commit()
954 return r; in sm_ll_commit()
976 int r; in metadata_ll_init_index() local
979 r = dm_tm_new_block(ll->tm, &index_validator, &b); in metadata_ll_init_index()
980 if (r < 0) in metadata_ll_init_index()
981 return r; in metadata_ll_init_index()
992 int r; in metadata_ll_open() local
995 r = dm_tm_read_lock(ll->tm, ll->bitmap_root, in metadata_ll_open()
997 if (r) in metadata_ll_open()
998 return r; in metadata_ll_open()
1013 int r, inc; in metadata_ll_commit() local
1016 r = dm_tm_shadow_block(ll->tm, ll->bitmap_root, &index_validator, &b, &inc); in metadata_ll_commit()
1017 if (r) in metadata_ll_commit()
1018 return r; in metadata_ll_commit()
1030 int r; in sm_ll_new_metadata() local
1032 r = sm_ll_init(ll, tm); in sm_ll_new_metadata()
1033 if (r < 0) in sm_ll_new_metadata()
1034 return r; in sm_ll_new_metadata()
1046 r = ll->init_index(ll); in sm_ll_new_metadata()
1047 if (r < 0) in sm_ll_new_metadata()
1048 return r; in sm_ll_new_metadata()
1050 r = dm_btree_empty(&ll->ref_count_info, &ll->ref_count_root); in sm_ll_new_metadata()
1051 if (r < 0) in sm_ll_new_metadata()
1052 return r; in sm_ll_new_metadata()
1060 int r; in sm_ll_open_metadata() local
1074 r = sm_ll_init(ll, tm); in sm_ll_open_metadata()
1075 if (r < 0) in sm_ll_open_metadata()
1076 return r; in sm_ll_open_metadata()
1111 int r; in disk_ll_load_ie() local
1122 r = ie_cache_writeback(ll, iec); in disk_ll_load_ie()
1123 if (r) in disk_ll_load_ie()
1124 return r; in disk_ll_load_ie()
1128 r = dm_btree_lookup(&ll->bitmap_info, ll->bitmap_root, &index, ie); in disk_ll_load_ie()
1129 if (!r) { in disk_ll_load_ie()
1136 return r; in disk_ll_load_ie()
1142 int r; in disk_ll_save_ie() local
1155 r = ie_cache_writeback(ll, iec); in disk_ll_save_ie()
1156 if (r) in disk_ll_save_ie()
1157 return r; in disk_ll_save_ie()
1193 int r = 0; in disk_ll_commit() local
1200 r = ie_cache_writeback(ll, iec); in disk_ll_commit()
1203 return r; in disk_ll_commit()
1208 int r; in sm_ll_new_disk() local
1210 r = sm_ll_init(ll, tm); in sm_ll_new_disk()
1211 if (r < 0) in sm_ll_new_disk()
1212 return r; in sm_ll_new_disk()
1224 r = ll->init_index(ll); in sm_ll_new_disk()
1225 if (r < 0) in sm_ll_new_disk()
1226 return r; in sm_ll_new_disk()
1228 r = dm_btree_empty(&ll->ref_count_info, &ll->ref_count_root); in sm_ll_new_disk()
1229 if (r < 0) in sm_ll_new_disk()
1230 return r; in sm_ll_new_disk()
1238 int r; in sm_ll_open_disk() local
1246 r = sm_ll_init(ll, tm); in sm_ll_open_disk()
1247 if (r < 0) in sm_ll_open_disk()
1248 return r; in sm_ll_open_disk()