Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ide: don't use req->special

Just replace it with a field of the same name in struct ide_req.

Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
22ce0a7c 289d088b

+31 -26
+2 -2
drivers/ide/ide-atapi.c
··· 94 94 95 95 rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); 96 96 ide_req(rq)->type = ATA_PRIV_MISC; 97 - rq->special = (char *)pc; 97 + ide_req(rq)->special = pc; 98 98 99 99 if (buf && bufflen) { 100 100 error = blk_rq_map_kern(drive->queue, rq, buf, bufflen, ··· 244 244 return -ENOMEM; 245 245 } 246 246 247 - sense_rq->special = special; 247 + ide_req(sense_rq)->special = special; 248 248 drive->sense_rq_armed = false; 249 249 250 250 drive->hwif->rq = NULL;
+2 -2
drivers/ide/ide-cd.c
··· 211 211 static void ide_cd_complete_failed_rq(ide_drive_t *drive, struct request *rq) 212 212 { 213 213 /* 214 - * For ATA_PRIV_SENSE, "rq->special" points to the original 214 + * For ATA_PRIV_SENSE, "ide_req(rq)->special" points to the original 215 215 * failed request. Also, the sense data should be read 216 216 * directly from rq which might be different from the original 217 217 * sense buffer if it got copied during mapping. 218 218 */ 219 - struct request *failed = (struct request *)rq->special; 219 + struct request *failed = ide_req(rq)->special; 220 220 void *sense = bio_data(rq->bio); 221 221 222 222 if (failed) {
+2 -2
drivers/ide/ide-devsets.c
··· 171 171 scsi_req(rq)->cmd_len = 5; 172 172 scsi_req(rq)->cmd[0] = REQ_DEVSET_EXEC; 173 173 *(int *)&scsi_req(rq)->cmd[1] = arg; 174 - rq->special = setting->set; 174 + ide_req(rq)->special = setting->set; 175 175 176 176 blk_execute_rq(q, NULL, rq, 0); 177 177 ret = scsi_req(rq)->result; ··· 182 182 183 183 ide_startstop_t ide_do_devset(ide_drive_t *drive, struct request *rq) 184 184 { 185 - int err, (*setfunc)(ide_drive_t *, int) = rq->special; 185 + int err, (*setfunc)(ide_drive_t *, int) = ide_req(rq)->special; 186 186 187 187 err = setfunc(drive, *(int *)&scsi_req(rq)->cmd[1]); 188 188 if (err)
+3 -3
drivers/ide/ide-disk.c
··· 434 434 if (req_op(rq) != REQ_OP_FLUSH) 435 435 return true; 436 436 437 - if (rq->special) { 438 - cmd = rq->special; 437 + if (ide_req(rq)->special) { 438 + cmd = ide_req(rq)->special; 439 439 memset(cmd, 0, sizeof(*cmd)); 440 440 } else { 441 441 cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); ··· 455 455 rq->cmd_flags &= ~REQ_OP_MASK; 456 456 rq->cmd_flags |= REQ_OP_DRV_OUT; 457 457 ide_req(rq)->type = ATA_PRIV_TASKFILE; 458 - rq->special = cmd; 458 + ide_req(rq)->special = cmd; 459 459 cmd->rq = rq; 460 460 461 461 return true;
+1 -1
drivers/ide/ide-eh.c
··· 125 125 /* retry only "normal" I/O: */ 126 126 if (blk_rq_is_passthrough(rq)) { 127 127 if (ata_taskfile_request(rq)) { 128 - struct ide_cmd *cmd = rq->special; 128 + struct ide_cmd *cmd = ide_req(rq)->special; 129 129 130 130 if (cmd) 131 131 ide_complete_cmd(drive, cmd, stat, err);
+1 -1
drivers/ide/ide-floppy.c
··· 276 276 switch (ide_req(rq)->type) { 277 277 case ATA_PRIV_MISC: 278 278 case ATA_PRIV_SENSE: 279 - pc = (struct ide_atapi_pc *)rq->special; 279 + pc = (struct ide_atapi_pc *)ide_req(rq)->special; 280 280 break; 281 281 default: 282 282 BUG();
+9 -5
drivers/ide/ide-io.c
··· 111 111 } 112 112 113 113 if (rq && ata_taskfile_request(rq)) { 114 - struct ide_cmd *orig_cmd = rq->special; 114 + struct ide_cmd *orig_cmd = ide_req(rq)->special; 115 115 116 116 if (cmd->tf_flags & IDE_TFLAG_DYN) 117 117 kfree(orig_cmd); ··· 261 261 static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, 262 262 struct request *rq) 263 263 { 264 - struct ide_cmd *cmd = rq->special; 264 + struct ide_cmd *cmd = ide_req(rq)->special; 265 265 266 266 if (cmd) { 267 267 if (cmd->protocol == ATA_PROT_PIO) { ··· 352 352 if (ata_taskfile_request(rq)) 353 353 return execute_drive_cmd(drive, rq); 354 354 else if (ata_pm_request(rq)) { 355 - struct ide_pm_state *pm = rq->special; 355 + struct ide_pm_state *pm = ide_req(rq)->special; 356 356 #ifdef DEBUG_PM 357 357 printk("%s: start_power_step(step: %d)\n", 358 358 drive->name, pm->pm_step); ··· 460 460 ide_drive_t *drive = hctx->queue->queuedata; 461 461 ide_hwif_t *hwif = drive->hwif; 462 462 struct ide_host *host = hwif->host; 463 - struct request *rq = NULL; 463 + struct request *rq = bd->rq; 464 464 ide_startstop_t startstop; 465 + 466 + if (!(rq->rq_flags & RQF_DONTPREP)) { 467 + rq->rq_flags |= RQF_DONTPREP; 468 + ide_req(rq)->special = NULL; 469 + } 465 470 466 471 /* HLD do_request() callback might sleep, make sure it's okay */ 467 472 might_sleep(); ··· 474 469 if (ide_lock_host(host, hwif)) 475 470 return BLK_STS_DEV_RESOURCE; 476 471 477 - rq = bd->rq; 478 472 blk_mq_start_request(rq); 479 473 480 474 spin_lock_irq(&hwif->lock);
+2 -2
drivers/ide/ide-park.c
··· 36 36 scsi_req(rq)->cmd[0] = REQ_PARK_HEADS; 37 37 scsi_req(rq)->cmd_len = 1; 38 38 ide_req(rq)->type = ATA_PRIV_MISC; 39 - rq->special = &timeout; 39 + ide_req(rq)->special = &timeout; 40 40 blk_execute_rq(q, NULL, rq, 1); 41 41 rc = scsi_req(rq)->result ? -EIO : 0; 42 42 blk_put_request(rq); ··· 67 67 68 68 memset(&cmd, 0, sizeof(cmd)); 69 69 if (scsi_req(rq)->cmd[0] == REQ_PARK_HEADS) { 70 - drive->sleep = *(unsigned long *)rq->special; 70 + drive->sleep = *(unsigned long *)ide_req(rq)->special; 71 71 drive->dev_flags |= IDE_DFLAG_SLEEPING; 72 72 tf->command = ATA_CMD_IDLEIMMEDIATE; 73 73 tf->feature = 0x44;
+6 -6
drivers/ide/ide-pm.c
··· 21 21 memset(&rqpm, 0, sizeof(rqpm)); 22 22 rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); 23 23 ide_req(rq)->type = ATA_PRIV_PM_SUSPEND; 24 - rq->special = &rqpm; 24 + ide_req(rq)->special = &rqpm; 25 25 rqpm.pm_step = IDE_PM_START_SUSPEND; 26 26 if (mesg.event == PM_EVENT_PRETHAW) 27 27 mesg.event = PM_EVENT_FREEZE; ··· 82 82 memset(&rqpm, 0, sizeof(rqpm)); 83 83 rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, BLK_MQ_REQ_PREEMPT); 84 84 ide_req(rq)->type = ATA_PRIV_PM_RESUME; 85 - rq->special = &rqpm; 85 + ide_req(rq)->special = &rqpm; 86 86 rqpm.pm_step = IDE_PM_START_RESUME; 87 87 rqpm.pm_state = PM_EVENT_ON; 88 88 ··· 101 101 102 102 void ide_complete_power_step(ide_drive_t *drive, struct request *rq) 103 103 { 104 - struct ide_pm_state *pm = rq->special; 104 + struct ide_pm_state *pm = ide_req(rq)->special; 105 105 106 106 #ifdef DEBUG_PM 107 107 printk(KERN_INFO "%s: complete_power_step(step: %d)\n", ··· 131 131 132 132 ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq) 133 133 { 134 - struct ide_pm_state *pm = rq->special; 134 + struct ide_pm_state *pm = ide_req(rq)->special; 135 135 struct ide_cmd cmd = { }; 136 136 137 137 switch (pm->pm_step) { ··· 203 203 void ide_complete_pm_rq(ide_drive_t *drive, struct request *rq) 204 204 { 205 205 struct request_queue *q = drive->queue; 206 - struct ide_pm_state *pm = rq->special; 206 + struct ide_pm_state *pm = ide_req(rq)->special; 207 207 unsigned long flags; 208 208 209 209 ide_complete_power_step(drive, rq); ··· 228 228 229 229 void ide_check_pm_state(ide_drive_t *drive, struct request *rq) 230 230 { 231 - struct ide_pm_state *pm = rq->special; 231 + struct ide_pm_state *pm = ide_req(rq)->special; 232 232 233 233 if (blk_rq_is_private(rq) && 234 234 ide_req(rq)->type == ATA_PRIV_PM_SUSPEND &&
+1 -1
drivers/ide/ide-tape.c
··· 639 639 goto out; 640 640 } 641 641 if (req->cmd[13] & REQ_IDETAPE_PC1) { 642 - pc = (struct ide_atapi_pc *)rq->special; 642 + pc = (struct ide_atapi_pc *)ide_req(rq)->special; 643 643 req->cmd[13] &= ~(REQ_IDETAPE_PC1); 644 644 req->cmd[13] |= REQ_IDETAPE_PC2; 645 645 goto out;
+1 -1
drivers/ide/ide-taskfile.c
··· 440 440 goto put_req; 441 441 } 442 442 443 - rq->special = cmd; 443 + ide_req(rq)->special = cmd; 444 444 cmd->rq = rq; 445 445 446 446 blk_execute_rq(drive->queue, NULL, rq, 0);
+1
include/linux/ide.h
··· 50 50 struct scsi_request sreq; 51 51 u8 sense[SCSI_SENSE_BUFFERSIZE]; 52 52 u8 type; 53 + void *special; 53 54 }; 54 55 55 56 static inline struct ide_request *ide_req(struct request *rq)