Lines Matching refs:store
9 #include "dm-exception-store.h"
33 * We need to store a record of which parts of the origin have
36 * of the COW store. It makes sense therefore, to store the
103 * The top level structure for a persistent exception store.
106 struct dm_exception_store *store;
142 * the exception store because chunks can be committed out of
175 len = ps->store->chunk_size << SECTOR_SHIFT;
236 .bdev = dm_snap_cow(ps->store->snap)->bdev,
237 .sector = ps->store->chunk_size * chunk,
238 .count = ps->store->chunk_size,
297 memset(ps->area, 0, ps->store->chunk_size << SECTOR_SHIFT);
318 if (!ps->store->chunk_size) {
319 ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS,
320 bdev_logical_block_size(dm_snap_cow(ps->store->snap)->
322 ps->store->chunk_mask = ps->store->chunk_size - 1;
323 ps->store->chunk_shift = __ffs(ps->store->chunk_size);
357 if (ps->store->chunk_size == chunk_size)
362 chunk_size, ps->store->chunk_size);
367 r = dm_exception_store_set_chunk_size(ps->store, chunk_size,
387 memset(ps->header_area, 0, ps->store->chunk_size << SECTOR_SHIFT);
393 dh->chunk_size = cpu_to_le32(ps->store->chunk_size);
497 client = dm_bufio_client_create(dm_snap_cow(ps->store->snap)->bdev,
498 ps->store->chunk_size << SECTOR_SHIFT,
546 memcpy(ps->area, area, ps->store->chunk_size << SECTOR_SHIFT);
568 static struct pstore *get_info(struct dm_exception_store *store)
570 return store->context;
573 static void persistent_usage(struct dm_exception_store *store,
578 struct pstore *ps = get_info(store);
580 *sectors_allocated = ps->next_free * store->chunk_size;
581 *total_sectors = get_dev_size(dm_snap_cow(store->snap)->bdev);
589 store->chunk_size;
592 static void persistent_dtr(struct dm_exception_store *store)
594 struct pstore *ps = get_info(store);
609 static int persistent_read_metadata(struct dm_exception_store *store,
615 struct pstore *ps = get_info(store);
627 ps->exceptions_per_area = (ps->store->chunk_size << SECTOR_SHIFT) /
674 static int persistent_prepare_exception(struct dm_exception_store *store,
677 struct pstore *ps = get_info(store);
678 sector_t size = get_dev_size(dm_snap_cow(store->snap)->bdev);
681 if (size < ((ps->next_free + 1) * store->chunk_size))
697 static void persistent_commit_exception(struct dm_exception_store *store,
703 struct pstore *ps = get_info(store);
763 static int persistent_prepare_merge(struct dm_exception_store *store,
767 struct pstore *ps = get_info(store);
809 static int persistent_commit_merge(struct dm_exception_store *store,
813 struct pstore *ps = get_info(store);
842 static void persistent_drop_snapshot(struct dm_exception_store *store)
844 struct pstore *ps = get_info(store);
851 static int persistent_ctr(struct dm_exception_store *store, char *options)
861 ps->store = store;
885 store->userspace_supports_overflow = true;
887 DMERR("Unsupported persistent store option: %s", options);
893 store->context = ps;
905 static unsigned int persistent_status(struct dm_exception_store *store,
915 DMEMIT(" %s %llu", store->userspace_supports_overflow ? "PO" : "P",
916 (unsigned long long)store->chunk_size);
962 DMERR("Unable to register persistent exception store type");
968 DMERR("Unable to register old-style persistent exception store type");