aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/nvme-core.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index ee83554c28ba..7ed618125c27 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -152,6 +152,7 @@ struct nvme_cmd_info {
152 */ 152 */
153#define NVME_INT_PAGES 2 153#define NVME_INT_PAGES 2
154#define NVME_INT_BYTES(dev) (NVME_INT_PAGES * (dev)->page_size) 154#define NVME_INT_BYTES(dev) (NVME_INT_PAGES * (dev)->page_size)
155#define NVME_INT_MASK 0x01
155 156
156/* 157/*
157 * Will slightly overestimate the number of pages needed. This is OK 158 * Will slightly overestimate the number of pages needed. This is OK
@@ -257,7 +258,7 @@ static void *iod_get_private(struct nvme_iod *iod)
257 */ 258 */
258static bool iod_should_kfree(struct nvme_iod *iod) 259static bool iod_should_kfree(struct nvme_iod *iod)
259{ 260{
260 return (iod->private & 0x01) == 0; 261 return (iod->private & NVME_INT_MASK) == 0;
261} 262}
262 263
263/* Special values must be less than 0x1000 */ 264/* Special values must be less than 0x1000 */
@@ -432,7 +433,6 @@ static struct nvme_iod *nvme_alloc_iod(struct request *rq, struct nvme_dev *dev,
432{ 433{
433 unsigned size = !(rq->cmd_flags & REQ_DISCARD) ? blk_rq_bytes(rq) : 434 unsigned size = !(rq->cmd_flags & REQ_DISCARD) ? blk_rq_bytes(rq) :
434 sizeof(struct nvme_dsm_range); 435 sizeof(struct nvme_dsm_range);
435 unsigned long mask = 0;
436 struct nvme_iod *iod; 436 struct nvme_iod *iod;
437 437
438 if (rq->nr_phys_segments <= NVME_INT_PAGES && 438 if (rq->nr_phys_segments <= NVME_INT_PAGES &&
@@ -440,9 +440,8 @@ static struct nvme_iod *nvme_alloc_iod(struct request *rq, struct nvme_dev *dev,
440 struct nvme_cmd_info *cmd = blk_mq_rq_to_pdu(rq); 440 struct nvme_cmd_info *cmd = blk_mq_rq_to_pdu(rq);
441 441
442 iod = cmd->iod; 442 iod = cmd->iod;
443 mask = 0x01;
444 iod_init(iod, size, rq->nr_phys_segments, 443 iod_init(iod, size, rq->nr_phys_segments,
445 (unsigned long) rq | 0x01); 444 (unsigned long) rq | NVME_INT_MASK);
446 return iod; 445 return iod;
447 } 446 }
448 447