• Home
  • Raw
  • Download

Lines Matching refs:r

203 	int r;  in __superblock_all_zeroes()  local
212 r = dm_bm_read_lock(bm, CACHE_SUPERBLOCK_LOCATION, NULL, &b); in __superblock_all_zeroes()
213 if (r) in __superblock_all_zeroes()
214 return r; in __superblock_all_zeroes()
247 int r; in __write_initial_superblock() local
257 r = dm_sm_root_size(cmd->metadata_sm, &metadata_len); in __write_initial_superblock()
258 if (r < 0) in __write_initial_superblock()
259 return r; in __write_initial_superblock()
261 r = dm_tm_pre_commit(cmd->tm); in __write_initial_superblock()
262 if (r < 0) in __write_initial_superblock()
263 return r; in __write_initial_superblock()
265 r = superblock_lock_zero(cmd, &sblock); in __write_initial_superblock()
266 if (r) in __write_initial_superblock()
267 return r; in __write_initial_superblock()
278 r = dm_sm_copy_root(cmd->metadata_sm, &disk_super->metadata_space_map_root, in __write_initial_superblock()
280 if (r < 0) in __write_initial_superblock()
301 return r; in __write_initial_superblock()
306 int r; in __format_metadata() local
308 r = dm_tm_create_with_sm(cmd->bm, CACHE_SUPERBLOCK_LOCATION, in __format_metadata()
310 if (r < 0) { in __format_metadata()
312 return r; in __format_metadata()
317 r = dm_array_empty(&cmd->info, &cmd->root); in __format_metadata()
318 if (r < 0) in __format_metadata()
323 r = dm_bitset_empty(&cmd->discard_info, &cmd->discard_root); in __format_metadata()
324 if (r < 0) in __format_metadata()
330 r = __write_initial_superblock(cmd); in __format_metadata()
331 if (r) in __format_metadata()
341 return r; in __format_metadata()
374 int r; in __open_metadata() local
379 r = superblock_read_lock(cmd, &sblock); in __open_metadata()
380 if (r < 0) { in __open_metadata()
382 return r; in __open_metadata()
387 r = __check_incompat_features(disk_super, cmd); in __open_metadata()
388 if (r < 0) in __open_metadata()
391 r = dm_tm_open_with_sm(cmd->bm, CACHE_SUPERBLOCK_LOCATION, in __open_metadata()
395 if (r < 0) { in __open_metadata()
408 return r; in __open_metadata()
414 int r, unformatted; in __open_or_format_metadata() local
416 r = __superblock_all_zeroes(cmd->bm, &unformatted); in __open_or_format_metadata()
417 if (r) in __open_or_format_metadata()
418 return r; in __open_or_format_metadata()
429 int r; in __create_persistent_data_objects() local
438 r = __open_or_format_metadata(cmd, may_format_device); in __create_persistent_data_objects()
439 if (r) in __create_persistent_data_objects()
442 return r; in __create_persistent_data_objects()
503 int r; in __begin_transaction_flags() local
507 r = superblock_lock(cmd, &sblock); in __begin_transaction_flags()
508 if (r) in __begin_transaction_flags()
509 return r; in __begin_transaction_flags()
520 int r; in __begin_transaction() local
528 r = superblock_read_lock(cmd, &sblock); in __begin_transaction()
529 if (r) in __begin_transaction()
530 return r; in __begin_transaction()
542 int r; in __commit_transaction() local
552 r = dm_bitset_flush(&cmd->discard_info, cmd->discard_root, in __commit_transaction()
554 if (r) in __commit_transaction()
555 return r; in __commit_transaction()
557 r = dm_tm_pre_commit(cmd->tm); in __commit_transaction()
558 if (r < 0) in __commit_transaction()
559 return r; in __commit_transaction()
561 r = dm_sm_root_size(cmd->metadata_sm, &metadata_len); in __commit_transaction()
562 if (r < 0) in __commit_transaction()
563 return r; in __commit_transaction()
565 r = superblock_lock(cmd, &sblock); in __commit_transaction()
566 if (r) in __commit_transaction()
567 return r; in __commit_transaction()
590 r = dm_sm_copy_root(cmd->metadata_sm, &disk_super->metadata_space_map_root, in __commit_transaction()
592 if (r < 0) { in __commit_transaction()
594 return r; in __commit_transaction()
632 int r; in dm_cache_metadata_open() local
648 r = __create_persistent_data_objects(cmd, may_format_device); in dm_cache_metadata_open()
649 if (r) { in dm_cache_metadata_open()
651 return ERR_PTR(r); in dm_cache_metadata_open()
654 r = __begin_transaction_flags(cmd, clear_clean_shutdown); in dm_cache_metadata_open()
655 if (r < 0) { in dm_cache_metadata_open()
657 return ERR_PTR(r); in dm_cache_metadata_open()
671 int r; in dm_cache_resize() local
676 r = dm_array_resize(&cmd->info, cmd->root, from_cblock(cmd->cache_blocks), in dm_cache_resize()
679 if (!r) in dm_cache_resize()
684 return r; in dm_cache_resize()
691 int r; in dm_cache_discard_bitset_resize() local
694 r = dm_bitset_resize(&cmd->discard_info, in dm_cache_discard_bitset_resize()
699 if (!r) { in dm_cache_discard_bitset_resize()
707 return r; in dm_cache_discard_bitset_resize()
733 int r; in __discard() local
735 r = (discard ? __set_discard : __clear_discard)(cmd, dblock); in __discard()
736 if (r) in __discard()
737 return r; in __discard()
746 int r; in dm_cache_set_discard() local
749 r = __discard(cmd, dblock, discard); in dm_cache_set_discard()
752 return r; in dm_cache_set_discard()
758 int r = 0; in __load_discards() local
766 r = __is_discarded(cmd, dblock, &discard); in __load_discards()
767 if (r) in __load_discards()
768 return r; in __load_discards()
772 r = fn(context, cmd->discard_block_size, dblock, discard); in __load_discards()
773 if (r) in __load_discards()
777 return r; in __load_discards()
783 int r; in dm_cache_load_discards() local
786 r = __load_discards(cmd, fn, context); in dm_cache_load_discards()
789 return r; in dm_cache_load_discards()
794 dm_cblock_t r; in dm_cache_size() local
797 r = cmd->cache_blocks; in dm_cache_size()
800 return r; in dm_cache_size()
805 int r; in __remove() local
809 r = dm_array_set_value(&cmd->info, cmd->root, from_cblock(cblock), in __remove()
811 if (r) in __remove()
812 return r; in __remove()
820 int r; in dm_cache_remove_mapping() local
823 r = __remove(cmd, cblock); in dm_cache_remove_mapping()
826 return r; in dm_cache_remove_mapping()
832 int r; in __insert() local
836 r = dm_array_set_value(&cmd->info, cmd->root, from_cblock(cblock), in __insert()
838 if (r) in __insert()
839 return r; in __insert()
848 int r; in dm_cache_insert_mapping() local
851 r = __insert(cmd, cblock, oblock); in dm_cache_insert_mapping()
854 return r; in dm_cache_insert_mapping()
908 int r = 0; in __load_mapping() local
922 r = dm_array_get_value(&cmd->hint_info, cmd->hint_root, in __load_mapping()
924 if (r && r != -ENODATA) in __load_mapping()
925 return r; in __load_mapping()
929 r = thunk->fn(thunk->context, oblock, to_cblock(cblock), in __load_mapping()
933 return r; in __load_mapping()
956 int r; in dm_cache_load_mappings() local
959 r = __load_mappings(cmd, policy, fn, context); in dm_cache_load_mappings()
962 return r; in dm_cache_load_mappings()
967 int r = 0; in __dump_mapping() local
975 return r; in __dump_mapping()
992 int r; in dm_cache_changed_this_transaction() local
995 r = cmd->changed; in dm_cache_changed_this_transaction()
998 return r; in dm_cache_changed_this_transaction()
1003 int r; in __dirty() local
1008 r = dm_array_get_value(&cmd->info, cmd->root, from_cblock(cblock), &value); in __dirty()
1009 if (r) in __dirty()
1010 return r; in __dirty()
1021 r = dm_array_set_value(&cmd->info, cmd->root, from_cblock(cblock), in __dirty()
1023 if (r) in __dirty()
1024 return r; in __dirty()
1034 int r; in dm_cache_set_dirty() local
1037 r = __dirty(cmd, cblock, dirty); in dm_cache_set_dirty()
1040 return r; in dm_cache_set_dirty()
1061 int r; in dm_cache_commit() local
1066 r = __commit_transaction(cmd, mutator); in dm_cache_commit()
1067 if (r) in dm_cache_commit()
1070 r = __begin_transaction(cmd); in dm_cache_commit()
1074 return r; in dm_cache_commit()
1080 int r = -EINVAL; in dm_cache_get_free_metadata_block_count() local
1083 r = dm_sm_get_nr_free(cmd->metadata_sm, result); in dm_cache_get_free_metadata_block_count()
1086 return r; in dm_cache_get_free_metadata_block_count()
1092 int r = -EINVAL; in dm_cache_get_metadata_dev_size() local
1095 r = dm_sm_get_nr_blocks(cmd->metadata_sm, result); in dm_cache_get_metadata_dev_size()
1098 return r; in dm_cache_get_metadata_dev_size()
1105 int r; in begin_hints() local
1125 r = dm_array_del(&cmd->hint_info, cmd->hint_root); in begin_hints()
1126 if (r) in begin_hints()
1127 return r; in begin_hints()
1130 r = dm_array_empty(&cmd->hint_info, &cmd->hint_root); in begin_hints()
1131 if (r) in begin_hints()
1132 return r; in begin_hints()
1136 r = dm_array_resize(&cmd->hint_info, cmd->hint_root, 0, in begin_hints()
1139 if (r) in begin_hints()
1140 return r; in begin_hints()
1148 int r; in dm_cache_begin_hints() local
1151 r = begin_hints(cmd, policy); in dm_cache_begin_hints()
1154 return r; in dm_cache_begin_hints()
1160 int r; in save_hint() local
1164 r = dm_array_set_value(&cmd->hint_info, cmd->hint_root, in save_hint()
1168 return r; in save_hint()
1174 int r; in dm_cache_save_hint() local
1180 r = save_hint(cmd, cblock, hint); in dm_cache_save_hint()
1183 return r; in dm_cache_save_hint()