From 2e68c4e6caad9fdadc1cef8b6cb9569192e8a42b Mon Sep 17 00:00:00 2001 From: Mike Snitzer Date: Wed, 15 Jan 2014 21:06:55 -0500 Subject: 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 Signed-off-by: Mike Snitzer --- drivers/md/dm-cache-policy-mq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/md/dm-cache-policy-mq.c') diff --git a/drivers/md/dm-cache-policy-mq.c b/drivers/md/dm-cache-policy-mq.c index e63e36cefc89..930e8c3d73e9 100644 --- a/drivers/md/dm-cache-policy-mq.c +++ b/drivers/md/dm-cache-policy-mq.c @@ -1276,7 +1276,8 @@ static struct dm_cache_policy_type default_policy_type = { .version = {1, 2, 0}, .hint_size = 4, .owner = THIS_MODULE, - .create = mq_create + .create = mq_create, + .real = &mq_policy_type }; static int __init mq_init(void) -- cgit v1.2.1