block: fold cmd_type into the REQ_OP_ space

Instead of keeping two levels of indirection for requests types, fold it
all into the operations.  The little caveat here is that previously
cmd_type only applied to struct request, while the request and bio op
fields were set to plain REQ_OP_READ/WRITE even for passthrough
operations.

Instead this patch adds new REQ_OP_* for SCSI passthrough and driver
private requests, althought it has to add two for each so that we
can communicate the data in/out nature of the request.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
此提交包含在:
Christoph Hellwig
2017-01-31 16:57:31 +01:00
提交者 Jens Axboe
父節點 2f5a8e80f7
當前提交 aebf526b53
共有 53 個檔案被更改,包括 338 行新增326 行删除

查看文件

@@ -303,9 +303,8 @@ int ide_cdrom_reset(struct cdrom_device_info *cdi)
struct request *rq;
int ret;
rq = blk_get_request(drive->queue, READ, __GFP_RECLAIM);
rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM);
scsi_req_init(rq);
rq->cmd_type = REQ_TYPE_DRV_PRIV;
ide_req(rq)->type = ATA_PRIV_MISC;
rq->rq_flags = RQF_QUIET;
ret = blk_execute_rq(drive->queue, cd->disk, rq, 0);