summaryrefslogtreecommitdiffstats
path: root/drivers/block/xen-blkfront.c
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2016-06-05 14:32:17 -0500
committerJens Axboe <axboe@fb.com>2016-06-07 13:41:38 -0600
commitc2df40dfb8c015211ec55f4b1dd0587f875c7b34 (patch)
tree8660ea8a2a00b0248fa609e7e6b737a8d92306d9 /drivers/block/xen-blkfront.c
parentd9d8c5c489f4969667a05727e9c2c4f78cffef1a (diff)
downloadop-kernel-dev-c2df40dfb8c015211ec55f4b1dd0587f875c7b34.zip
op-kernel-dev-c2df40dfb8c015211ec55f4b1dd0587f875c7b34.tar.gz
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>
Diffstat (limited to 'drivers/block/xen-blkfront.c')
-rw-r--r--drivers/block/xen-blkfront.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 52963a2..6fd1601 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
if (unlikely(rinfo->dev_info->connected != BLKIF_STATE_CONNECTED))
return 1;
- if (unlikely(req->cmd_flags & (REQ_DISCARD | REQ_SECURE)))
+ if (unlikely(req_op(req) == REQ_OP_DISCARD ||
+ req->cmd_flags & REQ_SECURE))
return blkif_queue_discard_req(req, rinfo);
else
return blkif_queue_rw_req(req, rinfo);
@@ -2054,8 +2055,9 @@ static int blkif_recover(struct blkfront_info *info)
/*
* Get the bios in the request so we can re-queue them.
*/
- if (copy[i].request->cmd_flags &
- (REQ_FLUSH | REQ_FUA | REQ_DISCARD | REQ_SECURE)) {
+ if (copy[i].request->cmd_flags & REQ_FLUSH ||
+ req_op(copy[i].request) == REQ_OP_DISCARD ||
+ copy[i].request->cmd_flags & (REQ_FUA | REQ_SECURE)) {
/*
* Flush operations don't contain bios, so
* we need to requeue the whole request
OpenPOWER on IntegriCloud