]> Pileus Git - ~andy/linux/blobdiff - drivers/md/dm-cache-target.c
Merge branch 'for-3.14/core' of git://git.kernel.dk/linux-block
[~andy/linux] / drivers / md / dm-cache-target.c
index 99f91628a33aa6b6969d2b87b61a861e85d16de6..ffd472e015caa918facaed4f65a621c0f61e58a9 100644 (file)
@@ -2834,12 +2834,13 @@ static void cache_resume(struct dm_target *ti)
 /*
  * Status format:
  *
- * <#used metadata blocks>/<#total metadata blocks>
+ * <metadata block size> <#used metadata blocks>/<#total metadata blocks>
+ * <cache block size> <#used cache blocks>/<#total cache blocks>
  * <#read hits> <#read misses> <#write hits> <#write misses>
- * <#demotions> <#promotions> <#blocks in cache> <#dirty>
+ * <#demotions> <#promotions> <#dirty>
  * <#features> <features>*
  * <#core args> <core args>
- * <#policy args> <policy args>*
+ * <policy name> <#policy args> <policy args>*
  */
 static void cache_status(struct dm_target *ti, status_type_t type,
                         unsigned status_flags, char *result, unsigned maxlen)
@@ -2877,17 +2878,20 @@ static void cache_status(struct dm_target *ti, status_type_t type,
 
                residency = policy_residency(cache->policy);
 
-               DMEMIT("%llu/%llu %u %u %u %u %u %u %llu %u ",
+               DMEMIT("%u %llu/%llu %u %llu/%llu %u %u %u %u %u %u %llu ",
+                      (unsigned)(DM_CACHE_METADATA_BLOCK_SIZE >> SECTOR_SHIFT),
                       (unsigned long long)(nr_blocks_metadata - nr_free_blocks_metadata),
                       (unsigned long long)nr_blocks_metadata,
+                      cache->sectors_per_block,
+                      (unsigned long long) from_cblock(residency),
+                      (unsigned long long) from_cblock(cache->cache_size),
                       (unsigned) atomic_read(&cache->stats.read_hit),
                       (unsigned) atomic_read(&cache->stats.read_miss),
                       (unsigned) atomic_read(&cache->stats.write_hit),
                       (unsigned) atomic_read(&cache->stats.write_miss),
                       (unsigned) atomic_read(&cache->stats.demotion),
                       (unsigned) atomic_read(&cache->stats.promotion),
-                      (unsigned long long) from_cblock(residency),
-                      cache->nr_dirty);
+                      (unsigned long long) from_cblock(cache->nr_dirty));
 
                if (writethrough_mode(&cache->features))
                        DMEMIT("1 writethrough ");
@@ -2904,6 +2908,8 @@ static void cache_status(struct dm_target *ti, status_type_t type,
                }
 
                DMEMIT("2 migration_threshold %llu ", (unsigned long long) cache->migration_threshold);
+
+               DMEMIT("%s ", dm_cache_policy_get_name(cache->policy));
                if (sz < maxlen) {
                        r = policy_emit_config_values(cache->policy, result + sz, maxlen - sz);
                        if (r)
@@ -3137,7 +3143,7 @@ static void cache_io_hints(struct dm_target *ti, struct queue_limits *limits)
 
 static struct target_type cache_target = {
        .name = "cache",
-       .version = {1, 2, 0},
+       .version = {1, 3, 0},
        .module = THIS_MODULE,
        .ctr = cache_ctr,
        .dtr = cache_dtr,