12 #include <linux/list.h>
13 #include <linux/slab.h>
14 #include <linux/export.h>
17 #define DM_MSG_PREFIX "space map disk"
51 *count = smd->
old_ll.nr_blocks;
77 r = sm_disk_get_count(sm, b, &count);
192 r = sm_disk_get_nr_free(sm, &nr_free);
204 r = sm_disk_get_nr_free(sm, &nr_free);
211 static int sm_disk_root_size(
struct dm_space_map *sm,
size_t *result)
218 static int sm_disk_copy_root(
struct dm_space_map *sm,
void *where_le,
size_t max)
226 root_le.ref_count_root =
cpu_to_le64(smd->
ll.ref_count_root);
228 if (max <
sizeof(root_le))
231 memcpy(where_le, &root_le,
sizeof(root_le));
239 .destroy = sm_disk_destroy,
240 .extend = sm_disk_extend,
241 .get_nr_blocks = sm_disk_get_nr_blocks,
242 .get_nr_free = sm_disk_get_nr_free,
243 .get_count = sm_disk_get_count,
244 .count_is_more_than_one = sm_disk_count_is_more_than_one,
245 .set_count = sm_disk_set_count,
246 .inc_block = sm_disk_inc_block,
247 .dec_block = sm_disk_dec_block,
248 .new_block = sm_disk_new_block,
249 .commit = sm_disk_commit,
250 .root_size = sm_disk_root_size,
251 .copy_root = sm_disk_copy_root
276 r = sm_disk_commit(&smd->
sm);
289 void *root_le,
size_t len)
306 r = sm_disk_commit(&smd->
sm);