block: cleanup partition scanning in register_disk
mainline inclusion from mainline-v5.10-rc1 commit 9301fe73 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6MRB5 CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9301fe734384990ef9a2463cb7aeb3b00bf5dad5 -------------------------------- Use blkdev_get_by_dev instead of open coding it using bdget_disk + blkdev_get, and split the code to read the partition table into a separate helper to make it a little more obvious. Signed-off-by:Christoph Hellwig <hch@lst.de> Signed-off-by:
Jens Axboe <axboe@kernel.dk> Conflict: - this patch just factor out a helper, bdget_disk + blkdev_get is still used because 'bdev->bd_invalidated' need to be set. Signed-off-by:
Yu Kuai <yukuai3@huawei.com> Reviewed-by:
Hou Tao <houtao1@huawei.com> Signed-off-by:
Yongqiang Liu <liuyongqiang13@huawei.com>
Loading
Please sign in to comment