From: Christoph Hellwig Date: Mon, 29 Nov 2021 13:38:04 +0000 (-0700) Subject: block: remove the GENHD_FL_HIDDEN check in blkdev_get_no_open X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=140862805affca32b3c92a9a7643a7ee6d6ab278;p=uclinux-h8%2Flinux.git block: remove the GENHD_FL_HIDDEN check in blkdev_get_no_open Hidden gendisks never hash the block device inode, so this can't happen. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-8-hch@lst.de Signed-off-by: Jens Axboe --- diff --git a/block/bdev.c b/block/bdev.c index dd84961bed7e..e9ada04e71be 100644 --- a/block/bdev.c +++ b/block/bdev.c @@ -750,14 +750,6 @@ struct block_device *blkdev_get_no_open(dev_t dev) if (!kobject_get_unless_zero(&bdev->bd_device.kobj)) bdev = NULL; iput(inode); - - if (!bdev) - return NULL; - if ((bdev->bd_disk->flags & GENHD_FL_HIDDEN)) { - put_device(&bdev->bd_device); - return NULL; - } - return bdev; }