Lines Matching refs:r
234 int r; in sm_ll_extend() local
256 r = dm_tm_new_block(ll->tm, &dm_sm_bitmap_validator, &b); in sm_ll_extend()
257 if (r < 0) in sm_ll_extend()
258 return r; in sm_ll_extend()
262 r = dm_tm_unlock(ll->tm, b); in sm_ll_extend()
263 if (r < 0) in sm_ll_extend()
264 return r; in sm_ll_extend()
269 r = ll->save_ie(ll, i, &idx); in sm_ll_extend()
270 if (r < 0) in sm_ll_extend()
271 return r; in sm_ll_extend()
279 int r; in sm_ll_lookup_bitmap() local
285 r = ll->load_ie(ll, index, &ie_disk); in sm_ll_lookup_bitmap()
286 if (r < 0) in sm_ll_lookup_bitmap()
287 return r; in sm_ll_lookup_bitmap()
289 r = dm_tm_read_lock(ll->tm, le64_to_cpu(ie_disk.blocknr), in sm_ll_lookup_bitmap()
291 if (r < 0) in sm_ll_lookup_bitmap()
292 return r; in sm_ll_lookup_bitmap()
303 int r; in sm_ll_lookup_big_ref_count() local
305 r = dm_btree_lookup(&ll->ref_count_info, ll->ref_count_root, &b, &le_rc); in sm_ll_lookup_big_ref_count()
306 if (r < 0) in sm_ll_lookup_big_ref_count()
307 return r; in sm_ll_lookup_big_ref_count()
311 return r; in sm_ll_lookup_big_ref_count()
316 int r = sm_ll_lookup_bitmap(ll, b, result); in sm_ll_lookup() local
318 if (r) in sm_ll_lookup()
319 return r; in sm_ll_lookup()
322 return r; in sm_ll_lookup()
330 int r; in sm_ll_find_free_block() local
346 r = ll->load_ie(ll, i, &ie_disk); in sm_ll_find_free_block()
347 if (r < 0) in sm_ll_find_free_block()
348 return r; in sm_ll_find_free_block()
353 r = dm_tm_read_lock(ll->tm, le64_to_cpu(ie_disk.blocknr), in sm_ll_find_free_block()
355 if (r < 0) in sm_ll_find_free_block()
356 return r; in sm_ll_find_free_block()
360 r = sm_find_free(dm_bitmap_data(blk), in sm_ll_find_free_block()
363 if (r == -ENOSPC) { in sm_ll_find_free_block()
371 } else if (r < 0) { in sm_ll_find_free_block()
373 return r; in sm_ll_find_free_block()
376 r = dm_tm_unlock(ll->tm, blk); in sm_ll_find_free_block()
377 if (r < 0) in sm_ll_find_free_block()
378 return r; in sm_ll_find_free_block()
391 int r; in sm_ll_mutate() local
400 r = ll->load_ie(ll, index, &ie_disk); in sm_ll_mutate()
401 if (r < 0) in sm_ll_mutate()
402 return r; in sm_ll_mutate()
404 r = dm_tm_shadow_block(ll->tm, le64_to_cpu(ie_disk.blocknr), in sm_ll_mutate()
406 if (r < 0) { in sm_ll_mutate()
408 return r; in sm_ll_mutate()
416 r = sm_ll_lookup_big_ref_count(ll, b, &old); in sm_ll_mutate()
417 if (r < 0) { in sm_ll_mutate()
419 return r; in sm_ll_mutate()
423 r = mutator(context, old, &ref_count); in sm_ll_mutate()
424 if (r) { in sm_ll_mutate()
426 return r; in sm_ll_mutate()
432 r = dm_tm_unlock(ll->tm, nb); in sm_ll_mutate()
433 if (r < 0) in sm_ll_mutate()
434 return r; in sm_ll_mutate()
437 r = dm_btree_remove(&ll->ref_count_info, in sm_ll_mutate()
440 if (r) in sm_ll_mutate()
441 return r; in sm_ll_mutate()
448 r = dm_tm_unlock(ll->tm, nb); in sm_ll_mutate()
449 if (r < 0) in sm_ll_mutate()
450 return r; in sm_ll_mutate()
453 r = dm_btree_insert(&ll->ref_count_info, ll->ref_count_root, in sm_ll_mutate()
455 if (r < 0) { in sm_ll_mutate()
457 return r; in sm_ll_mutate()
519 int r = 0; in sm_ll_commit() local
522 r = ll->commit(ll); in sm_ll_commit()
523 if (!r) in sm_ll_commit()
527 return r; in sm_ll_commit()
549 int r; in metadata_ll_init_index() local
552 r = dm_tm_new_block(ll->tm, &index_validator, &b); in metadata_ll_init_index()
553 if (r < 0) in metadata_ll_init_index()
554 return r; in metadata_ll_init_index()
564 int r; in metadata_ll_open() local
567 r = dm_tm_read_lock(ll->tm, ll->bitmap_root, in metadata_ll_open()
569 if (r) in metadata_ll_open()
570 return r; in metadata_ll_open()
583 int r, inc; in metadata_ll_commit() local
586 r = dm_tm_shadow_block(ll->tm, ll->bitmap_root, &index_validator, &b, &inc); in metadata_ll_commit()
587 if (r) in metadata_ll_commit()
588 return r; in metadata_ll_commit()
598 int r; in sm_ll_new_metadata() local
600 r = sm_ll_init(ll, tm); in sm_ll_new_metadata()
601 if (r < 0) in sm_ll_new_metadata()
602 return r; in sm_ll_new_metadata()
614 r = ll->init_index(ll); in sm_ll_new_metadata()
615 if (r < 0) in sm_ll_new_metadata()
616 return r; in sm_ll_new_metadata()
618 r = dm_btree_empty(&ll->ref_count_info, &ll->ref_count_root); in sm_ll_new_metadata()
619 if (r < 0) in sm_ll_new_metadata()
620 return r; in sm_ll_new_metadata()
628 int r; in sm_ll_open_metadata() local
636 r = sm_ll_init(ll, tm); in sm_ll_open_metadata()
637 if (r < 0) in sm_ll_open_metadata()
638 return r; in sm_ll_open_metadata()
694 int r; in sm_ll_new_disk() local
696 r = sm_ll_init(ll, tm); in sm_ll_new_disk()
697 if (r < 0) in sm_ll_new_disk()
698 return r; in sm_ll_new_disk()
710 r = ll->init_index(ll); in sm_ll_new_disk()
711 if (r < 0) in sm_ll_new_disk()
712 return r; in sm_ll_new_disk()
714 r = dm_btree_empty(&ll->ref_count_info, &ll->ref_count_root); in sm_ll_new_disk()
715 if (r < 0) in sm_ll_new_disk()
716 return r; in sm_ll_new_disk()
724 int r; in sm_ll_open_disk() local
732 r = sm_ll_init(ll, tm); in sm_ll_open_disk()
733 if (r < 0) in sm_ll_open_disk()
734 return r; in sm_ll_open_disk()