From 2e803cd99ba8b7a84be155c1d5ee28d363fdbe44 Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Tue, 12 Apr 2022 16:56:14 +0800 Subject: dm: don't grab target io reference in dm_zone_map_bio dm_zone_map_bio() is only called from __map_bio in which the io's reference is grabbed already, and the reference won't be released until the bio is submitted, so not necessary to do it dm_zone_map_bio any more. Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/md/dm.c') diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 7a1a83b58677..7cae8235fbe1 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -955,6 +955,11 @@ static void dm_io_complete(struct dm_io *io) } } +static void dm_io_inc_pending(struct dm_io *io) +{ + atomic_inc(&io->io_count); +} + /* * Decrements the number of outstanding ios that a bio has been * cloned into, completing the original io if necc. @@ -978,7 +983,7 @@ static void dm_io_set_error(struct dm_io *io, blk_status_t error) spin_unlock_irqrestore(&io->lock, flags); } -void dm_io_dec_pending(struct dm_io *io, blk_status_t error) +static void dm_io_dec_pending(struct dm_io *io, blk_status_t error) { if (unlikely(error)) dm_io_set_error(io, error); -- cgit v1.2.3