Re: [PATCH 4/4] nvme: support ranged discard requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 07/02/17 21:34, Christoph Hellwig wrote:
On Tue, Feb 07, 2017 at 01:34:54PM -0500, Keith Busch wrote:
On Tue, Feb 07, 2017 at 05:46:58PM +0100, Christoph Hellwig wrote:
@@ -1233,6 +1243,8 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
 	if (ctrl->vwc & NVME_CTRL_VWC_PRESENT)
 		vwc = true;
 	blk_queue_write_cache(q, vwc, vwc);
+	blk_queue_max_discard_segments(q,
+			PAGE_SIZE / sizeof(struct nvme_dsm_range));

We need to use ctrl->page_size rather than PAGE_SIZE.

We need the PAGE_SIZE upper bound because the "special" bvec only
allows a single page payload.

Shouldn't this be enforced in blk_queue_max_discard_segments() then?



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux