summaryrefslogtreecommitdiff
path: root/drivers/md/dm-cache-target.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-cache-target.c')
-rw-r--r--drivers/md/dm-cache-target.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index 89fdfb49d564..780a61bc6cc0 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -803,7 +803,7 @@ static void accounted_complete(struct cache *cache, struct bio *bio)
static void accounted_request(struct cache *cache, struct bio *bio)
{
accounted_begin(cache, bio);
- submit_bio_noacct(bio);
+ dm_submit_bio_remap(bio, NULL);
}
static void issue_op(struct bio *bio, void *context)
@@ -1708,7 +1708,7 @@ static bool process_bio(struct cache *cache, struct bio *bio)
bool commit_needed;
if (map_bio(cache, bio, get_bio_block(cache, bio), &commit_needed) == DM_MAPIO_REMAPPED)
- submit_bio_noacct(bio);
+ dm_submit_bio_remap(bio, NULL);
return commit_needed;
}
@@ -1774,7 +1774,7 @@ static bool process_discard_bio(struct cache *cache, struct bio *bio)
if (cache->features.discard_passdown) {
remap_to_origin(cache, bio);
- submit_bio_noacct(bio);
+ dm_submit_bio_remap(bio, NULL);
} else
bio_endio(bio);
@@ -2015,7 +2015,6 @@ static int parse_metadata_dev(struct cache_args *ca, struct dm_arg_set *as,
{
int r;
sector_t metadata_dev_size;
- char b[BDEVNAME_SIZE];
if (!at_least_one_arg(as, error))
return -EINVAL;
@@ -2029,8 +2028,8 @@ static int parse_metadata_dev(struct cache_args *ca, struct dm_arg_set *as,
metadata_dev_size = get_dev_size(ca->metadata_dev);
if (metadata_dev_size > DM_CACHE_METADATA_MAX_SECTORS_WARNING)
- DMWARN("Metadata device %s is larger than %u sectors: excess space will not be used.",
- bdevname(ca->metadata_dev->bdev, b), THIN_METADATA_MAX_SECTORS);
+ DMWARN("Metadata device %pg is larger than %u sectors: excess space will not be used.",
+ ca->metadata_dev->bdev, THIN_METADATA_MAX_SECTORS);
return 0;
}
@@ -2357,6 +2356,7 @@ static int cache_create(struct cache_args *ca, struct cache **result)
cache->ti = ca->ti;
ti->private = cache;
+ ti->accounts_remapped_io = true;
ti->num_flush_bios = 2;
ti->flush_supported = true;
@@ -3345,7 +3345,6 @@ static void disable_passdown_if_not_supported(struct cache *cache)
struct block_device *origin_bdev = cache->origin_dev->bdev;
struct queue_limits *origin_limits = &bdev_get_queue(origin_bdev)->limits;
const char *reason = NULL;
- char buf[BDEVNAME_SIZE];
if (!cache->features.discard_passdown)
return;
@@ -3357,8 +3356,8 @@ static void disable_passdown_if_not_supported(struct cache *cache)
reason = "max discard sectors smaller than a block";
if (reason) {
- DMWARN("Origin device (%s) %s: Disabling discard passdown.",
- bdevname(origin_bdev, buf), reason);
+ DMWARN("Origin device (%pg) %s: Disabling discard passdown.",
+ origin_bdev, reason);
cache->features.discard_passdown = false;
}
}