Lines Matching refs:store

8 #include "dm-exception-store.h"
29 * We need to store a record of which parts of the origin have
32 * of the COW store. It makes sense therefore, to store the
99 * The top level structure for a persistent exception store.
102 struct dm_exception_store *store;
138 * the exception store because chunks can be committed out of
171 len = ps->store->chunk_size << SECTOR_SHIFT;
237 .bdev = dm_snap_cow(ps->store->snap)->bdev,
238 .sector = ps->store->chunk_size * chunk,
239 .count = ps->store->chunk_size,
304 memset(ps->area, 0, ps->store->chunk_size << SECTOR_SHIFT);
324 if (!ps->store->chunk_size) {
325 ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS,
326 bdev_logical_block_size(dm_snap_cow(ps->store->snap)->
328 ps->store->chunk_mask = ps->store->chunk_size - 1;
329 ps->store->chunk_shift = ffs(ps->store->chunk_size) - 1;
363 if (ps->store->chunk_size == chunk_size)
369 chunk_size, ps->store->chunk_size);
374 r = dm_exception_store_set_chunk_size(ps->store, chunk_size,
394 memset(ps->header_area, 0, ps->store->chunk_size << SECTOR_SHIFT);
400 dh->chunk_size = cpu_to_le32(ps->store->chunk_size);
504 client = dm_bufio_client_create(dm_snap_cow(ps->store->snap)->bdev,
505 ps->store->chunk_size << SECTOR_SHIFT,
550 memcpy(ps->area, area, ps->store->chunk_size << SECTOR_SHIFT);
572 static struct pstore *get_info(struct dm_exception_store *store)
574 return (struct pstore *) store->context;
577 static void persistent_usage(struct dm_exception_store *store,
582 struct pstore *ps = get_info(store);
584 *sectors_allocated = ps->next_free * store->chunk_size;
585 *total_sectors = get_dev_size(dm_snap_cow(store->snap)->bdev);
593 store->chunk_size;
596 static void persistent_dtr(struct dm_exception_store *store)
598 struct pstore *ps = get_info(store);
614 static int persistent_read_metadata(struct dm_exception_store *store,
620 struct pstore *ps = get_info(store);
632 ps->exceptions_per_area = (ps->store->chunk_size << SECTOR_SHIFT) /
679 static int persistent_prepare_exception(struct dm_exception_store *store,
682 struct pstore *ps = get_info(store);
683 sector_t size = get_dev_size(dm_snap_cow(store->snap)->bdev);
686 if (size < ((ps->next_free + 1) * store->chunk_size))
702 static void persistent_commit_exception(struct dm_exception_store *store,
708 struct pstore *ps = get_info(store);
764 static int persistent_prepare_merge(struct dm_exception_store *store,
768 struct pstore *ps = get_info(store);
810 static int persistent_commit_merge(struct dm_exception_store *store,
814 struct pstore *ps = get_info(store);
843 static void persistent_drop_snapshot(struct dm_exception_store *store)
845 struct pstore *ps = get_info(store);
852 static int persistent_ctr(struct dm_exception_store *store,
862 ps->store = store;
882 store->context = ps;
887 static unsigned persistent_status(struct dm_exception_store *store,
897 DMEMIT(" P %llu", (unsigned long long)store->chunk_size);
939 DMERR("Unable to register persistent exception store type");
946 "store type");