summaryrefslogtreecommitdiff
path: root/drivers/md/dm-cache-policy.h
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2013-03-20 17:21:27 +0000
committerAlasdair G Kergon <agk@redhat.com>2013-03-20 17:21:27 +0000
commit4e7f506f6429636115e2f58f9f97089acc62524a (patch)
tree8758ebd6ee210ec303b661df775f31b3e9f45dd9 /drivers/md/dm-cache-policy.h
parente2e74d617eadc15f601983270c4f4a6935c5a943 (diff)
dm cache: policy change version from string to integer set
Separate dm cache policy version string into 3 unsigned numbers corresponding to major, minor and patchlevel and store them at the end of the on-disk metadata so we know which version of the policy generated the hints in case a future version wants to use them differently. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-cache-policy.h')
-rw-r--r--drivers/md/dm-cache-policy.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/dm-cache-policy.h b/drivers/md/dm-cache-policy.h
index f0f51b260544..558bdfdabf5f 100644
--- a/drivers/md/dm-cache-policy.h
+++ b/drivers/md/dm-cache-policy.h
@@ -196,6 +196,7 @@ struct dm_cache_policy {
* We maintain a little register of the different policy types.
*/
#define CACHE_POLICY_NAME_SIZE 16
+#define CACHE_POLICY_VERSION_SIZE 3
struct dm_cache_policy_type {
/* For use by the register code only. */
@@ -206,6 +207,7 @@ struct dm_cache_policy_type {
* what gets passed on the target line to select your policy.
*/
char name[CACHE_POLICY_NAME_SIZE];
+ unsigned version[CACHE_POLICY_VERSION_SIZE];
/*
* Policies may store a hint for each each cache block.