drivers: use req op accessor
[cascardo/linux.git] / drivers / block / nbd.c
index 31e73a7..6c2c28d 100644 (file)
@@ -282,7 +282,7 @@ static int nbd_send_req(struct nbd_device *nbd, struct request *req)
 
        if (req->cmd_type == REQ_TYPE_DRV_PRIV)
                type = NBD_CMD_DISC;
-       else if (req->cmd_flags & REQ_DISCARD)
+       else if (req_op(req) == REQ_OP_DISCARD)
                type = NBD_CMD_TRIM;
        else if (req->cmd_flags & REQ_FLUSH)
                type = NBD_CMD_FLUSH;