提交 14086280 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

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: NChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211122130625.1136848-8-hch@lst.deSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 46e7eac6
...@@ -750,14 +750,6 @@ struct block_device *blkdev_get_no_open(dev_t dev) ...@@ -750,14 +750,6 @@ struct block_device *blkdev_get_no_open(dev_t dev)
if (!kobject_get_unless_zero(&bdev->bd_device.kobj)) if (!kobject_get_unless_zero(&bdev->bd_device.kobj))
bdev = NULL; bdev = NULL;
iput(inode); iput(inode);
if (!bdev)
return NULL;
if ((bdev->bd_disk->flags & GENHD_FL_HIDDEN)) {
put_device(&bdev->bd_device);
return NULL;
}
return bdev; return bdev;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册