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

sunvdc: pass queue_limits to blk_mq_alloc_disk

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

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

authored by

Christoph Hellwig and committed by
Jens Axboe
d0fa9a8b e6ed9892

+9 -9
+9 -9
drivers/block/sunvdc.c
··· 784 784 785 785 static int probe_disk(struct vdc_port *port) 786 786 { 787 + struct queue_limits lim = { 788 + .physical_block_size = port->vdisk_phys_blksz, 789 + .max_hw_sectors = port->max_xfer_size, 790 + /* Each segment in a request is up to an aligned page in size. */ 791 + .seg_boundary_mask = PAGE_SIZE - 1, 792 + .max_segment_size = PAGE_SIZE, 793 + .max_segments = port->ring_cookies, 794 + }; 787 795 struct request_queue *q; 788 796 struct gendisk *g; 789 797 int err; ··· 832 824 if (err) 833 825 return err; 834 826 835 - g = blk_mq_alloc_disk(&port->tag_set, NULL, port); 827 + g = blk_mq_alloc_disk(&port->tag_set, &lim, port); 836 828 if (IS_ERR(g)) { 837 829 printk(KERN_ERR PFX "%s: Could not allocate gendisk.\n", 838 830 port->vio.name); ··· 843 835 port->disk = g; 844 836 q = g->queue; 845 837 846 - /* Each segment in a request is up to an aligned page in size. */ 847 - blk_queue_segment_boundary(q, PAGE_SIZE - 1); 848 - blk_queue_max_segment_size(q, PAGE_SIZE); 849 - 850 - blk_queue_max_segments(q, port->ring_cookies); 851 - blk_queue_max_hw_sectors(q, port->max_xfer_size); 852 838 g->major = vdc_major; 853 839 g->first_minor = port->vio.vdev->dev_no << PARTITION_SHIFT; 854 840 g->minors = 1 << PARTITION_SHIFT; ··· 873 871 break; 874 872 } 875 873 } 876 - 877 - blk_queue_physical_block_size(q, port->vdisk_phys_blksz); 878 874 879 875 pr_info(PFX "%s: %u sectors (%u MB) protocol %d.%d\n", 880 876 g->disk_name,