diff options
author | Joe Thornber <ejt@redhat.com> | 2016-09-22 12:15:21 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2017-02-16 19:12:47 +0100 |
commit | 629d0a8a1a104187db8fbf966e4cc5cfb6aa9a3c (patch) | |
tree | df900a59355073aca34dd8de83d4ca631428cd6e /drivers/md/dm-cache-metadata.h | |
parent | dm cache metadata: use bitset cursor api to load discard bitset (diff) | |
download | linux-629d0a8a1a104187db8fbf966e4cc5cfb6aa9a3c.tar.xz linux-629d0a8a1a104187db8fbf966e4cc5cfb6aa9a3c.zip |
dm cache metadata: add "metadata2" feature
If "metadata2" is provided as a table argument when creating/loading a
cache target a more compact metadata format, with separate dirty bits,
is used. "metadata2" improves speed of shutting down a cache target.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-cache-metadata.h')
-rw-r--r-- | drivers/md/dm-cache-metadata.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/md/dm-cache-metadata.h b/drivers/md/dm-cache-metadata.h index 8528744195e5..4f07c08cf107 100644 --- a/drivers/md/dm-cache-metadata.h +++ b/drivers/md/dm-cache-metadata.h @@ -45,18 +45,20 @@ * As these various flags are defined they should be added to the * following masks. */ + #define DM_CACHE_FEATURE_COMPAT_SUPP 0UL #define DM_CACHE_FEATURE_COMPAT_RO_SUPP 0UL #define DM_CACHE_FEATURE_INCOMPAT_SUPP 0UL /* - * Reopens or creates a new, empty metadata volume. - * Returns an ERR_PTR on failure. + * Reopens or creates a new, empty metadata volume. Returns an ERR_PTR on + * failure. If reopening then features must match. */ struct dm_cache_metadata *dm_cache_metadata_open(struct block_device *bdev, sector_t data_block_size, bool may_format_device, - size_t policy_hint_size); + size_t policy_hint_size, + unsigned metadata_version); void dm_cache_metadata_close(struct dm_cache_metadata *cmd); @@ -91,7 +93,8 @@ int dm_cache_load_mappings(struct dm_cache_metadata *cmd, load_mapping_fn fn, void *context); -int dm_cache_set_dirty(struct dm_cache_metadata *cmd, dm_cblock_t cblock, bool dirty); +int dm_cache_set_dirty_bits(struct dm_cache_metadata *cmd, + unsigned nr_bits, unsigned long *bits); struct dm_cache_statistics { uint32_t read_hits; |