Skip to content

Commit c267cc1

Browse files
committed
ide-atapi: don't abuse rq->buffer
Impact: rq->buffer usage cleanup ide-atapi uses rq->buffer as private opaque value for internal special requests. rq->special isn't used for these cases (the only case where rq->special is used is for ide-tape rw requests). Use rq->special instead. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Jens Axboe <axboe@kernel.dk>
1 parent eace4cb commit c267cc1

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/ide/ide-atapi.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void ide_queue_pc_head(ide_drive_t *drive, struct gendisk *disk,
9090
blk_rq_init(NULL, rq);
9191
rq->cmd_type = REQ_TYPE_SPECIAL;
9292
rq->cmd_flags |= REQ_PREEMPT;
93-
rq->buffer = (char *)pc;
93+
rq->special = (char *)pc;
9494
rq->rq_disk = disk;
9595

9696
if (pc->req_xfer) {
@@ -119,7 +119,7 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
119119

120120
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
121121
rq->cmd_type = REQ_TYPE_SPECIAL;
122-
rq->buffer = (char *)pc;
122+
rq->special = (char *)pc;
123123

124124
if (pc->req_xfer) {
125125
rq->data = pc->buf;

‎drivers/ide/ide-floppy.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
264264
pc = &floppy->queued_pc;
265265
idefloppy_create_rw_cmd(drive, pc, rq, (unsigned long)block);
266266
} else if (blk_special_request(rq)) {
267-
pc = (struct ide_atapi_pc *) rq->buffer;
267+
pc = (struct ide_atapi_pc *)rq->special;
268268
} else if (blk_pc_request(rq)) {
269269
pc = &floppy->queued_pc;
270270
idefloppy_blockpc_cmd(floppy, pc, rq);

‎drivers/ide/ide-tape.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
828828
goto out;
829829
}
830830
if (rq->cmd[13] & REQ_IDETAPE_PC1) {
831-
pc = (struct ide_atapi_pc *) rq->buffer;
831+
pc = (struct ide_atapi_pc *)rq->special;
832832
rq->cmd[13] &= ~(REQ_IDETAPE_PC1);
833833
rq->cmd[13] |= REQ_IDETAPE_PC2;
834834
goto out;

0 commit comments

Comments
 (0)