Re: [PATCH v3 04/15] libnvdimm, pmem: move request_queue allocation earlier in probe
From: Ross Zwisler
Date: Tue Nov 03 2015 - 14:15:29 EST
On Sun, Nov 01, 2015 at 11:30:04PM -0500, Dan Williams wrote:
> Before the dynamically allocated struct pages from devm_memremap_pages()
> can be put to use outside the driver, we need a mechanism to track
> whether they are still in use at teardown. Towards that goal reorder
> the initialization sequence to allow the 'q_usage_counter' from the
> request_queue to be used by the devm_memremap_pages() implementation (in
> subsequent patches).
>
> Cc: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx>
> Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
<>
> @@ -150,16 +151,23 @@ static struct pmem_device *pmem_alloc(struct device *dev,
> return ERR_PTR(-EBUSY);
> }
>
> - if (pmem_should_map_pages(dev))
> + q = blk_alloc_queue_node(GFP_KERNEL, dev_to_node(dev));
> + if (!q)
> + return ERR_PTR(-ENOMEM);
> +
> + if (pmem_should_map_pages(dev)) {
No need to introduce braces for this if().
Otherwise this looks fine.
Reviewed-by: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/