diff mbox series

[5/8] dm: cleanup cleanup_mapped_device

Message ID 20210725055458.29008-6-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/8] block: make the block holder code optional | expand

Commit Message

Christoph Hellwig July 25, 2021, 5:54 a.m. UTC
md->queue is not always set when md->disk is set, so simplify the
conditionas a bit.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/md/dm.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Mike Snitzer July 29, 2021, 4:33 p.m. UTC | #1
On Sun, Jul 25 2021 at  1:54P -0400,
Christoph Hellwig <hch@lst.de> wrote:

> md->queue is not always set when md->disk is set, so simplify the
> conditionas a bit.

s/not/now/
s/conditionas/conditionals/

>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Mike Snitzer <snitzer@redhat.com>

> ---
>  drivers/md/dm.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
> index 2c5f9e585211..7971ec8ce677 100644
> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -1694,13 +1694,9 @@ static void cleanup_mapped_device(struct mapped_device *md)
>  		md->disk->private_data = NULL;
>  		spin_unlock(&_minor_lock);
>  		del_gendisk(md->disk);
> -	}
> -
> -	if (md->queue)
>  		dm_queue_destroy_keyslot_manager(md->queue);
> -
> -	if (md->disk)
>  		blk_cleanup_disk(md->disk);
> +	}
>  
>  	cleanup_srcu_struct(&md->io_barrier);
>  
> -- 
> 2.30.2
>
diff mbox series

Patch

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 2c5f9e585211..7971ec8ce677 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1694,13 +1694,9 @@  static void cleanup_mapped_device(struct mapped_device *md)
 		md->disk->private_data = NULL;
 		spin_unlock(&_minor_lock);
 		del_gendisk(md->disk);
-	}
-
-	if (md->queue)
 		dm_queue_destroy_keyslot_manager(md->queue);
-
-	if (md->disk)
 		blk_cleanup_disk(md->disk);
+	}
 
 	cleanup_srcu_struct(&md->io_barrier);