Lines Matching refs:sm

158 	struct dm_space_map sm;  member
263 static void sm_metadata_destroy(struct dm_space_map *sm) in sm_metadata_destroy() argument
265 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_destroy()
270 static int sm_metadata_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count) in sm_metadata_get_nr_blocks() argument
272 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_get_nr_blocks()
279 static int sm_metadata_get_nr_free(struct dm_space_map *sm, dm_block_t *count) in sm_metadata_get_nr_free() argument
281 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_get_nr_free()
289 static int sm_metadata_get_count(struct dm_space_map *sm, dm_block_t b, in sm_metadata_get_count() argument
294 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_get_count()
329 static int sm_metadata_count_is_more_than_one(struct dm_space_map *sm, in sm_metadata_count_is_more_than_one() argument
334 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_count_is_more_than_one()
381 static int sm_metadata_set_count(struct dm_space_map *sm, dm_block_t b, in sm_metadata_set_count() argument
386 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_set_count()
400 static int sm_metadata_inc_block(struct dm_space_map *sm, dm_block_t b) in sm_metadata_inc_block() argument
404 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_inc_block()
417 static int sm_metadata_dec_block(struct dm_space_map *sm, dm_block_t b) in sm_metadata_dec_block() argument
421 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_dec_block()
434 static int sm_metadata_new_block_(struct dm_space_map *sm, dm_block_t *b) in sm_metadata_new_block_() argument
438 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_new_block_()
460 static int sm_metadata_new_block(struct dm_space_map *sm, dm_block_t *b) in sm_metadata_new_block() argument
463 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_new_block()
465 int r = sm_metadata_new_block_(sm, b); in sm_metadata_new_block()
471 r = sm_metadata_get_nr_free(sm, &count); in sm_metadata_new_block()
482 static int sm_metadata_commit(struct dm_space_map *sm) in sm_metadata_commit() argument
485 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_commit()
498 static int sm_metadata_register_threshold_callback(struct dm_space_map *sm, in sm_metadata_register_threshold_callback() argument
503 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_register_threshold_callback()
510 static int sm_metadata_root_size(struct dm_space_map *sm, size_t *result) in sm_metadata_root_size() argument
517 static int sm_metadata_copy_root(struct dm_space_map *sm, void *where_le, size_t max) in sm_metadata_copy_root() argument
519 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_copy_root()
535 static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks);
560 static void sm_bootstrap_destroy(struct dm_space_map *sm) in sm_bootstrap_destroy() argument
564 static int sm_bootstrap_extend(struct dm_space_map *sm, dm_block_t extra_blocks) in sm_bootstrap_extend() argument
571 static int sm_bootstrap_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count) in sm_bootstrap_get_nr_blocks() argument
573 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_get_nr_blocks()
580 static int sm_bootstrap_get_nr_free(struct dm_space_map *sm, dm_block_t *count) in sm_bootstrap_get_nr_free() argument
582 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_get_nr_free()
589 static int sm_bootstrap_get_count(struct dm_space_map *sm, dm_block_t b, in sm_bootstrap_get_count() argument
592 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_get_count()
599 static int sm_bootstrap_count_is_more_than_one(struct dm_space_map *sm, in sm_bootstrap_count_is_more_than_one() argument
607 static int sm_bootstrap_set_count(struct dm_space_map *sm, dm_block_t b, in sm_bootstrap_set_count() argument
615 static int sm_bootstrap_new_block(struct dm_space_map *sm, dm_block_t *b) in sm_bootstrap_new_block() argument
617 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_new_block()
630 static int sm_bootstrap_inc_block(struct dm_space_map *sm, dm_block_t b) in sm_bootstrap_inc_block() argument
632 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_inc_block()
637 static int sm_bootstrap_dec_block(struct dm_space_map *sm, dm_block_t b) in sm_bootstrap_dec_block() argument
639 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_dec_block()
644 static int sm_bootstrap_commit(struct dm_space_map *sm) in sm_bootstrap_commit() argument
649 static int sm_bootstrap_root_size(struct dm_space_map *sm, size_t *result) in sm_bootstrap_root_size() argument
656 static int sm_bootstrap_copy_root(struct dm_space_map *sm, void *where, in sm_bootstrap_copy_root() argument
683 static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks) in sm_metadata_extend() argument
687 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_extend()
694 memcpy(sm, &bootstrap_ops, sizeof(*sm)); in sm_metadata_extend()
731 memcpy(sm, &ops, sizeof(*sm)); in sm_metadata_extend()
745 memcpy(&smm->sm, &ops, sizeof(smm->sm)); in dm_sm_metadata_init()
747 return &smm->sm; in dm_sm_metadata_init()
750 int dm_sm_metadata_create(struct dm_space_map *sm, in dm_sm_metadata_create() argument
758 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in dm_sm_metadata_create()
766 memcpy(&smm->sm, &bootstrap_ops, sizeof(smm->sm)); in dm_sm_metadata_create()
778 memcpy(&smm->sm, &ops, sizeof(smm->sm)); in dm_sm_metadata_create()
796 return sm_metadata_commit(sm); in dm_sm_metadata_create()
799 int dm_sm_metadata_open(struct dm_space_map *sm, in dm_sm_metadata_open() argument
804 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in dm_sm_metadata_open()