提交 b42171ef 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

block: move REQ_TYPE_ATA_TASKFILE and REQ_TYPE_ATA_PC to ide.h

These values are only used by the IDE driver, so move them into it
by allowing drivers to take cmd_type values after the first private
one.  Note that we have to turn cmd_type into a plain unsigned integer
so that gcc doesn't complain about mismatching enum types.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 4f8c9510
...@@ -79,14 +79,7 @@ enum rq_cmd_type_bits { ...@@ -79,14 +79,7 @@ enum rq_cmd_type_bits {
REQ_TYPE_PM_SUSPEND, /* suspend request */ REQ_TYPE_PM_SUSPEND, /* suspend request */
REQ_TYPE_PM_RESUME, /* resume request */ REQ_TYPE_PM_RESUME, /* resume request */
REQ_TYPE_PM_SHUTDOWN, /* shutdown request */ REQ_TYPE_PM_SHUTDOWN, /* shutdown request */
REQ_TYPE_DRV_PRIV, /* driver defined type */ REQ_TYPE_DRV_PRIV, /* driver defined types from here */
/*
* for ATA/ATAPI devices. this really doesn't belong here, ide should
* use REQ_TYPE_DRV_PRIV and use rq->cmd[0] with the range of driver
* private REQ_LB opcodes to differentiate what type of request this is
*/
REQ_TYPE_ATA_TASKFILE,
REQ_TYPE_ATA_PC,
}; };
#define BLK_MAX_CDB 16 #define BLK_MAX_CDB 16
...@@ -108,7 +101,7 @@ struct request { ...@@ -108,7 +101,7 @@ struct request {
struct blk_mq_ctx *mq_ctx; struct blk_mq_ctx *mq_ctx;
u64 cmd_flags; u64 cmd_flags;
enum rq_cmd_type_bits cmd_type; unsigned cmd_type;
unsigned long atomic_flags; unsigned long atomic_flags;
int cpu; int cpu;
......
...@@ -39,6 +39,12 @@ ...@@ -39,6 +39,12 @@
struct device; struct device;
/* IDE-specific values for req->cmd_type */
enum ata_cmd_type_bits {
REQ_TYPE_ATA_TASKFILE = REQ_TYPE_DRV_PRIV + 1,
REQ_TYPE_ATA_PC,
};
/* Error codes returned in rq->errors to the higher part of the driver. */ /* Error codes returned in rq->errors to the higher part of the driver. */
enum { enum {
IDE_DRV_ERROR_GENERAL = 101, IDE_DRV_ERROR_GENERAL = 101,
...@@ -1551,4 +1557,5 @@ static inline void ide_set_drivedata(ide_drive_t *drive, void *data) ...@@ -1551,4 +1557,5 @@ static inline void ide_set_drivedata(ide_drive_t *drive, void *data)
#define ide_host_for_each_port(i, port, host) \ #define ide_host_for_each_port(i, port, host) \
for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++) for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++)
#endif /* _IDE_H */ #endif /* _IDE_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册