hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/ide/ide-disk.c
....@@ -427,16 +427,15 @@
427427 drive->dev_flags |= IDE_DFLAG_NOHPA; /* disable HPA on resume */
428428 }
429429
430
-static int idedisk_prep_fn(struct request_queue *q, struct request *rq)
430
+static bool idedisk_prep_rq(ide_drive_t *drive, struct request *rq)
431431 {
432
- ide_drive_t *drive = q->queuedata;
433432 struct ide_cmd *cmd;
434433
435434 if (req_op(rq) != REQ_OP_FLUSH)
436
- return BLKPREP_OK;
435
+ return true;
437436
438
- if (rq->special) {
439
- cmd = rq->special;
437
+ if (ide_req(rq)->special) {
438
+ cmd = ide_req(rq)->special;
440439 memset(cmd, 0, sizeof(*cmd));
441440 } else {
442441 cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC);
....@@ -456,10 +455,10 @@
456455 rq->cmd_flags &= ~REQ_OP_MASK;
457456 rq->cmd_flags |= REQ_OP_DRV_OUT;
458457 ide_req(rq)->type = ATA_PRIV_TASKFILE;
459
- rq->special = cmd;
458
+ ide_req(rq)->special = cmd;
460459 cmd->rq = rq;
461460
462
- return BLKPREP_OK;
461
+ return true;
463462 }
464463
465464 ide_devset_get(multcount, mult_count);
....@@ -548,7 +547,7 @@
548547
549548 if (barrier) {
550549 wc = true;
551
- blk_queue_prep_rq(drive->queue, idedisk_prep_fn);
550
+ drive->prep_rq = idedisk_prep_rq;
552551 }
553552 }
554553
....@@ -740,12 +739,9 @@
740739 set_wcache(drive, 1);
741740
742741 if ((drive->dev_flags & IDE_DFLAG_LBA) == 0 &&
743
- (drive->head == 0 || drive->head > 16)) {
742
+ (drive->head == 0 || drive->head > 16))
744743 printk(KERN_ERR "%s: invalid geometry: %d physical heads?\n",
745744 drive->name, drive->head);
746
- drive->dev_flags &= ~IDE_DFLAG_ATTACH;
747
- } else
748
- drive->dev_flags |= IDE_DFLAG_ATTACH;
749745 }
750746
751747 static void ide_disk_flush(ide_drive_t *drive)
....@@ -795,4 +791,5 @@
795791 .set_doorlock = ide_disk_set_doorlock,
796792 .do_request = ide_do_rw_disk,
797793 .ioctl = ide_disk_ioctl,
794
+ .compat_ioctl = ide_disk_ioctl,
798795 };