Lines Matching refs:smd

36 	struct sm_disk *smd = container_of(sm, struct sm_disk, sm);  in sm_disk_destroy()  local
38 kfree(smd); in sm_disk_destroy()
43 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_extend() local
45 return sm_ll_extend(&smd->ll, extra_blocks); in sm_disk_extend()
50 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_get_nr_blocks() local
51 *count = smd->old_ll.nr_blocks; in sm_disk_get_nr_blocks()
58 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_get_nr_free() local
59 *count = (smd->old_ll.nr_blocks - smd->old_ll.nr_allocated) - smd->nr_allocated_this_transaction; in sm_disk_get_nr_free()
67 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_get_count() local
68 return sm_ll_lookup(&smd->ll, b, result); in sm_disk_get_count()
91 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_set_count() local
93 r = sm_ll_insert(&smd->ll, b, count, &nr_allocations); in sm_disk_set_count()
95 smd->nr_allocated_this_transaction += nr_allocations; in sm_disk_set_count()
105 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_inc_blocks() local
107 r = sm_ll_inc(&smd->ll, b, e, &nr_allocations); in sm_disk_inc_blocks()
109 smd->nr_allocated_this_transaction += nr_allocations; in sm_disk_inc_blocks()
118 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_dec_blocks() local
120 r = sm_ll_dec(&smd->ll, b, e, &nr_allocations); in sm_disk_dec_blocks()
122 smd->nr_allocated_this_transaction += nr_allocations; in sm_disk_dec_blocks()
131 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_new_block() local
136 r = sm_ll_find_common_free_block(&smd->old_ll, &smd->ll, smd->begin, smd->ll.nr_blocks, b); in sm_disk_new_block()
142 r = sm_ll_find_common_free_block(&smd->old_ll, &smd->ll, 0, smd->begin, b); in sm_disk_new_block()
148 smd->begin = *b + 1; in sm_disk_new_block()
149 r = sm_ll_inc(&smd->ll, *b, *b + 1, &nr_allocations); in sm_disk_new_block()
151 smd->nr_allocated_this_transaction += nr_allocations; in sm_disk_new_block()
160 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_commit() local
162 r = sm_ll_commit(&smd->ll); in sm_disk_commit()
166 memcpy(&smd->old_ll, &smd->ll, sizeof(smd->old_ll)); in sm_disk_commit()
167 smd->nr_allocated_this_transaction = 0; in sm_disk_commit()
181 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_copy_root() local
184 root_le.nr_blocks = cpu_to_le64(smd->ll.nr_blocks); in sm_disk_copy_root()
185 root_le.nr_allocated = cpu_to_le64(smd->ll.nr_allocated); in sm_disk_copy_root()
186 root_le.bitmap_root = cpu_to_le64(smd->ll.bitmap_root); in sm_disk_copy_root()
187 root_le.ref_count_root = cpu_to_le64(smd->ll.ref_count_root); in sm_disk_copy_root()
220 struct sm_disk *smd; in dm_sm_disk_create() local
222 smd = kmalloc(sizeof(*smd), GFP_KERNEL); in dm_sm_disk_create()
223 if (!smd) in dm_sm_disk_create()
226 smd->begin = 0; in dm_sm_disk_create()
227 smd->nr_allocated_this_transaction = 0; in dm_sm_disk_create()
228 memcpy(&smd->sm, &ops, sizeof(smd->sm)); in dm_sm_disk_create()
230 r = sm_ll_new_disk(&smd->ll, tm); in dm_sm_disk_create()
234 r = sm_ll_extend(&smd->ll, nr_blocks); in dm_sm_disk_create()
238 r = sm_disk_commit(&smd->sm); in dm_sm_disk_create()
242 return &smd->sm; in dm_sm_disk_create()
245 kfree(smd); in dm_sm_disk_create()
254 struct sm_disk *smd; in dm_sm_disk_open() local
256 smd = kmalloc(sizeof(*smd), GFP_KERNEL); in dm_sm_disk_open()
257 if (!smd) in dm_sm_disk_open()
260 smd->begin = 0; in dm_sm_disk_open()
261 smd->nr_allocated_this_transaction = 0; in dm_sm_disk_open()
262 memcpy(&smd->sm, &ops, sizeof(smd->sm)); in dm_sm_disk_open()
264 r = sm_ll_open_disk(&smd->ll, tm, root_le, len); in dm_sm_disk_open()
268 r = sm_disk_commit(&smd->sm); in dm_sm_disk_open()
272 return &smd->sm; in dm_sm_disk_open()
275 kfree(smd); in dm_sm_disk_open()