[PATCH 13/13] nvme: introduce generic per-namespace chardev
Christoph Hellwig
hch at lst.de
Fri Apr 9 07:14:32 BST 2021
On Fri, Apr 09, 2021 at 01:56:13AM +0900, Keith Busch wrote:
> On Thu, Apr 08, 2021 at 02:08:42PM +0200, Christoph Hellwig wrote:
> > +int nvme_cdev_add(struct cdev *cdev, struct device *cdev_device,
> > + const struct file_operations *fops, struct module *owner)
> > +{
> > + int minor, ret;
> > +
> > + minor = ida_simple_get(&nvme_ns_chr_minor_ida, 0, 0, GFP_KERNEL);
>
> Do we really need to allocate a minor specific for this char dev? It
> looks like the ns->head->instance can provide the unique value.
Looking at this: no, head->instance doesn't help as it is an
instance relative to subsystem, but doesn't help with a global
allocation over all subsystems.
More information about the Linux-nvme
mailing list