From: Luis Chamberlain <mcgrof@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Chris Zankel <chris@zankel.net>,
Max Filippov <jcmvbkbc@gmail.com>,
Philipp Reisner <philipp.reisner@linbit.com>,
Lars Ellenberg <lars.ellenberg@linbit.com>,
Jim Paris <jim@jtan.com>,
Joshua Morris <josh.h.morris@us.ibm.com>,
Philip Kelleher <pjk1939@linux.ibm.com>,
Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
Matias Bjorling <mb@lightnvm.io>, Coly Li <colyli@suse.de>,
Mike Snitzer <snitzer@redhat.com>, Song Liu <song@kernel.org>,
Maxim Levitsky <maximlevitsky@gmail.com>,
Alex Dubov <oakad@yahoo.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Dan Williams <dan.j.williams@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
linux-xtensa@linux-xtensa.org, linux-m68k@vger.kernel.org,
linux-raid@vger.kernel.org, nvdimm@lists.linux.dev,
linux-s390@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-bcache@vger.kernel.org, linux-nvme@lists.infradead.org,
linux-block@vger.kernel.org, dm-devel@redhat.com,
drbd-dev@tron.linbit.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [dm-devel] [PATCH 05/26] block: add blk_alloc_disk and blk_cleanup_disk APIs
Date: Fri, 21 May 2021 17:44:07 +0000 [thread overview]
Message-ID: <20210521174407.GA25291@42.do-not-panic.com> (raw)
In-Reply-To: <20210521055116.1053587-6-hch@lst.de>
On Fri, May 21, 2021 at 07:50:55AM +0200, Christoph Hellwig wrote:
> Add two new APIs to allocate and free a gendisk including the
> request_queue for use with BIO based drivers. This is to avoid
> boilerplate code in drivers.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> block/genhd.c | 35 +++++++++++++++++++++++++++++++++++
> include/linux/genhd.h | 22 ++++++++++++++++++++++
> 2 files changed, 57 insertions(+)
>
> diff --git a/block/genhd.c b/block/genhd.c
> index e4974af3d729..6d4ce962866d 100644
> --- a/block/genhd.c
> +++ b/block/genhd.c
> @@ -1302,6 +1302,25 @@ struct gendisk *__alloc_disk_node(int minors, int node_id)
> }
> EXPORT_SYMBOL(__alloc_disk_node);
>
> +struct gendisk *__blk_alloc_disk(int node)
> +{
> + struct request_queue *q;
> + struct gendisk *disk;
> +
> + q = blk_alloc_queue(node);
> + if (!q)
> + return NULL;
> +
> + disk = __alloc_disk_node(0, node);
> + if (!disk) {
> + blk_cleanup_queue(q);
> + return NULL;
> + }
> + disk->queue = q;
> + return disk;
> +}
> +EXPORT_SYMBOL(__blk_alloc_disk);
Its not obvious to me why using this new API requires you then to
set minors explicitly to 1, and yet here underneath we see the minors
argument passed is 0.
Nor is it clear from the documentation.
Luis
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2021-05-24 19:49 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210521055116.1053587-1-hch@lst.de>
[not found] ` <20210521055116.1053587-2-hch@lst.de>
2021-05-21 17:16 ` [dm-devel] [PATCH 01/26] block: refactor device number setup in __device_add_disk Luis Chamberlain
2021-05-24 7:20 ` Christoph Hellwig
2021-05-23 7:46 ` Hannes Reinecke
2021-05-24 7:22 ` Christoph Hellwig
[not found] ` <20210521055116.1053587-3-hch@lst.de>
2021-05-21 17:18 ` [dm-devel] [PATCH 02/26] block: move the DISK_MAX_PARTS sanity check into __device_add_disk Luis Chamberlain
2021-05-23 7:48 ` Hannes Reinecke
[not found] ` <20210521055116.1053587-6-hch@lst.de>
2021-05-21 17:44 ` Luis Chamberlain [this message]
2021-05-24 7:24 ` [dm-devel] [PATCH 05/26] block: add blk_alloc_disk and blk_cleanup_disk APIs Christoph Hellwig
2021-05-23 7:55 ` Hannes Reinecke
[not found] ` <20210521055116.1053587-4-hch@lst.de>
2021-05-21 17:22 ` [dm-devel] [PATCH 03/26] block: automatically enable GENHD_FL_EXT_DEVT Luis Chamberlain
2021-05-23 7:50 ` Hannes Reinecke
[not found] ` <20210521055116.1053587-5-hch@lst.de>
2021-05-21 17:28 ` [dm-devel] [PATCH 04/26] block: add a flag to make put_disk on partially initalized disks safer Luis Chamberlain
2021-05-23 7:54 ` Hannes Reinecke
[not found] ` <20210521055116.1053587-7-hch@lst.de>
2021-05-23 7:58 ` [PATCH 06/26] brd: convert to blk_alloc_disk/blk_cleanup_disk Hannes Reinecke
2021-05-24 7:24 ` Christoph Hellwig
[not found] ` <20210521055116.1053587-8-hch@lst.de>
2021-05-23 7:59 ` [PATCH 07/26] drbd: " Hannes Reinecke
[not found] ` <20210521055116.1053587-9-hch@lst.de>
2021-05-23 8:00 ` [PATCH 08/26] pktcdvd: " Hannes Reinecke
[not found] ` <20210521055116.1053587-10-hch@lst.de>
2021-05-23 8:01 ` [PATCH 09/26] rsxx: " Hannes Reinecke
[not found] ` <20210521055116.1053587-11-hch@lst.de>
2021-05-23 8:01 ` [PATCH 10/26] zram: " Hannes Reinecke
[not found] ` <20210521055116.1053587-12-hch@lst.de>
2021-05-23 8:02 ` [PATCH 11/26] lightnvm: " Hannes Reinecke
[not found] ` <20210521055116.1053587-13-hch@lst.de>
2021-05-23 8:04 ` [PATCH 12/26] bcache: " Hannes Reinecke
2021-05-23 16:20 ` Coly Li
[not found] ` <20210521055116.1053587-14-hch@lst.de>
2021-05-23 8:10 ` [PATCH 13/26] dm: " Hannes Reinecke
2021-05-24 7:25 ` Christoph Hellwig
[not found] ` <20210521055116.1053587-15-hch@lst.de>
2021-05-23 8:12 ` [PATCH 14/26] md: " Hannes Reinecke
2021-05-24 7:26 ` Christoph Hellwig
2021-05-24 8:27 ` Hannes Reinecke
[not found] ` <20210521055116.1053587-16-hch@lst.de>
2021-05-23 8:13 ` [PATCH 15/26] nvdimm-blk: " Hannes Reinecke
[not found] ` <20210521055116.1053587-17-hch@lst.de>
2021-05-23 8:14 ` [PATCH 16/26] nvdimm-btt: " Hannes Reinecke
[not found] ` <20210521055116.1053587-18-hch@lst.de>
2021-05-23 8:14 ` [PATCH 17/26] nvdimm-pmem: " Hannes Reinecke
2021-06-07 4:43 ` Dan Williams
[not found] ` <20210521055116.1053587-19-hch@lst.de>
2021-05-23 8:20 ` [PATCH 18/26] nvme-multipath: " Hannes Reinecke
2021-05-24 7:29 ` Christoph Hellwig
[not found] ` <20210521055116.1053587-20-hch@lst.de>
2021-05-21 8:37 ` [PATCH 19/26] nfblock: " Geert Uytterhoeven
2021-05-23 8:21 ` Hannes Reinecke
[not found] ` <20210521055116.1053587-21-hch@lst.de>
2021-05-23 8:22 ` [PATCH 20/26] simdisk: " Hannes Reinecke
[not found] ` <20210521055116.1053587-22-hch@lst.de>
2021-05-23 8:22 ` [PATCH 21/26] n64cart: convert to blk_alloc_disk Hannes Reinecke
[not found] ` <20210521055116.1053587-23-hch@lst.de>
2021-05-23 8:23 ` [PATCH 22/26] ps3vram: convert to blk_alloc_disk/blk_cleanup_disk Hannes Reinecke
[not found] ` <20210521055116.1053587-24-hch@lst.de>
2021-05-23 8:23 ` [PATCH 23/26] dcssblk: " Hannes Reinecke
[not found] ` <20210521055116.1053587-25-hch@lst.de>
2021-05-23 8:24 ` [PATCH 24/26] xpram: " Hannes Reinecke
[not found] ` <20210521055116.1053587-26-hch@lst.de>
2021-05-23 8:25 ` [PATCH 25/26] null_blk: " Hannes Reinecke
[not found] ` <20210521055116.1053587-27-hch@lst.de>
2021-05-23 8:26 ` [PATCH 26/26] block: unexport blk_alloc_queue Hannes Reinecke
2021-05-25 22:41 ` simplify gendisk and request_queue allocation for bio based drivers Ulf Hansson
2021-05-26 4:49 ` Christoph Hellwig
2021-05-26 8:07 ` Ulf Hansson
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=20210521174407.GA25291@42.do-not-panic.com \
--to=mcgrof@kernel.org \
--cc=axboe@kernel.dk \
--cc=borntraeger@de.ibm.com \
--cc=chris@zankel.net \
--cc=colyli@suse.de \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dm-devel@redhat.com \
--cc=drbd-dev@tron.linbit.com \
--cc=geert@linux-m68k.org \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=hch@lst.de \
--cc=jcmvbkbc@gmail.com \
--cc=jim@jtan.com \
--cc=josh.h.morris@us.ibm.com \
--cc=lars.ellenberg@linbit.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-raid@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-xtensa@linux-xtensa.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maximlevitsky@gmail.com \
--cc=mb@lightnvm.io \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.org \
--cc=nvdimm@lists.linux.dev \
--cc=oakad@yahoo.com \
--cc=philipp.reisner@linbit.com \
--cc=pjk1939@linux.ibm.com \
--cc=snitzer@redhat.com \
--cc=song@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=vishal.l.verma@intel.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox