Commit 48bc8c7b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

floppy: pass queue_limits to blk_mq_alloc_disk



Pass the few limits floppy imposes directly to blk_mq_alloc_disk instead
of setting them one at a time.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDenis Efremov <efremov@linux.com>
Link: https://lore.kernel.org/r/20240215070300.2200308-4-hch@lst.de


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 9999200f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4516,13 +4516,15 @@ static bool floppy_available(int drive)

static int floppy_alloc_disk(unsigned int drive, unsigned int type)
{
	struct queue_limits lim = {
		.max_hw_sectors = 64,
	};
	struct gendisk *disk;

	disk = blk_mq_alloc_disk(&tag_sets[drive], NULL, NULL);
	disk = blk_mq_alloc_disk(&tag_sets[drive], &lim, NULL);
	if (IS_ERR(disk))
		return PTR_ERR(disk);

	blk_queue_max_hw_sectors(disk->queue, 64);
	disk->major = FLOPPY_MAJOR;
	disk->first_minor = TOMINOR(drive) | (type << 2);
	disk->minors = 1;