drivers: use req op accessor
[cascardo/linux.git] / drivers / nvme / host / nvme.h
index 114b928..4d196d2 100644 (file)
@@ -72,6 +72,7 @@ enum nvme_ctrl_state {
        NVME_CTRL_LIVE,
        NVME_CTRL_RESETTING,
        NVME_CTRL_DELETING,
+       NVME_CTRL_DEAD,
 };
 
 struct nvme_ctrl {
@@ -176,7 +177,7 @@ static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector)
 
 static inline unsigned nvme_map_len(struct request *rq)
 {
-       if (rq->cmd_flags & REQ_DISCARD)
+       if (req_op(rq) == REQ_OP_DISCARD)
                return sizeof(struct nvme_dsm_range);
        else
                return blk_rq_bytes(rq);
@@ -184,7 +185,7 @@ static inline unsigned nvme_map_len(struct request *rq)
 
 static inline void nvme_cleanup_cmd(struct request *req)
 {
-       if (req->cmd_flags & REQ_DISCARD)
+       if (req_op(req) == REQ_OP_DISCARD)
                kfree(req->completion_data);
 }