block: switch partition lookup to use struct block_device

Use struct block_device to lookup partitions on a disk.  This removes
all usage of struct hd_struct from the I/O path.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Coly Li <colyli@suse.de>			[bcache]
Acked-by: Chao Yu <yuchao0@huawei.com>			[f2fs]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Christoph Hellwig
2020-11-24 09:36:54 +01:00
committed by Jens Axboe
parent cb8432d650
commit 8446fe9255
22 changed files with 122 additions and 137 deletions

View File

@@ -191,7 +191,7 @@ struct request {
};
struct gendisk *rq_disk;
struct hd_struct *part;
struct block_device *part;
#ifdef CONFIG_BLK_RQ_ALLOC_TIME
/* Time that the first bio started allocating this request. */
u64 alloc_time_ns;
@@ -1943,9 +1943,9 @@ unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors,
void disk_end_io_acct(struct gendisk *disk, unsigned int op,
unsigned long start_time);
unsigned long part_start_io_acct(struct gendisk *disk, struct hd_struct **part,
struct bio *bio);
void part_end_io_acct(struct hd_struct *part, struct bio *bio,
unsigned long part_start_io_acct(struct gendisk *disk,
struct block_device **part, struct bio *bio);
void part_end_io_acct(struct block_device *part, struct bio *bio,
unsigned long start_time);
/**