summaryrefslogtreecommitdiff
path: root/drivers/md/dm-cache-policy-cleaner.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2013-03-20 21:21:27 +0400
committerAlasdair G Kergon <agk@redhat.com>2013-03-20 21:21:27 +0400
commit4e7f506f6429636115e2f58f9f97089acc62524a (patch)
tree8758ebd6ee210ec303b661df775f31b3e9f45dd9 /drivers/md/dm-cache-policy-cleaner.c
parente2e74d617eadc15f601983270c4f4a6935c5a943 (diff)
downloadlinux-4e7f506f6429636115e2f58f9f97089acc62524a.tar.xz
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-cleaner.c')
-rw-r--r--drivers/md/dm-cache-policy-cleaner.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/dm-cache-policy-cleaner.c b/drivers/md/dm-cache-policy-cleaner.c
index cc05d70b3cb8..b04d1f904d07 100644
--- a/drivers/md/dm-cache-policy-cleaner.c
+++ b/drivers/md/dm-cache-policy-cleaner.c
@@ -17,7 +17,6 @@
/*----------------------------------------------------------------*/
#define DM_MSG_PREFIX "cache cleaner"
-#define CLEANER_VERSION "1.0.0"
/* Cache entry struct. */
struct wb_cache_entry {
@@ -434,6 +433,7 @@ static struct dm_cache_policy *wb_create(dm_cblock_t cache_size,
static struct dm_cache_policy_type wb_policy_type = {
.name = "cleaner",
+ .version = {1, 0, 0},
.hint_size = 0,
.owner = THIS_MODULE,
.create = wb_create
@@ -446,7 +446,10 @@ static int __init wb_init(void)
if (r < 0)
DMERR("register failed %d", r);
else
- DMINFO("version " CLEANER_VERSION " loaded");
+ DMINFO("version %u.%u.%u loaded",
+ wb_policy_type.version[0],
+ wb_policy_type.version[1],
+ wb_policy_type.version[2]);
return r;
}