]> www.infradead.org Git - users/hch/block.git/commit
virtio_blk: simplify refcounting free_disk
authorChristoph Hellwig <hch@lst.de>
Fri, 28 Jan 2022 13:14:44 +0000 (14:14 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 15 Feb 2022 08:08:32 +0000 (09:08 +0100)
commitded0dcc904409a770234d6802ea468505ae0dfd7
tree99d7fe891a8cc3a79e2409d81ed46cedb8d8c1bd
parent84d894ffdcb0176703248668dbb36e4f2bc5bf24
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>
drivers/block/virtio_blk.c