OSDN Git Service

block: store the holder kobject in bd_holder_disk
authorYu Kuai <yukuai3@huawei.com>
Tue, 15 Nov 2022 14:10:53 +0000 (22:10 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 16 Nov 2022 22:19:56 +0000 (15:19 -0700)
commit3b3449c1e6c3fe19f62607ff4f353f8bb82d5c4e
tree2582441eb9c850073343c9726fbeb1dde9e6f007
parent62f535e1f061b4c2cc76061b6b59af9f9335ee34
block: store the holder kobject in bd_holder_disk

We hold a reference to the holder kobject for each bd_holder_disk,
so to make the code a bit more robust, use a reference to it instead
of the block_device.  As long as no one clears ->bd_holder_dir in
before freeing the disk, this isn't strictly required, but it does
make the code more clear and more robust.

Orignally-From: Christoph Hellwig <hch@lst.de>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20221115141054.1051801-10-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/holder.c