aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-cache-metadata.h
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2014-07-14 15:37:18 -0400
committerMike Snitzer <snitzer@redhat.com>2014-08-01 12:30:33 -0400
commit895b47d7989af3aacea16380b190b1bb8f046362 (patch)
treeff1fa6f0a86063b69d09a76acc6d996face2acdc /drivers/md/dm-cache-metadata.h
parentdm cache: fail migrations in the do_worker error path (diff)
downloadlinux-dev-895b47d7989af3aacea16380b190b1bb8f046362.tar.xz
linux-dev-895b47d7989af3aacea16380b190b1bb8f046362.zip
dm cache metadata: use dm-space-map-metadata.h defined size limits
Commit 7d48935e cleaned up the persistent-data's space-map-metadata limits by elevating them to dm-space-map-metadata.h. Update dm-cache-metadata to use these same limits. The calculation for DM_CACHE_METADATA_MAX_SECTORS didn't account for the sizeof the disk_bitmap_header. So the supported maximum metadata size is a bit smaller (reduced from 33423360 to 33292800 sectors). Signed-off-by: Mike Snitzer <snitzer@redhat.com> Acked-by: Joe Thornber <ejt@redhat.com>
Diffstat (limited to 'drivers/md/dm-cache-metadata.h')
-rw-r--r--drivers/md/dm-cache-metadata.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/md/dm-cache-metadata.h b/drivers/md/dm-cache-metadata.h
index cd70a78623a3..7383c90ccdb8 100644
--- a/drivers/md/dm-cache-metadata.h
+++ b/drivers/md/dm-cache-metadata.h
@@ -9,19 +9,17 @@
#include "dm-cache-block-types.h"
#include "dm-cache-policy-internal.h"
+#include "persistent-data/dm-space-map-metadata.h"
/*----------------------------------------------------------------*/
-#define DM_CACHE_METADATA_BLOCK_SIZE 4096
+#define DM_CACHE_METADATA_BLOCK_SIZE DM_SM_METADATA_BLOCK_SIZE
/* FIXME: remove this restriction */
/*
* The metadata device is currently limited in size.
- *
- * We have one block of index, which can hold 255 index entries. Each
- * index entry contains allocation info about 16k metadata blocks.
*/
-#define DM_CACHE_METADATA_MAX_SECTORS (255 * (1 << 14) * (DM_CACHE_METADATA_BLOCK_SIZE / (1 << SECTOR_SHIFT)))
+#define DM_CACHE_METADATA_MAX_SECTORS DM_SM_METADATA_MAX_SECTORS
/*
* A metadata device larger than 16GB triggers a warning.