H A D | dm-space-map-disk.c | 36 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); sm_disk_destroy() local 38 kfree(smd); sm_disk_destroy() 43 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); sm_disk_extend() local 45 return sm_ll_extend(&smd->ll, extra_blocks); sm_disk_extend() 50 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); sm_disk_get_nr_blocks() local 51 *count = smd->old_ll.nr_blocks; sm_disk_get_nr_blocks() 58 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); sm_disk_get_nr_free() local 59 *count = (smd->old_ll.nr_blocks - smd->old_ll.nr_allocated) - smd->nr_allocated_this_transaction; sm_disk_get_nr_free() 67 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); sm_disk_get_count() local 68 return sm_ll_lookup(&smd->ll, b, result); sm_disk_get_count() 92 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); sm_disk_set_count() local 94 r = sm_ll_insert(&smd->ll, b, count, &ev); sm_disk_set_count() 105 smd->nr_allocated_this_transaction++; sm_disk_set_count() 113 r = sm_ll_lookup(&smd->old_ll, b, &old_count); sm_disk_set_count() 118 smd->nr_allocated_this_transaction--; sm_disk_set_count() 130 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); sm_disk_inc_block() local 132 r = sm_ll_inc(&smd->ll, b, &ev); sm_disk_inc_block() 138 smd->nr_allocated_this_transaction++; sm_disk_inc_block() 146 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); sm_disk_dec_block() local 148 return sm_ll_dec(&smd->ll, b, &ev); sm_disk_dec_block() 155 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); sm_disk_new_block() local 158 r = sm_ll_find_free_block(&smd->old_ll, smd->begin, smd->old_ll.nr_blocks, b); sm_disk_new_block() 162 smd->begin = *b + 1; sm_disk_new_block() 163 r = sm_ll_inc(&smd->ll, *b, &ev); sm_disk_new_block() 166 smd->nr_allocated_this_transaction++; sm_disk_new_block() 176 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); sm_disk_commit() local 182 r = sm_ll_commit(&smd->ll); sm_disk_commit() 186 memcpy(&smd->old_ll, &smd->ll, sizeof(smd->old_ll)); sm_disk_commit() 187 smd->begin = 0; sm_disk_commit() 188 smd->nr_allocated_this_transaction = 0; sm_disk_commit() 206 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); sm_disk_copy_root() local 209 root_le.nr_blocks = cpu_to_le64(smd->ll.nr_blocks); sm_disk_copy_root() 210 root_le.nr_allocated = cpu_to_le64(smd->ll.nr_allocated); sm_disk_copy_root() 211 root_le.bitmap_root = cpu_to_le64(smd->ll.bitmap_root); sm_disk_copy_root() 212 root_le.ref_count_root = cpu_to_le64(smd->ll.ref_count_root); sm_disk_copy_root() 245 struct sm_disk *smd; dm_sm_disk_create() local 247 smd = kmalloc(sizeof(*smd), GFP_KERNEL); dm_sm_disk_create() 248 if (!smd) dm_sm_disk_create() 251 smd->begin = 0; dm_sm_disk_create() 252 smd->nr_allocated_this_transaction = 0; dm_sm_disk_create() 253 memcpy(&smd->sm, &ops, sizeof(smd->sm)); dm_sm_disk_create() 255 r = sm_ll_new_disk(&smd->ll, tm); dm_sm_disk_create() 259 r = sm_ll_extend(&smd->ll, nr_blocks); dm_sm_disk_create() 263 r = sm_disk_commit(&smd->sm); dm_sm_disk_create() 267 return &smd->sm; dm_sm_disk_create() 270 kfree(smd); dm_sm_disk_create() 279 struct sm_disk *smd; dm_sm_disk_open() local 281 smd = kmalloc(sizeof(*smd), GFP_KERNEL); dm_sm_disk_open() 282 if (!smd) dm_sm_disk_open() 285 smd->begin = 0; dm_sm_disk_open() 286 smd->nr_allocated_this_transaction = 0; dm_sm_disk_open() 287 memcpy(&smd->sm, &ops, sizeof(smd->sm)); dm_sm_disk_open() 289 r = sm_ll_open_disk(&smd->ll, tm, root_le, len); dm_sm_disk_open() 293 r = sm_disk_commit(&smd->sm); dm_sm_disk_open() 297 return &smd->sm; dm_sm_disk_open() 300 kfree(smd); dm_sm_disk_open()
|