summaryrefslogtreecommitdiffstats
path: root/drivers/md/persistent-data/dm-space-map-metadata.h
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-03-19 14:02:34 +0100
committerMark Brown <broonie@linaro.org>2014-03-19 14:02:34 +0100
commit236b11de51c7501c454ca125d84152b06ef7f27e (patch)
treed0ca0b99961da2a8a46b4f86a57de8424dadce1d /drivers/md/persistent-data/dm-space-map-metadata.h
parentregulator: s2mps11: Fix section mismatch (diff)
parentDocumentation: mfd: Add binding document for S2MPA01 (diff)
downloadlinux-236b11de51c7501c454ca125d84152b06ef7f27e.tar.xz
linux-236b11de51c7501c454ca125d84152b06ef7f27e.zip
Merge branch 'ib-mfd-regulator-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into regulator-s2mps11
Diffstat (limited to 'drivers/md/persistent-data/dm-space-map-metadata.h')
-rw-r--r--drivers/md/persistent-data/dm-space-map-metadata.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/md/persistent-data/dm-space-map-metadata.h b/drivers/md/persistent-data/dm-space-map-metadata.h
index 39bba0801cf2..64df923974d8 100644
--- a/drivers/md/persistent-data/dm-space-map-metadata.h
+++ b/drivers/md/persistent-data/dm-space-map-metadata.h
@@ -9,6 +9,17 @@
#include "dm-transaction-manager.h"
+#define DM_SM_METADATA_BLOCK_SIZE (4096 >> SECTOR_SHIFT)
+
+/*
+ * 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_SM_METADATA_MAX_BLOCKS (255 * ((1 << 14) - 64))
+#define DM_SM_METADATA_MAX_SECTORS (DM_SM_METADATA_MAX_BLOCKS * DM_SM_METADATA_BLOCK_SIZE)
+
/*
* Unfortunately we have to use two-phase construction due to the cycle
* between the tm and sm.