Skip to content

Commit

Permalink
block: add large command support
Browse files Browse the repository at this point in the history
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: FUJITA Tomonori <[email protected]>
Cc: Jens Axboe <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
fujita authored and Jens Axboe committed Apr 29, 2008
1 parent d34c87e commit d7e3c32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ void blk_rq_init(struct request_queue *q, struct request *rq)
rq->sector = rq->hard_sector = (sector_t) -1;
INIT_HLIST_NODE(&rq->hash);
RB_CLEAR_NODE(&rq->rb_node);
rq->cmd = rq->__cmd;
rq->tag = -1;
rq->ref_count = 1;
}
Expand Down
5 changes: 3 additions & 2 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@ struct request {
/*
* when request is used as a packet command carrier
*/
unsigned int cmd_len;
unsigned char cmd[BLK_MAX_CDB];
unsigned short cmd_len;
unsigned char __cmd[BLK_MAX_CDB];
unsigned char *cmd;

unsigned int data_len;
unsigned int extra_len; /* length of alignment and padding */
Expand Down

0 comments on commit d7e3c32

Please sign in to comment.