Lines Matching full: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()
92 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_set_count() local
94 r = sm_ll_insert(&smd->ll, b, count, &ev); in sm_disk_set_count()
105 smd->nr_allocated_this_transaction++; in sm_disk_set_count()
113 r = sm_ll_lookup(&smd->old_ll, b, &old_count); in sm_disk_set_count()
118 smd->nr_allocated_this_transaction--; in sm_disk_set_count()
130 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_inc_block() local
132 r = sm_ll_inc(&smd->ll, b, &ev); in sm_disk_inc_block()
138 smd->nr_allocated_this_transaction++; in sm_disk_inc_block()
148 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_dec_block() local
150 r = sm_ll_dec(&smd->ll, b, &ev); in sm_disk_dec_block()
156 r = sm_ll_lookup(&smd->old_ll, b, &old_count); in sm_disk_dec_block()
158 smd->nr_allocated_this_transaction--; in sm_disk_dec_block()
168 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_new_block() local
173 r = sm_ll_find_common_free_block(&smd->old_ll, &smd->ll, smd->begin, smd->ll.nr_blocks, b); in sm_disk_new_block()
177 smd->begin = *b + 1; in sm_disk_new_block()
178 r = sm_ll_inc(&smd->ll, *b, &ev); in sm_disk_new_block()
181 smd->nr_allocated_this_transaction++; in sm_disk_new_block()
191 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_commit() local
197 r = sm_ll_commit(&smd->ll); in sm_disk_commit()
201 memcpy(&smd->old_ll, &smd->ll, sizeof(smd->old_ll)); in sm_disk_commit()
202 smd->begin = 0; in sm_disk_commit()
203 smd->nr_allocated_this_transaction = 0; in sm_disk_commit()
221 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_copy_root() local
224 root_le.nr_blocks = cpu_to_le64(smd->ll.nr_blocks); in sm_disk_copy_root()
225 root_le.nr_allocated = cpu_to_le64(smd->ll.nr_allocated); in sm_disk_copy_root()
226 root_le.bitmap_root = cpu_to_le64(smd->ll.bitmap_root); in sm_disk_copy_root()
227 root_le.ref_count_root = cpu_to_le64(smd->ll.ref_count_root); in sm_disk_copy_root()
260 struct sm_disk *smd; in dm_sm_disk_create() local
262 smd = kmalloc(sizeof(*smd), GFP_KERNEL); in dm_sm_disk_create()
263 if (!smd) in dm_sm_disk_create()
266 smd->begin = 0; in dm_sm_disk_create()
267 smd->nr_allocated_this_transaction = 0; in dm_sm_disk_create()
268 memcpy(&smd->sm, &ops, sizeof(smd->sm)); in dm_sm_disk_create()
270 r = sm_ll_new_disk(&smd->ll, tm); in dm_sm_disk_create()
274 r = sm_ll_extend(&smd->ll, nr_blocks); in dm_sm_disk_create()
278 r = sm_disk_commit(&smd->sm); in dm_sm_disk_create()
282 return &smd->sm; in dm_sm_disk_create()
285 kfree(smd); in dm_sm_disk_create()
294 struct sm_disk *smd; in dm_sm_disk_open() local
296 smd = kmalloc(sizeof(*smd), GFP_KERNEL); in dm_sm_disk_open()
297 if (!smd) in dm_sm_disk_open()
300 smd->begin = 0; in dm_sm_disk_open()
301 smd->nr_allocated_this_transaction = 0; in dm_sm_disk_open()
302 memcpy(&smd->sm, &ops, sizeof(smd->sm)); in dm_sm_disk_open()
304 r = sm_ll_open_disk(&smd->ll, tm, root_le, len); in dm_sm_disk_open()
308 r = sm_disk_commit(&smd->sm); in dm_sm_disk_open()
312 return &smd->sm; in dm_sm_disk_open()
315 kfree(smd); in dm_sm_disk_open()