Lines Matching refs:rq

57 int ide_end_rq(ide_drive_t *drive, struct request *rq, int error,
70 return blk_end_request(rq, error, nr_bytes);
78 struct request *rq = cmd->rq;
105 if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
106 struct ide_cmd *orig_cmd = rq->special;
118 struct request *rq = hwif->rq;
125 if (blk_noretry_request(rq) && error <= 0)
126 nr_bytes = blk_rq_sectors(rq) << 9;
128 rc = ide_end_rq(drive, rq, error, nr_bytes);
130 hwif->rq = NULL;
136 void ide_kill_rq(ide_drive_t *drive, struct request *rq)
138 u8 drv_req = (rq->cmd_type == REQ_TYPE_SPECIAL) && rq->rq_disk;
144 rq->errors = 0;
147 rq->errors = IDE_DRV_ERROR_GENERAL;
148 else if (rq->cmd_type != REQ_TYPE_FS && rq->errors == 0)
149 rq->errors = -EIO;
152 ide_complete_rq(drive, -EIO, blk_rq_bytes(rq));
227 struct request *rq = cmd->rq;
229 cmd->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
244 * @rq: the request structure holding the command
254 struct request *rq)
256 struct ide_cmd *cmd = rq->special;
260 ide_init_sg_cmd(cmd, blk_rq_sectors(rq) << 9);
274 rq->errors = 0;
275 ide_complete_rq(drive, 0, blk_rq_bytes(rq));
280 static ide_startstop_t ide_special_rq(ide_drive_t *drive, struct request *rq)
282 u8 cmd = rq->cmd[0];
287 return ide_do_park_unpark(drive, rq);
289 return ide_do_devset(drive, rq);
306 static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
310 BUG_ON(!(rq->cmd_flags & REQ_STARTED));
314 drive->hwif->name, (unsigned long) rq);
319 rq->cmd_flags |= REQ_FAILED;
323 if (blk_pm_request(rq))
324 ide_check_pm_state(drive, rq);
343 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
344 return execute_drive_cmd(drive, rq);
345 else if (blk_pm_request(rq)) {
346 struct request_pm_state *pm = rq->special;
351 startstop = ide_start_power_step(drive, rq);
354 ide_complete_pm_rq(drive, rq);
356 } else if (!rq->rq_disk && rq->cmd_type == REQ_TYPE_SPECIAL)
365 return ide_special_rq(drive, rq);
367 drv = *(struct ide_driver **)rq->rq_disk->private_data;
369 return drv->do_request(drive, rq, blk_rq_pos(rq));
373 ide_kill_rq(drive, rq);
433 static void __ide_requeue_and_plug(struct request_queue *q, struct request *rq)
435 if (rq)
436 blk_requeue_request(q, rq);
437 if (rq || blk_peek_request(q)) {
443 void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq)
449 __ide_requeue_and_plug(q, rq);
461 struct request *rq = NULL;
478 WARN_ON_ONCE(hwif->rq);
516 if (!rq)
517 rq = blk_fetch_request(drive->queue);
522 if (!rq) {
541 blk_pm_request(rq) == 0 &&
542 (rq->cmd_flags & REQ_PREEMPT) == 0) {
548 hwif->rq = rq;
551 startstop = start_request(drive, rq);
555 rq = hwif->rq;
556 hwif->rq = NULL;
563 if (rq == NULL)
573 __ide_requeue_and_plug(q, rq);
684 rq_in_flight = hwif->rq;
685 hwif->rq = NULL;
861 rq_in_flight = hwif->rq;
862 hwif->rq = NULL;