Lines Matching refs:sm

166 	struct dm_space_map sm;  member
273 static void sm_metadata_destroy(struct dm_space_map *sm) in sm_metadata_destroy() argument
275 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_destroy()
280 static int sm_metadata_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count) in sm_metadata_get_nr_blocks() argument
282 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_get_nr_blocks()
289 static int sm_metadata_get_nr_free(struct dm_space_map *sm, dm_block_t *count) in sm_metadata_get_nr_free() argument
291 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_get_nr_free()
299 static int sm_metadata_get_count(struct dm_space_map *sm, dm_block_t b, in sm_metadata_get_count() argument
304 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_get_count()
339 static int sm_metadata_count_is_more_than_one(struct dm_space_map *sm, in sm_metadata_count_is_more_than_one() argument
344 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_count_is_more_than_one()
391 static int sm_metadata_set_count(struct dm_space_map *sm, dm_block_t b, in sm_metadata_set_count() argument
396 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_set_count()
410 static int sm_metadata_inc_block(struct dm_space_map *sm, dm_block_t b) in sm_metadata_inc_block() argument
414 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_inc_block()
427 static int sm_metadata_dec_block(struct dm_space_map *sm, dm_block_t b) in sm_metadata_dec_block() argument
431 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_dec_block()
444 static int sm_metadata_new_block_(struct dm_space_map *sm, dm_block_t *b) in sm_metadata_new_block_() argument
448 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_new_block_()
470 static int sm_metadata_new_block(struct dm_space_map *sm, dm_block_t *b) in sm_metadata_new_block() argument
473 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_new_block()
475 int r = sm_metadata_new_block_(sm, b); in sm_metadata_new_block()
481 r = sm_metadata_get_nr_free(sm, &count); in sm_metadata_new_block()
492 static int sm_metadata_commit(struct dm_space_map *sm) in sm_metadata_commit() argument
495 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_commit()
508 static int sm_metadata_register_threshold_callback(struct dm_space_map *sm, in sm_metadata_register_threshold_callback() argument
513 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_register_threshold_callback()
520 static int sm_metadata_root_size(struct dm_space_map *sm, size_t *result) in sm_metadata_root_size() argument
527 static int sm_metadata_copy_root(struct dm_space_map *sm, void *where_le, size_t max) in sm_metadata_copy_root() argument
529 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_copy_root()
545 static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks);
570 static void sm_bootstrap_destroy(struct dm_space_map *sm) in sm_bootstrap_destroy() argument
574 static int sm_bootstrap_extend(struct dm_space_map *sm, dm_block_t extra_blocks) in sm_bootstrap_extend() argument
581 static int sm_bootstrap_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count) in sm_bootstrap_get_nr_blocks() argument
583 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_get_nr_blocks()
590 static int sm_bootstrap_get_nr_free(struct dm_space_map *sm, dm_block_t *count) in sm_bootstrap_get_nr_free() argument
592 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_get_nr_free()
599 static int sm_bootstrap_get_count(struct dm_space_map *sm, dm_block_t b, in sm_bootstrap_get_count() argument
602 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_get_count()
609 static int sm_bootstrap_count_is_more_than_one(struct dm_space_map *sm, in sm_bootstrap_count_is_more_than_one() argument
617 static int sm_bootstrap_set_count(struct dm_space_map *sm, dm_block_t b, in sm_bootstrap_set_count() argument
625 static int sm_bootstrap_new_block(struct dm_space_map *sm, dm_block_t *b) in sm_bootstrap_new_block() argument
627 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_new_block()
640 static int sm_bootstrap_inc_block(struct dm_space_map *sm, dm_block_t b) in sm_bootstrap_inc_block() argument
642 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_inc_block()
647 static int sm_bootstrap_dec_block(struct dm_space_map *sm, dm_block_t b) in sm_bootstrap_dec_block() argument
649 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_bootstrap_dec_block()
654 static int sm_bootstrap_commit(struct dm_space_map *sm) in sm_bootstrap_commit() argument
659 static int sm_bootstrap_root_size(struct dm_space_map *sm, size_t *result) in sm_bootstrap_root_size() argument
666 static int sm_bootstrap_copy_root(struct dm_space_map *sm, void *where, in sm_bootstrap_copy_root() argument
693 static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks) in sm_metadata_extend() argument
696 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in sm_metadata_extend()
703 memcpy(sm, &bootstrap_ops, sizeof(*sm)); in sm_metadata_extend()
741 memcpy(sm, &ops, sizeof(*sm)); in sm_metadata_extend()
755 memcpy(&smm->sm, &ops, sizeof(smm->sm)); in dm_sm_metadata_init()
757 return &smm->sm; in dm_sm_metadata_init()
760 int dm_sm_metadata_create(struct dm_space_map *sm, in dm_sm_metadata_create() argument
767 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in dm_sm_metadata_create()
775 memcpy(&smm->sm, &bootstrap_ops, sizeof(smm->sm)); in dm_sm_metadata_create()
787 memcpy(&smm->sm, &ops, sizeof(smm->sm)); in dm_sm_metadata_create()
805 return sm_metadata_commit(sm); in dm_sm_metadata_create()
808 int dm_sm_metadata_open(struct dm_space_map *sm, in dm_sm_metadata_open() argument
813 struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); in dm_sm_metadata_open()