]> www.infradead.org Git - users/hch/block.git/commit
sd: implement ->free_disk to simplify refcounting
authorChristoph Hellwig <hch@lst.de>
Sat, 26 Feb 2022 08:29:32 +0000 (09:29 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 8 Mar 2022 05:28:18 +0000 (06:28 +0100)
commitb8643baba7ba5e4bff8d2a4e7de6c1ce4a855acf
treec0d6cf426c6cbb42dedf3220879b6682c3f24980
parentfb515b31f7ef6252e8c28db5cf42f1d1879f75df
sd: implement ->free_disk to simplify refcounting

Implement the ->free_disk method to to put struct scsi_disk when the last
gendisk reference count goes away.  This removes the need to clear
->private_data and thus freeze the queue on unbind.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sd.c