Lines Matching full:store

8 #include "dm-exception-store.h"
30 * We need to store a record of which parts of the origin have
33 * of the COW store. It makes sense therefore, to store the
100 * The top level structure for a persistent exception store.
103 struct dm_exception_store *store; member
139 * the exception store because chunks can be committed out of
172 len = ps->store->chunk_size << SECTOR_SHIFT; in alloc_area()
233 .bdev = dm_snap_cow(ps->store->snap)->bdev, in chunk_io()
234 .sector = ps->store->chunk_size * chunk, in chunk_io()
235 .count = ps->store->chunk_size, in chunk_io()
293 memset(ps->area, 0, ps->store->chunk_size << SECTOR_SHIFT); in zero_memory_area()
314 if (!ps->store->chunk_size) { in read_header()
315 ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS, in read_header()
316 bdev_logical_block_size(dm_snap_cow(ps->store->snap)-> in read_header()
318 ps->store->chunk_mask = ps->store->chunk_size - 1; in read_header()
319 ps->store->chunk_shift = __ffs(ps->store->chunk_size); in read_header()
353 if (ps->store->chunk_size == chunk_size) in read_header()
359 chunk_size, ps->store->chunk_size); in read_header()
364 r = dm_exception_store_set_chunk_size(ps->store, chunk_size, in read_header()
384 memset(ps->header_area, 0, ps->store->chunk_size << SECTOR_SHIFT); in write_header()
390 dh->chunk_size = cpu_to_le32(ps->store->chunk_size); in write_header()
494 client = dm_bufio_client_create(dm_snap_cow(ps->store->snap)->bdev, in read_exceptions()
495 ps->store->chunk_size << SECTOR_SHIFT, in read_exceptions()
540 memcpy(ps->area, area, ps->store->chunk_size << SECTOR_SHIFT); in read_exceptions()
562 static struct pstore *get_info(struct dm_exception_store *store) in get_info() argument
564 return (struct pstore *) store->context; in get_info()
567 static void persistent_usage(struct dm_exception_store *store, in persistent_usage() argument
572 struct pstore *ps = get_info(store); in persistent_usage()
574 *sectors_allocated = ps->next_free * store->chunk_size; in persistent_usage()
575 *total_sectors = get_dev_size(dm_snap_cow(store->snap)->bdev); in persistent_usage()
583 store->chunk_size; in persistent_usage()
586 static void persistent_dtr(struct dm_exception_store *store) in persistent_dtr() argument
588 struct pstore *ps = get_info(store); in persistent_dtr()
603 static int persistent_read_metadata(struct dm_exception_store *store, in persistent_read_metadata() argument
609 struct pstore *ps = get_info(store); in persistent_read_metadata()
621 ps->exceptions_per_area = (ps->store->chunk_size << SECTOR_SHIFT) / in persistent_read_metadata()
668 static int persistent_prepare_exception(struct dm_exception_store *store, in persistent_prepare_exception() argument
671 struct pstore *ps = get_info(store); in persistent_prepare_exception()
672 sector_t size = get_dev_size(dm_snap_cow(store->snap)->bdev); in persistent_prepare_exception()
675 if (size < ((ps->next_free + 1) * store->chunk_size)) in persistent_prepare_exception()
691 static void persistent_commit_exception(struct dm_exception_store *store, in persistent_commit_exception() argument
697 struct pstore *ps = get_info(store); in persistent_commit_exception()
757 static int persistent_prepare_merge(struct dm_exception_store *store, in persistent_prepare_merge() argument
761 struct pstore *ps = get_info(store); in persistent_prepare_merge()
803 static int persistent_commit_merge(struct dm_exception_store *store, in persistent_commit_merge() argument
807 struct pstore *ps = get_info(store); in persistent_commit_merge()
836 static void persistent_drop_snapshot(struct dm_exception_store *store) in persistent_drop_snapshot() argument
838 struct pstore *ps = get_info(store); in persistent_drop_snapshot()
845 static int persistent_ctr(struct dm_exception_store *store, char *options) in persistent_ctr() argument
855 ps->store = store; in persistent_ctr()
878 store->userspace_supports_overflow = true; in persistent_ctr()
880 DMERR("Unsupported persistent store option: %s", options); in persistent_ctr()
886 store->context = ps; in persistent_ctr()
898 static unsigned persistent_status(struct dm_exception_store *store, in persistent_status() argument
908 DMEMIT(" %s %llu", store->userspace_supports_overflow ? "PO" : "P", in persistent_status()
909 (unsigned long long)store->chunk_size); in persistent_status()
955 DMERR("Unable to register persistent exception store type"); in dm_persistent_snapshot_init()
962 "store type"); in dm_persistent_snapshot_init()