]> git.baikalelectronics.ru Git - kernel.git/commit
virtio_blk: simplify refcounting
authorChristoph Hellwig <hch@lst.de>
Tue, 15 Feb 2022 09:45:14 +0000 (10:45 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Feb 2022 02:44:24 +0000 (19:44 -0700)
commit4785fbef89dd3bbd58273582649b99ab920db8ac
tree023885df01a520bdbaccb12c05389f2ad778371f
parenta634963a582eb64a5647e51db5b8bb720cc38147
virtio_blk: simplify refcounting

Implement the ->free_disk method to free the virtio_blk structure only
once the last gendisk reference goes away instead of keeping a local
refcount.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://lore.kernel.org/r/20220215094514.3828912-6-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/virtio_blk.c