Commit d7e3c324 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Jens Axboe

block: add large command support

This patch changes rq->cmd from the static array to a pointer to
support large commands.

We rarely handle large commands. So for optimization, a struct request
still has a static array for a command. rq_init sets rq->cmd pointer
to the static array.
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent d34c87e4
...@@ -117,6 +117,7 @@ void blk_rq_init(struct request_queue *q, struct request *rq) ...@@ -117,6 +117,7 @@ void blk_rq_init(struct request_queue *q, struct request *rq)
rq->sector = rq->hard_sector = (sector_t) -1; rq->sector = rq->hard_sector = (sector_t) -1;
INIT_HLIST_NODE(&rq->hash); INIT_HLIST_NODE(&rq->hash);
RB_CLEAR_NODE(&rq->rb_node); RB_CLEAR_NODE(&rq->rb_node);
rq->cmd = rq->__cmd;
rq->tag = -1; rq->tag = -1;
rq->ref_count = 1; rq->ref_count = 1;
} }
......
...@@ -215,8 +215,9 @@ struct request { ...@@ -215,8 +215,9 @@ struct request {
/* /*
* when request is used as a packet command carrier * when request is used as a packet command carrier
*/ */
unsigned int cmd_len; unsigned short cmd_len;
unsigned char cmd[BLK_MAX_CDB]; unsigned char __cmd[BLK_MAX_CDB];
unsigned char *cmd;
unsigned int data_len; unsigned int data_len;
unsigned int extra_len; /* length of alignment and padding */ unsigned int extra_len; /* length of alignment and padding */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment