diff options
author | Christoph Hellwig <hch@lst.de> | 2021-08-10 17:45:09 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-12 10:31:35 -0600 |
commit | a08aa9bccdc282b5e8d133bf8c239473f057b464 (patch) | |
tree | bacbfd0d8f42786aed2fff06103c78aa3a98b3df /block/partitions/amiga.c | |
parent | 50b4aecfbbb09869db967e4a26212a47e10c0088 (diff) | |
download | lwn-a08aa9bccdc282b5e8d133bf8c239473f057b464.tar.gz lwn-a08aa9bccdc282b5e8d133bf8c239473f057b464.zip |
block: store a gendisk in struct parsed_partitions
Partition scanning only happens on the whole device, so pass a
struct gendisk instead of the whole device block_device to the scanners.
This allows to simplify printing the device name in various places as the
disk name is available in disk->name.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://lore.kernel.org/r/20210810154512.1809898-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/partitions/amiga.c')
-rw-r--r-- | block/partitions/amiga.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/block/partitions/amiga.c b/block/partitions/amiga.c index 9526491d9aed..5c8624e26a54 100644 --- a/block/partitions/amiga.c +++ b/block/partitions/amiga.c @@ -34,7 +34,6 @@ int amiga_partition(struct parsed_partitions *state) int start_sect, nr_sects, blk, part, res = 0; int blksize = 1; /* Multiplier for disk block size */ int slot = 1; - char b[BDEVNAME_SIZE]; for (blk = 0; ; blk++, put_dev_sector(sect)) { if (blk == RDB_ALLOCATION_LIMIT) @@ -42,7 +41,7 @@ int amiga_partition(struct parsed_partitions *state) data = read_part_sector(state, blk, §); if (!data) { pr_err("Dev %s: unable to read RDB block %d\n", - bdevname(state->bdev, b), blk); + state->disk->disk_name, blk); res = -1; goto rdb_done; } @@ -64,7 +63,7 @@ int amiga_partition(struct parsed_partitions *state) } pr_err("Dev %s: RDB in block %d has bad checksum\n", - bdevname(state->bdev, b), blk); + state->disk->disk_name, blk); } /* blksize is blocks per 512 byte standard block */ @@ -84,7 +83,7 @@ int amiga_partition(struct parsed_partitions *state) data = read_part_sector(state, blk, §); if (!data) { pr_err("Dev %s: unable to read partition block %d\n", - bdevname(state->bdev, b), blk); + state->disk->disk_name, blk); res = -1; goto rdb_done; } |