Lines Matching refs:smd
37 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_destroy() local
39 kfree(smd); in sm_disk_destroy()
44 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_extend() local
46 return sm_ll_extend(&smd->ll, extra_blocks); in sm_disk_extend()
51 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_get_nr_blocks() local
53 *count = smd->old_ll.nr_blocks; in sm_disk_get_nr_blocks()
60 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_get_nr_free() local
62 *count = (smd->old_ll.nr_blocks - smd->old_ll.nr_allocated) - smd->nr_allocated_this_transaction; in sm_disk_get_nr_free()
70 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_get_count() local
72 return sm_ll_lookup(&smd->ll, b, result); in sm_disk_get_count()
95 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_set_count() local
97 r = sm_ll_insert(&smd->ll, b, count, &nr_allocations); in sm_disk_set_count()
99 smd->nr_allocated_this_transaction += nr_allocations; in sm_disk_set_count()
108 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_inc_blocks() local
110 r = sm_ll_inc(&smd->ll, b, e, &nr_allocations); in sm_disk_inc_blocks()
112 smd->nr_allocated_this_transaction += nr_allocations; in sm_disk_inc_blocks()
121 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_dec_blocks() local
123 r = sm_ll_dec(&smd->ll, b, e, &nr_allocations); in sm_disk_dec_blocks()
125 smd->nr_allocated_this_transaction += nr_allocations; in sm_disk_dec_blocks()
134 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_new_block() local
139 r = sm_ll_find_common_free_block(&smd->old_ll, &smd->ll, smd->begin, smd->ll.nr_blocks, b); in sm_disk_new_block()
145 r = sm_ll_find_common_free_block(&smd->old_ll, &smd->ll, 0, smd->begin, b); in sm_disk_new_block()
150 smd->begin = *b + 1; in sm_disk_new_block()
151 r = sm_ll_inc(&smd->ll, *b, *b + 1, &nr_allocations); in sm_disk_new_block()
153 smd->nr_allocated_this_transaction += nr_allocations; in sm_disk_new_block()
161 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_commit() local
163 r = sm_ll_commit(&smd->ll); in sm_disk_commit()
167 memcpy(&smd->old_ll, &smd->ll, sizeof(smd->old_ll)); in sm_disk_commit()
168 smd->nr_allocated_this_transaction = 0; in sm_disk_commit()
182 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); in sm_disk_copy_root() local
185 root_le.nr_blocks = cpu_to_le64(smd->ll.nr_blocks); in sm_disk_copy_root()
186 root_le.nr_allocated = cpu_to_le64(smd->ll.nr_allocated); in sm_disk_copy_root()
187 root_le.bitmap_root = cpu_to_le64(smd->ll.bitmap_root); in sm_disk_copy_root()
188 root_le.ref_count_root = cpu_to_le64(smd->ll.ref_count_root); in sm_disk_copy_root()
221 struct sm_disk *smd; in dm_sm_disk_create() local
223 smd = kmalloc(sizeof(*smd), GFP_KERNEL); in dm_sm_disk_create()
224 if (!smd) in dm_sm_disk_create()
227 smd->begin = 0; in dm_sm_disk_create()
228 smd->nr_allocated_this_transaction = 0; in dm_sm_disk_create()
229 memcpy(&smd->sm, &ops, sizeof(smd->sm)); in dm_sm_disk_create()
231 r = sm_ll_new_disk(&smd->ll, tm); in dm_sm_disk_create()
235 r = sm_ll_extend(&smd->ll, nr_blocks); in dm_sm_disk_create()
239 r = sm_disk_commit(&smd->sm); in dm_sm_disk_create()
243 return &smd->sm; in dm_sm_disk_create()
246 kfree(smd); in dm_sm_disk_create()
255 struct sm_disk *smd; in dm_sm_disk_open() local
257 smd = kmalloc(sizeof(*smd), GFP_KERNEL); in dm_sm_disk_open()
258 if (!smd) in dm_sm_disk_open()
261 smd->begin = 0; in dm_sm_disk_open()
262 smd->nr_allocated_this_transaction = 0; in dm_sm_disk_open()
263 memcpy(&smd->sm, &ops, sizeof(smd->sm)); in dm_sm_disk_open()
265 r = sm_ll_open_disk(&smd->ll, tm, root_le, len); in dm_sm_disk_open()
269 r = sm_disk_commit(&smd->sm); in dm_sm_disk_open()
273 return &smd->sm; in dm_sm_disk_open()
276 kfree(smd); in dm_sm_disk_open()