Skip to content

Commit d85cb20

Browse files
Christoph Hellwigaxboe
authored andcommitted
mtip32xx: don't use req->special
Instead create add to the icmd into struct mtip_cmd which can be unioned with the scatterlist used for the normal I/O path. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 55c7bc3 commit d85cb20

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

drivers/block/mtip32xx/mtip32xx.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -997,8 +997,6 @@ static int mtip_exec_internal_command(struct mtip_port *port,
997997
return -EFAULT;
998998
}
999999

1000-
rq->special = &icmd;
1001-
10021000
set_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
10031001

10041002
if (fis->command == ATA_CMD_SEC_ERASE_PREP)
@@ -1019,6 +1017,7 @@ static int mtip_exec_internal_command(struct mtip_port *port,
10191017

10201018
/* Copy the command to the command table */
10211019
int_cmd = blk_mq_rq_to_pdu(rq);
1020+
int_cmd->icmd = &icmd;
10221021
memcpy(int_cmd->command, fis, fis_len*4);
10231022

10241023
rq->timeout = timeout;
@@ -3548,8 +3547,8 @@ static blk_status_t mtip_issue_reserved_cmd(struct blk_mq_hw_ctx *hctx,
35483547
struct request *rq)
35493548
{
35503549
struct driver_data *dd = hctx->queue->queuedata;
3551-
struct mtip_int_cmd *icmd = rq->special;
35523550
struct mtip_cmd *cmd = blk_mq_rq_to_pdu(rq);
3551+
struct mtip_int_cmd *icmd = cmd->icmd;
35533552
struct mtip_cmd_hdr *hdr =
35543553
dd->port->command_list + sizeof(struct mtip_cmd_hdr) * rq->tag;
35553554
struct mtip_cmd_sg *command_sg;

drivers/block/mtip32xx/mtip32xx.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ struct mtip_cmd_sg {
321321
};
322322
struct mtip_port;
323323

324+
struct mtip_int_cmd;
325+
324326
/* Structure used to describe a command. */
325327
struct mtip_cmd {
326328
void *command; /* ptr to command table entry */
@@ -331,7 +333,10 @@ struct mtip_cmd {
331333

332334
int unaligned; /* command is unaligned on 4k boundary */
333335

334-
struct scatterlist sg[MTIP_MAX_SG]; /* Scatter list entries */
336+
union {
337+
struct scatterlist sg[MTIP_MAX_SG]; /* Scatter list entries */
338+
struct mtip_int_cmd *icmd;
339+
};
335340

336341
int retries; /* The number of retries left for this command. */
337342

0 commit comments

Comments
 (0)