Lines Matching defs:smd

36 	struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
38 kfree(smd);
43 struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
45 return sm_ll_extend(&smd->ll, extra_blocks);
50 struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
51 *count = smd->old_ll.nr_blocks;
58 struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
59 *count = (smd->old_ll.nr_blocks - smd->old_ll.nr_allocated) - smd->nr_allocated_this_transaction;
67 struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
68 return sm_ll_lookup(&smd->ll, b, result);
92 struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
94 r = sm_ll_insert(&smd->ll, b, count, &ev);
105 smd->nr_allocated_this_transaction++;
113 r = sm_ll_lookup(&smd->old_ll, b, &old_count);
118 smd->nr_allocated_this_transaction--;
130 struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
132 r = sm_ll_inc(&smd->ll, b, &ev);
138 smd->nr_allocated_this_transaction++;
148 struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
150 r = sm_ll_dec(&smd->ll, b, &ev);
156 r = sm_ll_lookup(&smd->old_ll, b, &old_count);
158 smd->nr_allocated_this_transaction--;
168 struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
173 r = sm_ll_find_common_free_block(&smd->old_ll, &smd->ll, smd->begin, smd->ll.nr_blocks, b);
176 * There's no free block between smd->begin and the end of the metadata device.
177 * We search before smd->begin in case something has been freed.
179 r = sm_ll_find_common_free_block(&smd->old_ll, &smd->ll, 0, smd->begin, b);
185 smd->begin = *b + 1;
186 r = sm_ll_inc(&smd->ll, *b, &ev);
189 smd->nr_allocated_this_transaction++;
199 struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
205 r = sm_ll_commit(&smd->ll);
209 memcpy(&smd->old_ll, &smd->ll, sizeof(smd->old_ll));
210 smd->nr_allocated_this_transaction = 0;
228 struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
231 root_le.nr_blocks = cpu_to_le64(smd->ll.nr_blocks);
232 root_le.nr_allocated = cpu_to_le64(smd->ll.nr_allocated);
233 root_le.bitmap_root = cpu_to_le64(smd->ll.bitmap_root);
234 root_le.ref_count_root = cpu_to_le64(smd->ll.ref_count_root);
267 struct sm_disk *smd;
269 smd = kmalloc(sizeof(*smd), GFP_KERNEL);
270 if (!smd)
273 smd->begin = 0;
274 smd->nr_allocated_this_transaction = 0;
275 memcpy(&smd->sm, &ops, sizeof(smd->sm));
277 r = sm_ll_new_disk(&smd->ll, tm);
281 r = sm_ll_extend(&smd->ll, nr_blocks);
285 r = sm_disk_commit(&smd->sm);
289 return &smd->sm;
292 kfree(smd);
301 struct sm_disk *smd;
303 smd = kmalloc(sizeof(*smd), GFP_KERNEL);
304 if (!smd)
307 smd->begin = 0;
308 smd->nr_allocated_this_transaction = 0;
309 memcpy(&smd->sm, &ops, sizeof(smd->sm));
311 r = sm_ll_open_disk(&smd->ll, tm, root_le, len);
315 r = sm_disk_commit(&smd->sm);
319 return &smd->sm;
322 kfree(smd);