summaryrefslogtreecommitdiffstats
path: root/block/holder.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-08-04 11:41:41 +0200
committerJens Axboe <axboe@kernel.dk>2021-08-09 19:50:42 +0200
commitfbd9a39542ecdd2ade55869c13856b2590db3df8 (patch)
tree4b610e32b082696dfbabaa1a9c3c15a3773a1ea3 /block/holder.c
parentblock: make the block holder code optional (diff)
downloadlinux-fbd9a39542ecdd2ade55869c13856b2590db3df8.tar.xz
linux-fbd9a39542ecdd2ade55869c13856b2590db3df8.zip
block: remove the extra kobject reference in bd_link_disk_holder
Since commit 0d02129e76ed ("block: merge struct block_device and struct hd_struct") there is no way for the bdev to go away as long as there is a holder, so remove the extra references. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20210804094147.459763-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/holder.c')
-rw-r--r--block/holder.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/block/holder.c b/block/holder.c
index 904a1dcd5c12..960654a71342 100644
--- a/block/holder.c
+++ b/block/holder.c
@@ -92,11 +92,6 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk)
ret = add_symlink(bdev->bd_holder_dir, &disk_to_dev(disk)->kobj);
if (ret)
goto out_del;
- /*
- * bdev could be deleted beneath us which would implicitly destroy
- * the holder directory. Hold on to it.
- */
- kobject_get(bdev->bd_holder_dir);
list_add(&holder->list, &bdev->bd_holder_disks);
goto out_unlock;
@@ -130,7 +125,6 @@ void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk)
if (!WARN_ON_ONCE(holder == NULL) && !--holder->refcnt) {
del_symlink(disk->slave_dir, bdev_kobj(bdev));
del_symlink(bdev->bd_holder_dir, &disk_to_dev(disk)->kobj);
- kobject_put(bdev->bd_holder_dir);
list_del_init(&holder->list);
kfree(holder);
}