Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pktcdvd: set queue limits at disk allocation time

Remove pkt_init_queue and just pass the two parameters directly to
blk_alloc_disk.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240222073647.3776769-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
40685508 6f420d6a

+5 -11
+5 -11
drivers/block/pktcdvd.c
··· 2484 2484 bio_io_error(bio); 2485 2485 } 2486 2486 2487 - static void pkt_init_queue(struct pktcdvd_device *pd) 2488 - { 2489 - struct request_queue *q = pd->disk->queue; 2490 - 2491 - blk_queue_logical_block_size(q, CD_FRAMESIZE); 2492 - blk_queue_max_hw_sectors(q, PACKET_MAX_SECTORS); 2493 - } 2494 - 2495 2487 static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) 2496 2488 { 2497 2489 struct device *ddev = disk_to_dev(pd->disk); ··· 2526 2534 2527 2535 pd->bdev_handle = bdev_handle; 2528 2536 set_blocksize(bdev_handle->bdev, CD_FRAMESIZE); 2529 - 2530 - pkt_init_queue(pd); 2531 2537 2532 2538 atomic_set(&pd->cdrw.pending_bios, 0); 2533 2539 pd->cdrw.thread = kthread_run(kcdrwd, pd, "%s", pd->disk->disk_name); ··· 2623 2633 */ 2624 2634 static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev) 2625 2635 { 2636 + struct queue_limits lim = { 2637 + .max_hw_sectors = PACKET_MAX_SECTORS, 2638 + .logical_block_size = CD_FRAMESIZE, 2639 + }; 2626 2640 int idx; 2627 2641 int ret = -ENOMEM; 2628 2642 struct pktcdvd_device *pd; ··· 2666 2672 pd->write_congestion_on = write_congestion_on; 2667 2673 pd->write_congestion_off = write_congestion_off; 2668 2674 2669 - disk = blk_alloc_disk(NULL, NUMA_NO_NODE); 2675 + disk = blk_alloc_disk(&lim, NUMA_NO_NODE); 2670 2676 if (IS_ERR(disk)) { 2671 2677 ret = PTR_ERR(disk); 2672 2678 goto out_mem;