[PATCH v2 3/4] nvme: rewrite discard support

Christoph Hellwig hch at lst.de
Tue Mar 22 00:37:48 PDT 2016


On Tue, Mar 22, 2016 at 12:24:45AM -0700, Ming Lin wrote:
> +static inline int nvme_setup_discard(struct nvme_ns *ns, struct request *req,
> +		struct nvme_command *cmnd)
>  {
>  	struct nvme_dsm_range *range;
> +	struct page *page;
> +	int offset;
> +	unsigned int nr_bytes = blk_rq_bytes(req);
>  
> +	range = kmalloc(sizeof(*range), GFP_ATOMIC);
>  	if (!range)
>  		return BLK_MQ_RQ_QUEUE_BUSY;

I've been a bit worried about alignment vs dma transfers here, but it
seems like we should be fine after all as NVMe doesn't limit our
DMA payload alignment, and I couldn't see any platform limitations
either.

Looks fine,

Reviewed-by: Christoph Hellwig <hch at lst.de>



More information about the Linux-nvme mailing list