Lines Matching refs:sm
167 struct dm_space_map sm; member
274 static void sm_metadata_destroy(struct dm_space_map *sm) in sm_metadata_destroy() argument
276 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_destroy()
281 static int sm_metadata_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count) in sm_metadata_get_nr_blocks() argument
283 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_get_nr_blocks()
290 static int sm_metadata_get_nr_free(struct dm_space_map *sm, dm_block_t *count) in sm_metadata_get_nr_free() argument
292 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_get_nr_free()
300 static int sm_metadata_get_count(struct dm_space_map *sm, dm_block_t b, in sm_metadata_get_count() argument
305 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_get_count()
340 static int sm_metadata_count_is_more_than_one(struct dm_space_map *sm, in sm_metadata_count_is_more_than_one() argument
345 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_count_is_more_than_one()
392 static int sm_metadata_set_count(struct dm_space_map *sm, dm_block_t b, in sm_metadata_set_count() argument
397 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_set_count()
411 static int sm_metadata_inc_block(struct dm_space_map *sm, dm_block_t b) in sm_metadata_inc_block() argument
415 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_inc_block()
428 static int sm_metadata_dec_block(struct dm_space_map *sm, dm_block_t b) in sm_metadata_dec_block() argument
432 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_dec_block()
445 static int sm_metadata_new_block_(struct dm_space_map *sm, dm_block_t *b) in sm_metadata_new_block_() argument
449 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_new_block_()
482 static int sm_metadata_new_block(struct dm_space_map *sm, dm_block_t *b) in sm_metadata_new_block() argument
485 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_new_block()
487 int r = sm_metadata_new_block_(sm, b); in sm_metadata_new_block()
493 r = sm_metadata_get_nr_free(sm, &count); in sm_metadata_new_block()
504 static int sm_metadata_commit(struct dm_space_map *sm) in sm_metadata_commit() argument
507 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_commit()
519 static int sm_metadata_register_threshold_callback(struct dm_space_map *sm, in sm_metadata_register_threshold_callback() argument
524 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_register_threshold_callback()
531 static int sm_metadata_root_size(struct dm_space_map *sm, size_t *result) in sm_metadata_root_size() argument
538 static int sm_metadata_copy_root(struct dm_space_map *sm, void *where_le, size_t max) in sm_metadata_copy_root() argument
540 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_copy_root()
556 static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks);
581 static void sm_bootstrap_destroy(struct dm_space_map *sm) in sm_bootstrap_destroy() argument
585 static int sm_bootstrap_extend(struct dm_space_map *sm, dm_block_t extra_blocks) in sm_bootstrap_extend() argument
592 static int sm_bootstrap_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count) in sm_bootstrap_get_nr_blocks() argument
594 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_get_nr_blocks()
601 static int sm_bootstrap_get_nr_free(struct dm_space_map *sm, dm_block_t *count) in sm_bootstrap_get_nr_free() argument
603 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_get_nr_free()
610 static int sm_bootstrap_get_count(struct dm_space_map *sm, dm_block_t b, in sm_bootstrap_get_count() argument
613 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_get_count()
620 static int sm_bootstrap_count_is_more_than_one(struct dm_space_map *sm, in sm_bootstrap_count_is_more_than_one() argument
628 static int sm_bootstrap_set_count(struct dm_space_map *sm, dm_block_t b, in sm_bootstrap_set_count() argument
636 static int sm_bootstrap_new_block(struct dm_space_map *sm, dm_block_t *b) in sm_bootstrap_new_block() argument
638 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_new_block()
651 static int sm_bootstrap_inc_block(struct dm_space_map *sm, dm_block_t b) in sm_bootstrap_inc_block() argument
653 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_inc_block()
658 static int sm_bootstrap_dec_block(struct dm_space_map *sm, dm_block_t b) in sm_bootstrap_dec_block() argument
660 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_dec_block()
665 static int sm_bootstrap_commit(struct dm_space_map *sm) in sm_bootstrap_commit() argument
670 static int sm_bootstrap_root_size(struct dm_space_map *sm, size_t *result) in sm_bootstrap_root_size() argument
677 static int sm_bootstrap_copy_root(struct dm_space_map *sm, void *where, in sm_bootstrap_copy_root() argument
704 static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks) in sm_metadata_extend() argument
707 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_extend()
714 memcpy(sm, &bootstrap_ops, sizeof(*sm)); in sm_metadata_extend()
752 memcpy(sm, &ops, sizeof(*sm)); in sm_metadata_extend()
766 memcpy(&smm->sm, &ops, sizeof(smm->sm)); in dm_sm_metadata_init()
768 return &smm->sm; in dm_sm_metadata_init()
771 int dm_sm_metadata_create(struct dm_space_map *sm, in dm_sm_metadata_create() argument
778 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in dm_sm_metadata_create()
786 memcpy(&smm->sm, &bootstrap_ops, sizeof(smm->sm)); in dm_sm_metadata_create()
794 memcpy(&smm->sm, &ops, sizeof(smm->sm)); in dm_sm_metadata_create()
814 return sm_metadata_commit(sm); in dm_sm_metadata_create()
817 int dm_sm_metadata_open(struct dm_space_map *sm, in dm_sm_metadata_open() argument
822 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in dm_sm_metadata_open()