Lines Matching refs: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;
139 * the exception store because chunks can be committed out of
172 len = ps->store->chunk_size << SECTOR_SHIFT;
233 .bdev = dm_snap_cow(ps->store->snap)->bdev,
234 .sector = ps->store->chunk_size * chunk,
235 .count = ps->store->chunk_size,
294 memset(ps->area, 0, ps->store->chunk_size << SECTOR_SHIFT);
315 if (!ps->store->chunk_size) {
316 ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS,
317 bdev_logical_block_size(dm_snap_cow(ps->store->snap)->
319 ps->store->chunk_mask = ps->store->chunk_size - 1;
320 ps->store->chunk_shift = __ffs(ps->store->chunk_size);
354 if (ps->store->chunk_size == chunk_size)
360 chunk_size, ps->store->chunk_size);
365 r = dm_exception_store_set_chunk_size(ps->store, chunk_size,
385 memset(ps->header_area, 0, ps->store->chunk_size << SECTOR_SHIFT);
391 dh->chunk_size = cpu_to_le32(ps->store->chunk_size);
495 client = dm_bufio_client_create(dm_snap_cow(ps->store->snap)->bdev,
496 ps->store->chunk_size << SECTOR_SHIFT,
541 memcpy(ps->area, area, ps->store->chunk_size << SECTOR_SHIFT);
563 static struct pstore *get_info(struct dm_exception_store *store)
565 return (struct pstore *) store->context;
568 static void persistent_usage(struct dm_exception_store *store,
573 struct pstore *ps = get_info(store);
575 *sectors_allocated = ps->next_free * store->chunk_size;
576 *total_sectors = get_dev_size(dm_snap_cow(store->snap)->bdev);
584 store->chunk_size;
587 static void persistent_dtr(struct dm_exception_store *store)
589 struct pstore *ps = get_info(store);
604 static int persistent_read_metadata(struct dm_exception_store *store,
610 struct pstore *ps = get_info(store);
622 ps->exceptions_per_area = (ps->store->chunk_size << SECTOR_SHIFT) /
669 static int persistent_prepare_exception(struct dm_exception_store *store,
672 struct pstore *ps = get_info(store);
673 sector_t size = get_dev_size(dm_snap_cow(store->snap)->bdev);
676 if (size < ((ps->next_free + 1) * store->chunk_size))
692 static void persistent_commit_exception(struct dm_exception_store *store,
698 struct pstore *ps = get_info(store);
758 static int persistent_prepare_merge(struct dm_exception_store *store,
762 struct pstore *ps = get_info(store);
804 static int persistent_commit_merge(struct dm_exception_store *store,
808 struct pstore *ps = get_info(store);
837 static void persistent_drop_snapshot(struct dm_exception_store *store)
839 struct pstore *ps = get_info(store);
846 static int persistent_ctr(struct dm_exception_store *store, char *options)
856 ps->store = store;
879 store->userspace_supports_overflow = true;
881 DMERR("Unsupported persistent store option: %s", options);
887 store->context = ps;
899 static unsigned persistent_status(struct dm_exception_store *store,
909 DMEMIT(" %s %llu", store->userspace_supports_overflow ? "PO" : "P",
910 (unsigned long long)store->chunk_size);
952 DMERR("Unable to register persistent exception store type");
959 "store type");