diff options
author | Mike Christie <mchristi@redhat.com> | 2016-06-05 15:32:17 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-06-07 15:41:38 -0400 |
commit | c2df40dfb8c015211ec55f4b1dd0587f875c7b34 (patch) | |
tree | 8660ea8a2a00b0248fa609e7e6b737a8d92306d9 | |
parent | d9d8c5c489f4969667a05727e9c2c4f78cffef1a (diff) |
drivers: use req op accessor
The req operation REQ_OP is separated from the rq_flag_bits
definition. This converts the block layer drivers to
use req_op to get the op from the request struct.
Signed-off-by: Mike Christie <mchristi@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | drivers/block/loop.c | 6 | ||||
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 2 | ||||
-rw-r--r-- | drivers/block/nbd.c | 2 | ||||
-rw-r--r-- | drivers/block/rbd.c | 4 | ||||
-rw-r--r-- | drivers/block/xen-blkfront.c | 8 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 2 | ||||
-rw-r--r-- | drivers/md/dm.c | 2 | ||||
-rw-r--r-- | drivers/mmc/card/block.c | 7 | ||||
-rw-r--r-- | drivers/mmc/card/queue.c | 6 | ||||
-rw-r--r-- | drivers/mmc/card/queue.h | 5 | ||||
-rw-r--r-- | drivers/mtd/mtd_blkdevs.c | 2 | ||||
-rw-r--r-- | drivers/nvme/host/core.c | 2 | ||||
-rw-r--r-- | drivers/nvme/host/nvme.h | 4 | ||||
-rw-r--r-- | drivers/scsi/sd.c | 25 |
14 files changed, 43 insertions, 34 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index e9f1701af7cb..b9b737cafd5f 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -544,7 +544,7 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq) | |||
544 | if (op_is_write(req_op(rq))) { | 544 | if (op_is_write(req_op(rq))) { |
545 | if (rq->cmd_flags & REQ_FLUSH) | 545 | if (rq->cmd_flags & REQ_FLUSH) |
546 | ret = lo_req_flush(lo, rq); | 546 | ret = lo_req_flush(lo, rq); |
547 | else if (rq->cmd_flags & REQ_DISCARD) | 547 | else if (req_op(rq) == REQ_OP_DISCARD) |
548 | ret = lo_discard(lo, rq, pos); | 548 | ret = lo_discard(lo, rq, pos); |
549 | else if (lo->transfer) | 549 | else if (lo->transfer) |
550 | ret = lo_write_transfer(lo, rq, pos); | 550 | ret = lo_write_transfer(lo, rq, pos); |
@@ -1659,8 +1659,8 @@ static int loop_queue_rq(struct blk_mq_hw_ctx *hctx, | |||
1659 | if (lo->lo_state != Lo_bound) | 1659 | if (lo->lo_state != Lo_bound) |
1660 | return -EIO; | 1660 | return -EIO; |
1661 | 1661 | ||
1662 | if (lo->use_dio && !(cmd->rq->cmd_flags & (REQ_FLUSH | | 1662 | if (lo->use_dio && (!(cmd->rq->cmd_flags & REQ_FLUSH) || |
1663 | REQ_DISCARD))) | 1663 | req_op(cmd->rq) == REQ_OP_DISCARD)) |
1664 | cmd->use_aio = true; | 1664 | cmd->use_aio = true; |
1665 | else | 1665 | else |
1666 | cmd->use_aio = false; | 1666 | cmd->use_aio = false; |
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 6053e4659fa2..8e3e708cb9ee 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
@@ -3765,7 +3765,7 @@ static int mtip_submit_request(struct blk_mq_hw_ctx *hctx, struct request *rq) | |||
3765 | return -ENODATA; | 3765 | return -ENODATA; |
3766 | } | 3766 | } |
3767 | 3767 | ||
3768 | if (rq->cmd_flags & REQ_DISCARD) { | 3768 | if (req_op(rq) == REQ_OP_DISCARD) { |
3769 | int err; | 3769 | int err; |
3770 | 3770 | ||
3771 | err = mtip_send_trim(dd, blk_rq_pos(rq), blk_rq_sectors(rq)); | 3771 | err = mtip_send_trim(dd, blk_rq_pos(rq), blk_rq_sectors(rq)); |
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 31e73a7a40f2..6c2c28d124d0 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -282,7 +282,7 @@ static int nbd_send_req(struct nbd_device *nbd, struct request *req) | |||
282 | 282 | ||
283 | if (req->cmd_type == REQ_TYPE_DRV_PRIV) | 283 | if (req->cmd_type == REQ_TYPE_DRV_PRIV) |
284 | type = NBD_CMD_DISC; | 284 | type = NBD_CMD_DISC; |
285 | else if (req->cmd_flags & REQ_DISCARD) | 285 | else if (req_op(req) == REQ_OP_DISCARD) |
286 | type = NBD_CMD_TRIM; | 286 | type = NBD_CMD_TRIM; |
287 | else if (req->cmd_flags & REQ_FLUSH) | 287 | else if (req->cmd_flags & REQ_FLUSH) |
288 | type = NBD_CMD_FLUSH; | 288 | type = NBD_CMD_FLUSH; |
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 81666a56415e..450662055d97 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -3286,9 +3286,9 @@ static void rbd_queue_workfn(struct work_struct *work) | |||
3286 | goto err; | 3286 | goto err; |
3287 | } | 3287 | } |
3288 | 3288 | ||
3289 | if (rq->cmd_flags & REQ_DISCARD) | 3289 | if (req_op(rq) == REQ_OP_DISCARD) |
3290 | op_type = OBJ_OP_DISCARD; | 3290 | op_type = OBJ_OP_DISCARD; |
3291 | else if (rq->cmd_flags & REQ_WRITE) | 3291 | else if (req_op(rq) == REQ_OP_WRITE) |
3292 | op_type = OBJ_OP_WRITE; | 3292 | op_type = OBJ_OP_WRITE; |
3293 | else | 3293 | else |
3294 | op_type = OBJ_OP_READ; | 3294 | op_type = OBJ_OP_READ; |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 52963a26660a..6fd160197b7a 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -844,7 +844,8 @@ static int blkif_queue_request(struct request *req, struct blkfront_ring_info *r | |||
844 | if (unlikely(rinfo->dev_info->connected != BLKIF_STATE_CONNECTED)) | 844 | if (unlikely(rinfo->dev_info->connected != BLKIF_STATE_CONNECTED)) |
845 | return 1; | 845 | return 1; |
846 | 846 | ||
847 | if (unlikely(req->cmd_flags & (REQ_DISCARD | REQ_SECURE))) | 847 | if (unlikely(req_op(req) == REQ_OP_DISCARD || |
848 | req->cmd_flags & REQ_SECURE)) | ||
848 | return blkif_queue_discard_req(req, rinfo); | 849 | return blkif_queue_discard_req(req, rinfo); |
849 | else | 850 | else |
850 | return blkif_queue_rw_req(req, rinfo); | 851 | return blkif_queue_rw_req(req, rinfo); |
@@ -2054,8 +2055,9 @@ static int blkif_recover(struct blkfront_info *info) | |||
2054 | /* | 2055 | /* |
2055 | * Get the bios in the request so we can re-queue them. | 2056 | * Get the bios in the request so we can re-queue them. |
2056 | */ | 2057 | */ |
2057 | if (copy[i].request->cmd_flags & | 2058 | if (copy[i].request->cmd_flags & REQ_FLUSH || |
2058 | (REQ_FLUSH | REQ_FUA | REQ_DISCARD | REQ_SECURE)) { | 2059 | req_op(copy[i].request) == REQ_OP_DISCARD || |
2060 | copy[i].request->cmd_flags & (REQ_FUA | REQ_SECURE)) { | ||
2059 | /* | 2061 | /* |
2060 | * Flush operations don't contain bios, so | 2062 | * Flush operations don't contain bios, so |
2061 | * we need to requeue the whole request | 2063 | * we need to requeue the whole request |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 2fb5350c5410..f079d8d1d856 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -206,7 +206,7 @@ static void idefloppy_create_rw_cmd(ide_drive_t *drive, | |||
206 | memcpy(rq->cmd, pc->c, 12); | 206 | memcpy(rq->cmd, pc->c, 12); |
207 | 207 | ||
208 | pc->rq = rq; | 208 | pc->rq = rq; |
209 | if (rq->cmd_flags & REQ_WRITE) | 209 | if (cmd == WRITE) |
210 | pc->flags |= PC_FLAG_WRITING; | 210 | pc->flags |= PC_FLAG_WRITING; |
211 | 211 | ||
212 | pc->flags |= PC_FLAG_DMA_OK; | 212 | pc->flags |= PC_FLAG_DMA_OK; |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 9204a2dfdd64..f6b104c77b6d 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1322,7 +1322,7 @@ static void dm_done(struct request *clone, int error, bool mapped) | |||
1322 | r = rq_end_io(tio->ti, clone, error, &tio->info); | 1322 | r = rq_end_io(tio->ti, clone, error, &tio->info); |
1323 | } | 1323 | } |
1324 | 1324 | ||
1325 | if (unlikely(r == -EREMOTEIO && (clone->cmd_flags & REQ_WRITE_SAME) && | 1325 | if (unlikely(r == -EREMOTEIO && (req_op(clone) == REQ_OP_WRITE_SAME) && |
1326 | !clone->q->limits.max_write_same_sectors)) | 1326 | !clone->q->limits.max_write_same_sectors)) |
1327 | disable_write_same(tio->md); | 1327 | disable_write_same(tio->md); |
1328 | 1328 | ||
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index e62fde3ac431..201a8719f6c4 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -1722,8 +1722,7 @@ static u8 mmc_blk_prep_packed_list(struct mmc_queue *mq, struct request *req) | |||
1722 | !IS_ALIGNED(blk_rq_sectors(next), 8)) | 1722 | !IS_ALIGNED(blk_rq_sectors(next), 8)) |
1723 | break; | 1723 | break; |
1724 | 1724 | ||
1725 | if (next->cmd_flags & REQ_DISCARD || | 1725 | if (req_op(next) == REQ_OP_DISCARD || next->cmd_flags & REQ_FLUSH) |
1726 | next->cmd_flags & REQ_FLUSH) | ||
1727 | break; | 1726 | break; |
1728 | 1727 | ||
1729 | if (rq_data_dir(cur) != rq_data_dir(next)) | 1728 | if (rq_data_dir(cur) != rq_data_dir(next)) |
@@ -2164,7 +2163,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
2164 | } | 2163 | } |
2165 | 2164 | ||
2166 | mq->flags &= ~MMC_QUEUE_NEW_REQUEST; | 2165 | mq->flags &= ~MMC_QUEUE_NEW_REQUEST; |
2167 | if (cmd_flags & REQ_DISCARD) { | 2166 | if (req && req_op(req) == REQ_OP_DISCARD) { |
2168 | /* complete ongoing async transfer before issuing discard */ | 2167 | /* complete ongoing async transfer before issuing discard */ |
2169 | if (card->host->areq) | 2168 | if (card->host->areq) |
2170 | mmc_blk_issue_rw_rq(mq, NULL); | 2169 | mmc_blk_issue_rw_rq(mq, NULL); |
@@ -2188,7 +2187,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
2188 | 2187 | ||
2189 | out: | 2188 | out: |
2190 | if ((!req && !(mq->flags & MMC_QUEUE_NEW_REQUEST)) || | 2189 | if ((!req && !(mq->flags & MMC_QUEUE_NEW_REQUEST)) || |
2191 | (cmd_flags & MMC_REQ_SPECIAL_MASK)) | 2190 | mmc_req_is_special(req)) |
2192 | /* | 2191 | /* |
2193 | * Release host when there are no more requests | 2192 | * Release host when there are no more requests |
2194 | * and after special request(discard, flush) is done. | 2193 | * and after special request(discard, flush) is done. |
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index 6f4323c6d653..c2d5f6f35145 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c | |||
@@ -33,7 +33,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req) | |||
33 | /* | 33 | /* |
34 | * We only like normal block requests and discards. | 34 | * We only like normal block requests and discards. |
35 | */ | 35 | */ |
36 | if (req->cmd_type != REQ_TYPE_FS && !(req->cmd_flags & REQ_DISCARD)) { | 36 | if (req->cmd_type != REQ_TYPE_FS && req_op(req) != REQ_OP_DISCARD) { |
37 | blk_dump_rq_flags(req, "MMC bad request"); | 37 | blk_dump_rq_flags(req, "MMC bad request"); |
38 | return BLKPREP_KILL; | 38 | return BLKPREP_KILL; |
39 | } | 39 | } |
@@ -56,7 +56,6 @@ static int mmc_queue_thread(void *d) | |||
56 | down(&mq->thread_sem); | 56 | down(&mq->thread_sem); |
57 | do { | 57 | do { |
58 | struct request *req = NULL; | 58 | struct request *req = NULL; |
59 | unsigned int cmd_flags = 0; | ||
60 | 59 | ||
61 | spin_lock_irq(q->queue_lock); | 60 | spin_lock_irq(q->queue_lock); |
62 | set_current_state(TASK_INTERRUPTIBLE); | 61 | set_current_state(TASK_INTERRUPTIBLE); |
@@ -66,7 +65,6 @@ static int mmc_queue_thread(void *d) | |||
66 | 65 | ||
67 | if (req || mq->mqrq_prev->req) { | 66 | if (req || mq->mqrq_prev->req) { |
68 | set_current_state(TASK_RUNNING); | 67 | set_current_state(TASK_RUNNING); |
69 | cmd_flags = req ? req->cmd_flags : 0; | ||
70 | mq->issue_fn(mq, req); | 68 | mq->issue_fn(mq, req); |
71 | cond_resched(); | 69 | cond_resched(); |
72 | if (mq->flags & MMC_QUEUE_NEW_REQUEST) { | 70 | if (mq->flags & MMC_QUEUE_NEW_REQUEST) { |
@@ -81,7 +79,7 @@ static int mmc_queue_thread(void *d) | |||
81 | * has been finished. Do not assign it to previous | 79 | * has been finished. Do not assign it to previous |
82 | * request. | 80 | * request. |
83 | */ | 81 | */ |
84 | if (cmd_flags & MMC_REQ_SPECIAL_MASK) | 82 | if (mmc_req_is_special(req)) |
85 | mq->mqrq_cur->req = NULL; | 83 | mq->mqrq_cur->req = NULL; |
86 | 84 | ||
87 | mq->mqrq_prev->brq.mrq.data = NULL; | 85 | mq->mqrq_prev->brq.mrq.data = NULL; |
diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h index 36cddab57d77..9fb26f20a44d 100644 --- a/drivers/mmc/card/queue.h +++ b/drivers/mmc/card/queue.h | |||
@@ -1,7 +1,10 @@ | |||
1 | #ifndef MMC_QUEUE_H | 1 | #ifndef MMC_QUEUE_H |
2 | #define MMC_QUEUE_H | 2 | #define MMC_QUEUE_H |
3 | 3 | ||
4 | #define MMC_REQ_SPECIAL_MASK (REQ_DISCARD | REQ_FLUSH) | 4 | static inline bool mmc_req_is_special(struct request *req) |
5 | { | ||
6 | return req && (req->cmd_flags & REQ_FLUSH || req_op(req) == REQ_OP_DISCARD); | ||
7 | } | ||
5 | 8 | ||
6 | struct request; | 9 | struct request; |
7 | struct task_struct; | 10 | struct task_struct; |
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 74ae24364a8d..4eb9a5fb151c 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c | |||
@@ -94,7 +94,7 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr, | |||
94 | get_capacity(req->rq_disk)) | 94 | get_capacity(req->rq_disk)) |
95 | return -EIO; | 95 | return -EIO; |
96 | 96 | ||
97 | if (req->cmd_flags & REQ_DISCARD) | 97 | if (req_op(req) == REQ_OP_DISCARD) |
98 | return tr->discard(dev, block, nsect); | 98 | return tr->discard(dev, block, nsect); |
99 | 99 | ||
100 | if (rq_data_dir(req) == READ) { | 100 | if (rq_data_dir(req) == READ) { |
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 1a51584a382b..089b8b8aad4f 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
@@ -292,7 +292,7 @@ int nvme_setup_cmd(struct nvme_ns *ns, struct request *req, | |||
292 | memcpy(cmd, req->cmd, sizeof(*cmd)); | 292 | memcpy(cmd, req->cmd, sizeof(*cmd)); |
293 | else if (req->cmd_flags & REQ_FLUSH) | 293 | else if (req->cmd_flags & REQ_FLUSH) |
294 | nvme_setup_flush(ns, cmd); | 294 | nvme_setup_flush(ns, cmd); |
295 | else if (req->cmd_flags & REQ_DISCARD) | 295 | else if (req_op(req) == REQ_OP_DISCARD) |
296 | ret = nvme_setup_discard(ns, req, cmd); | 296 | ret = nvme_setup_discard(ns, req, cmd); |
297 | else | 297 | else |
298 | nvme_setup_rw(ns, req, cmd); | 298 | nvme_setup_rw(ns, req, cmd); |
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 1daa0482de0e..4d196d2d57da 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h | |||
@@ -177,7 +177,7 @@ static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector) | |||
177 | 177 | ||
178 | static inline unsigned nvme_map_len(struct request *rq) | 178 | static inline unsigned nvme_map_len(struct request *rq) |
179 | { | 179 | { |
180 | if (rq->cmd_flags & REQ_DISCARD) | 180 | if (req_op(rq) == REQ_OP_DISCARD) |
181 | return sizeof(struct nvme_dsm_range); | 181 | return sizeof(struct nvme_dsm_range); |
182 | else | 182 | else |
183 | return blk_rq_bytes(rq); | 183 | return blk_rq_bytes(rq); |
@@ -185,7 +185,7 @@ static inline unsigned nvme_map_len(struct request *rq) | |||
185 | 185 | ||
186 | static inline void nvme_cleanup_cmd(struct request *req) | 186 | static inline void nvme_cleanup_cmd(struct request *req) |
187 | { | 187 | { |
188 | if (req->cmd_flags & REQ_DISCARD) | 188 | if (req_op(req) == REQ_OP_DISCARD) |
189 | kfree(req->completion_data); | 189 | kfree(req->completion_data); |
190 | } | 190 | } |
191 | 191 | ||
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index f459dff30512..c8dc2217d386 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1012,7 +1012,8 @@ static int sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt) | |||
1012 | } else if (rq_data_dir(rq) == READ) { | 1012 | } else if (rq_data_dir(rq) == READ) { |
1013 | SCpnt->cmnd[0] = READ_6; | 1013 | SCpnt->cmnd[0] = READ_6; |
1014 | } else { | 1014 | } else { |
1015 | scmd_printk(KERN_ERR, SCpnt, "Unknown command %llx\n", (unsigned long long) rq->cmd_flags); | 1015 | scmd_printk(KERN_ERR, SCpnt, "Unknown command %d,%llx\n", |
1016 | req_op(rq), (unsigned long long) rq->cmd_flags); | ||
1016 | goto out; | 1017 | goto out; |
1017 | } | 1018 | } |
1018 | 1019 | ||
@@ -1137,21 +1138,27 @@ static int sd_init_command(struct scsi_cmnd *cmd) | |||
1137 | { | 1138 | { |
1138 | struct request *rq = cmd->request; | 1139 | struct request *rq = cmd->request; |
1139 | 1140 | ||
1140 | if (rq->cmd_flags & REQ_DISCARD) | 1141 | switch (req_op(rq)) { |
1142 | case REQ_OP_DISCARD: | ||
1141 | return sd_setup_discard_cmnd(cmd); | 1143 | return sd_setup_discard_cmnd(cmd); |
1142 | else if (rq->cmd_flags & REQ_WRITE_SAME) | 1144 | case REQ_OP_WRITE_SAME: |
1143 | return sd_setup_write_same_cmnd(cmd); | 1145 | return sd_setup_write_same_cmnd(cmd); |
1144 | else if (rq->cmd_flags & REQ_FLUSH) | 1146 | case REQ_OP_READ: |
1145 | return sd_setup_flush_cmnd(cmd); | 1147 | case REQ_OP_WRITE: |
1146 | else | 1148 | if (rq->cmd_flags & REQ_FLUSH) |
1147 | return sd_setup_read_write_cmnd(cmd); | 1149 | return sd_setup_flush_cmnd(cmd); |
1150 | else | ||
1151 | return sd_setup_read_write_cmnd(cmd); | ||
1152 | default: | ||
1153 | BUG(); | ||
1154 | } | ||
1148 | } | 1155 | } |
1149 | 1156 | ||
1150 | static void sd_uninit_command(struct scsi_cmnd *SCpnt) | 1157 | static void sd_uninit_command(struct scsi_cmnd *SCpnt) |
1151 | { | 1158 | { |
1152 | struct request *rq = SCpnt->request; | 1159 | struct request *rq = SCpnt->request; |
1153 | 1160 | ||
1154 | if (rq->cmd_flags & REQ_DISCARD) | 1161 | if (req_op(rq) == REQ_OP_DISCARD) |
1155 | __free_page(rq->completion_data); | 1162 | __free_page(rq->completion_data); |
1156 | 1163 | ||
1157 | if (SCpnt->cmnd != rq->cmd) { | 1164 | if (SCpnt->cmnd != rq->cmd) { |
@@ -1774,7 +1781,7 @@ static int sd_done(struct scsi_cmnd *SCpnt) | |||
1774 | unsigned char op = SCpnt->cmnd[0]; | 1781 | unsigned char op = SCpnt->cmnd[0]; |
1775 | unsigned char unmap = SCpnt->cmnd[1] & 8; | 1782 | unsigned char unmap = SCpnt->cmnd[1] & 8; |
1776 | 1783 | ||
1777 | if (req->cmd_flags & REQ_DISCARD || req->cmd_flags & REQ_WRITE_SAME) { | 1784 | if (req_op(req) == REQ_OP_DISCARD || req_op(req) == REQ_OP_WRITE_SAME) { |
1778 | if (!result) { | 1785 | if (!result) { |
1779 | good_bytes = blk_rq_bytes(req); | 1786 | good_bytes = blk_rq_bytes(req); |
1780 | scsi_set_resid(SCpnt, 0); | 1787 | scsi_set_resid(SCpnt, 0); |