From: Christoph Hellwig <hch@lst.de> To: Jens Axboe <axboe@kernel.dk> Cc: Richard Weinberger <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Johannes Berg <johannes@sipsolutions.net>, Justin Sanders <justin@coraid.com>, Denis Efremov <efremov@linux.com>, Josef Bacik <josef@toxicpanda.com>, Geoff Levand <geoff@infradead.org>, Ilya Dryomov <idryomov@gmail.com>, "Md. Haris Iqbal" <haris.iqbal@ionos.com>, Jack Wang <jinpu.wang@ionos.com>, Ming Lei <ming.lei@redhat.com>, Maxim Levitsky <maximlevitsky@gmail.com>, Alex Dubov <oakad@yahoo.com>, Ulf Hansson <ulf.hansson@linaro.org>, Miquel Raynal <miquel.raynal@bootlin.com>, Vignesh Raghavendra <vigneshr@ti.com>, Vineeth Vijayan <vneethv@linux.ibm.com>, linux-block@vger.kernel.org, nbd@other.debian.org, ceph-devel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-s390@vger.kernel.org Subject: [PATCH 11/17] ms_block: pass queue_limits to blk_mq_alloc_disk Date: Thu, 15 Feb 2024 08:02:54 +0100 [thread overview] Message-ID: <20240215070300.2200308-12-hch@lst.de> (raw) In-Reply-To: <20240215070300.2200308-1-hch@lst.de> Pass the few limits ms_block imposes directly to blk_mq_alloc_disk instead of setting them one at a time. Signed-off-by: Christoph Hellwig <hch@lst.de> --- drivers/memstick/core/ms_block.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c index d3277c901d16bb..47a314a4eb6faf 100644 --- a/drivers/memstick/core/ms_block.c +++ b/drivers/memstick/core/ms_block.c @@ -2078,6 +2078,12 @@ static const struct blk_mq_ops msb_mq_ops = { static int msb_init_disk(struct memstick_dev *card) { struct msb_data *msb = memstick_get_drvdata(card); + struct queue_limits lim = { + .logical_block_size = msb->page_size, + .max_hw_sectors = MS_BLOCK_MAX_PAGES, + .max_segments = MS_BLOCK_MAX_SEGS, + .max_segment_size = MS_BLOCK_MAX_PAGES * msb->page_size, + }; int rc; unsigned long capacity; @@ -2093,19 +2099,13 @@ static int msb_init_disk(struct memstick_dev *card) if (rc) goto out_release_id; - msb->disk = blk_mq_alloc_disk(&msb->tag_set, NULL, card); + msb->disk = blk_mq_alloc_disk(&msb->tag_set, &lim, card); if (IS_ERR(msb->disk)) { rc = PTR_ERR(msb->disk); goto out_free_tag_set; } msb->queue = msb->disk->queue; - blk_queue_max_hw_sectors(msb->queue, MS_BLOCK_MAX_PAGES); - blk_queue_max_segments(msb->queue, MS_BLOCK_MAX_SEGS); - blk_queue_max_segment_size(msb->queue, - MS_BLOCK_MAX_PAGES * msb->page_size); - blk_queue_logical_block_size(msb->queue, msb->page_size); - sprintf(msb->disk->disk_name, "msblk%d", msb->disk_id); msb->disk->fops = &msb_bdops; msb->disk->private_data = msb; -- 2.39.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de> To: Jens Axboe <axboe@kernel.dk> Cc: Richard Weinberger <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Johannes Berg <johannes@sipsolutions.net>, Justin Sanders <justin@coraid.com>, Denis Efremov <efremov@linux.com>, Josef Bacik <josef@toxicpanda.com>, Geoff Levand <geoff@infradead.org>, Ilya Dryomov <idryomov@gmail.com>, "Md. Haris Iqbal" <haris.iqbal@ionos.com>, Jack Wang <jinpu.wang@ionos.com>, Ming Lei <ming.lei@redhat.com>, Maxim Levitsky <maximlevitsky@gmail.com>, Alex Dubov <oakad@yahoo.com>, Ulf Hansson <ulf.hansson@linaro.org>, Miquel Raynal <miquel.raynal@bootlin.com>, Vignesh Raghavendra <vigneshr@ti.com>, Vineeth Vijayan <vneethv@linux.ibm.com>, linux-block@vger.kernel.org, nbd@other.debian.org, ceph-devel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-s390@vger.kernel.org Subject: [PATCH 11/17] ms_block: pass queue_limits to blk_mq_alloc_disk Date: Thu, 15 Feb 2024 08:02:54 +0100 [thread overview] Message-ID: <20240215070300.2200308-12-hch@lst.de> (raw) In-Reply-To: <20240215070300.2200308-1-hch@lst.de> Pass the few limits ms_block imposes directly to blk_mq_alloc_disk instead of setting them one at a time. Signed-off-by: Christoph Hellwig <hch@lst.de> --- drivers/memstick/core/ms_block.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c index d3277c901d16bb..47a314a4eb6faf 100644 --- a/drivers/memstick/core/ms_block.c +++ b/drivers/memstick/core/ms_block.c @@ -2078,6 +2078,12 @@ static const struct blk_mq_ops msb_mq_ops = { static int msb_init_disk(struct memstick_dev *card) { struct msb_data *msb = memstick_get_drvdata(card); + struct queue_limits lim = { + .logical_block_size = msb->page_size, + .max_hw_sectors = MS_BLOCK_MAX_PAGES, + .max_segments = MS_BLOCK_MAX_SEGS, + .max_segment_size = MS_BLOCK_MAX_PAGES * msb->page_size, + }; int rc; unsigned long capacity; @@ -2093,19 +2099,13 @@ static int msb_init_disk(struct memstick_dev *card) if (rc) goto out_release_id; - msb->disk = blk_mq_alloc_disk(&msb->tag_set, NULL, card); + msb->disk = blk_mq_alloc_disk(&msb->tag_set, &lim, card); if (IS_ERR(msb->disk)) { rc = PTR_ERR(msb->disk); goto out_free_tag_set; } msb->queue = msb->disk->queue; - blk_queue_max_hw_sectors(msb->queue, MS_BLOCK_MAX_PAGES); - blk_queue_max_segments(msb->queue, MS_BLOCK_MAX_SEGS); - blk_queue_max_segment_size(msb->queue, - MS_BLOCK_MAX_PAGES * msb->page_size); - blk_queue_logical_block_size(msb->queue, msb->page_size); - sprintf(msb->disk->disk_name, "msblk%d", msb->disk_id); msb->disk->fops = &msb_bdops; msb->disk->private_data = msb; -- 2.39.2
next prev parent reply other threads:[~2024-02-15 7:03 UTC|newest] Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-02-15 7:02 pass queue_limits to blk_mq_alloc_disk for simple drivers Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:02 ` [PATCH 01/17] ubd: pass queue_limits to blk_mq_alloc_disk Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:02 ` [PATCH 02/17] aoe: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:02 ` [PATCH 03/17] floppy: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-19 6:39 ` Denis Efremov (Oracle) 2024-02-15 7:02 ` [PATCH 04/17] mtip: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:02 ` [PATCH 05/17] nbd: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:02 ` [PATCH 06/17] ps3disk: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:02 ` [PATCH 07/17] rbd: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-20 11:18 ` Ilya Dryomov 2024-02-20 11:18 ` Ilya Dryomov 2024-02-15 7:02 ` [PATCH 08/17] rnbd-clt: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-16 7:49 ` Jinpu Wang 2024-02-16 7:49 ` Jinpu Wang 2024-02-15 7:02 ` [PATCH 09/17] sunvdc: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:02 ` [PATCH 10/17] gdrom: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig [this message] 2024-02-15 7:02 ` [PATCH 11/17] ms_block: " Christoph Hellwig 2024-02-15 7:02 ` [PATCH 12/17] mspro_block: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:02 ` [PATCH 13/17] mtd_blkdevs: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:02 ` [PATCH 14/17] ubiblock: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-18 2:33 ` Zhihao Cheng 2024-02-18 2:33 ` Zhihao Cheng 2024-02-15 7:02 ` [PATCH 15/17] scm_blk: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:02 ` [PATCH 16/17] ublk: " Christoph Hellwig 2024-02-15 7:02 ` Christoph Hellwig 2024-02-15 7:03 ` [PATCH 17/17] mmc: " Christoph Hellwig 2024-02-15 7:03 ` Christoph Hellwig 2024-02-15 16:40 ` Ulf Hansson 2024-02-15 16:40 ` Ulf Hansson 2024-02-15 16:49 ` Christoph Hellwig 2024-02-15 16:49 ` Christoph Hellwig 2024-02-15 16:53 ` Ulf Hansson 2024-02-15 16:53 ` Ulf Hansson 2024-02-20 22:01 ` Geert Uytterhoeven 2024-02-20 22:01 ` Geert Uytterhoeven 2024-02-20 22:14 ` Geert Uytterhoeven 2024-02-20 22:14 ` Geert Uytterhoeven 2024-02-21 5:44 ` Christoph Hellwig 2024-02-21 5:44 ` Christoph Hellwig 2024-02-21 9:37 ` Geert Uytterhoeven 2024-02-21 9:37 ` Geert Uytterhoeven 2024-02-20 13:22 ` pass queue_limits to blk_mq_alloc_disk for simple drivers Jens Axboe 2024-02-20 13:22 ` Jens Axboe
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240215070300.2200308-12-hch@lst.de \ --to=hch@lst.de \ --cc=anton.ivanov@cambridgegreys.com \ --cc=axboe@kernel.dk \ --cc=ceph-devel@vger.kernel.org \ --cc=efremov@linux.com \ --cc=geoff@infradead.org \ --cc=haris.iqbal@ionos.com \ --cc=idryomov@gmail.com \ --cc=jinpu.wang@ionos.com \ --cc=johannes@sipsolutions.net \ --cc=josef@toxicpanda.com \ --cc=justin@coraid.com \ --cc=linux-block@vger.kernel.org \ --cc=linux-mmc@vger.kernel.org \ --cc=linux-mtd@lists.infradead.org \ --cc=linux-s390@vger.kernel.org \ --cc=maximlevitsky@gmail.com \ --cc=ming.lei@redhat.com \ --cc=miquel.raynal@bootlin.com \ --cc=nbd@other.debian.org \ --cc=oakad@yahoo.com \ --cc=richard@nod.at \ --cc=ulf.hansson@linaro.org \ --cc=vigneshr@ti.com \ --cc=vneethv@linux.ibm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.