summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-cache-policy.h
diff options
context:
space:
mode:
authorMike Snitzer2014-01-16 03:06:55 +0100
committerMike Snitzer2014-01-16 19:44:11 +0100
commit2e68c4e6caad9fdadc1cef8b6cb9569192e8a42b (patch)
treefdc0a4f6b3eaba7979b613b9423ec4ef23a64ca5 /drivers/md/dm-cache-policy.h
parentdm thin: fix pool feature parsing (diff)
downloadkernel-qcow2-linux-2e68c4e6caad9fdadc1cef8b6cb9569192e8a42b.tar.gz
kernel-qcow2-linux-2e68c4e6caad9fdadc1cef8b6cb9569192e8a42b.tar.xz
kernel-qcow2-linux-2e68c4e6caad9fdadc1cef8b6cb9569192e8a42b.zip
dm cache: add policy name to status output
The cache's policy may have been established using the "default" alias, which is currently the "mq" policy but the default policy may change in the future. It is useful to know exactly which policy is being used. Add a 'real' member to the dm_cache_policy_type structure and have the "default" dm_cache_policy_type point to the real "mq" dm_cache_policy_type. Update dm_cache_policy_get_name() to check if real is set, if so report the name of the real policy (not the alias). Requested-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-cache-policy.h')
-rw-r--r--drivers/md/dm-cache-policy.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/dm-cache-policy.h b/drivers/md/dm-cache-policy.h
index 052c00a84a5c..f50fe360c546 100644
--- a/drivers/md/dm-cache-policy.h
+++ b/drivers/md/dm-cache-policy.h
@@ -223,6 +223,12 @@ struct dm_cache_policy_type {
unsigned version[CACHE_POLICY_VERSION_SIZE];
/*
+ * For use by an alias dm_cache_policy_type to point to the
+ * real dm_cache_policy_type.
+ */
+ struct dm_cache_policy_type *real;
+
+ /*
* Policies may store a hint for each each cache block.
* Currently the size of this hint must be 0 or 4 bytes but we
* expect to relax this in future.