diff options
Diffstat (limited to 'drivers')
32 files changed, 142 insertions, 135 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index ad1d7065a1b2..629c5769d994 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -2991,8 +2991,8 @@ static void do_fd_request(request_queue_t * q) | |||
2991 | if (usage_count == 0) { | 2991 | if (usage_count == 0) { |
2992 | printk("warning: usage count=0, current_req=%p exiting\n", | 2992 | printk("warning: usage count=0, current_req=%p exiting\n", |
2993 | current_req); | 2993 | current_req); |
2994 | printk("sect=%ld flags=%lx\n", (long)current_req->sector, | 2994 | printk("sect=%ld type=%x flags=%x\n", (long)current_req->sector, |
2995 | current_req->flags); | 2995 | current_req->cmd_type, current_req->cmd_flags); |
2996 | return; | 2996 | return; |
2997 | } | 2997 | } |
2998 | if (test_bit(0, &fdc_busy)) { | 2998 | if (test_bit(0, &fdc_busy)) { |
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index bdbade9a5cf5..9d1035e8d9d8 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -407,10 +407,10 @@ static void do_nbd_request(request_queue_t * q) | |||
407 | struct nbd_device *lo; | 407 | struct nbd_device *lo; |
408 | 408 | ||
409 | blkdev_dequeue_request(req); | 409 | blkdev_dequeue_request(req); |
410 | dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%lx)\n", | 410 | dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%x)\n", |
411 | req->rq_disk->disk_name, req, req->flags); | 411 | req->rq_disk->disk_name, req, req->cmd_type); |
412 | 412 | ||
413 | if (!(req->flags & REQ_CMD)) | 413 | if (!blk_fs_request(req)) |
414 | goto error_out; | 414 | goto error_out; |
415 | 415 | ||
416 | lo = req->rq_disk->private_data; | 416 | lo = req->rq_disk->private_data; |
@@ -489,7 +489,7 @@ static int nbd_ioctl(struct inode *inode, struct file *file, | |||
489 | switch (cmd) { | 489 | switch (cmd) { |
490 | case NBD_DISCONNECT: | 490 | case NBD_DISCONNECT: |
491 | printk(KERN_INFO "%s: NBD_DISCONNECT\n", lo->disk->disk_name); | 491 | printk(KERN_INFO "%s: NBD_DISCONNECT\n", lo->disk->disk_name); |
492 | sreq.flags = REQ_SPECIAL; | 492 | sreq.cmd_type = REQ_TYPE_SPECIAL; |
493 | nbd_cmd(&sreq) = NBD_CMD_DISC; | 493 | nbd_cmd(&sreq) = NBD_CMD_DISC; |
494 | /* | 494 | /* |
495 | * Set these to sane values in case server implementation | 495 | * Set these to sane values in case server implementation |
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index 2403721f9db1..12ff1a274d91 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -437,7 +437,7 @@ static char *pd_buf; /* buffer for request in progress */ | |||
437 | 437 | ||
438 | static enum action do_pd_io_start(void) | 438 | static enum action do_pd_io_start(void) |
439 | { | 439 | { |
440 | if (pd_req->flags & REQ_SPECIAL) { | 440 | if (blk_special_request(pd_req)) { |
441 | phase = pd_special; | 441 | phase = pd_special; |
442 | return pd_special(); | 442 | return pd_special(); |
443 | } | 443 | } |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 451b996bba91..42891d2b054e 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -365,16 +365,16 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command * | |||
365 | rq->sense = sense; | 365 | rq->sense = sense; |
366 | memset(sense, 0, sizeof(sense)); | 366 | memset(sense, 0, sizeof(sense)); |
367 | rq->sense_len = 0; | 367 | rq->sense_len = 0; |
368 | rq->flags |= REQ_BLOCK_PC | REQ_HARDBARRIER; | 368 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
369 | rq->cmd_flags |= REQ_HARDBARRIER; | ||
369 | if (cgc->quiet) | 370 | if (cgc->quiet) |
370 | rq->flags |= REQ_QUIET; | 371 | rq->cmd_flags |= REQ_QUIET; |
371 | memcpy(rq->cmd, cgc->cmd, CDROM_PACKET_SIZE); | 372 | memcpy(rq->cmd, cgc->cmd, CDROM_PACKET_SIZE); |
372 | if (sizeof(rq->cmd) > CDROM_PACKET_SIZE) | 373 | if (sizeof(rq->cmd) > CDROM_PACKET_SIZE) |
373 | memset(rq->cmd + CDROM_PACKET_SIZE, 0, sizeof(rq->cmd) - CDROM_PACKET_SIZE); | 374 | memset(rq->cmd + CDROM_PACKET_SIZE, 0, sizeof(rq->cmd) - CDROM_PACKET_SIZE); |
374 | rq->cmd_len = COMMAND_SIZE(rq->cmd[0]); | 375 | rq->cmd_len = COMMAND_SIZE(rq->cmd[0]); |
375 | 376 | ||
376 | rq->ref_count++; | 377 | rq->ref_count++; |
377 | rq->flags |= REQ_NOMERGE; | ||
378 | rq->waiting = &wait; | 378 | rq->waiting = &wait; |
379 | rq->end_io = blk_end_sync_rq; | 379 | rq->end_io = blk_end_sync_rq; |
380 | elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 1); | 380 | elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 1); |
diff --git a/drivers/block/xd.c b/drivers/block/xd.c index e828e4cbd3e1..ebf3025721d1 100644 --- a/drivers/block/xd.c +++ b/drivers/block/xd.c | |||
@@ -313,7 +313,7 @@ static void do_xd_request (request_queue_t * q) | |||
313 | int res = 0; | 313 | int res = 0; |
314 | int retry; | 314 | int retry; |
315 | 315 | ||
316 | if (!(req->flags & REQ_CMD)) { | 316 | if (!blk_fs_request(req)) { |
317 | end_request(req, 0); | 317 | end_request(req, 0); |
318 | continue; | 318 | continue; |
319 | } | 319 | } |
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index d239cf8b20bd..b38c84a7a8e3 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c | |||
@@ -2129,7 +2129,7 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf, | |||
2129 | rq->cmd[9] = 0xf8; | 2129 | rq->cmd[9] = 0xf8; |
2130 | 2130 | ||
2131 | rq->cmd_len = 12; | 2131 | rq->cmd_len = 12; |
2132 | rq->flags |= REQ_BLOCK_PC; | 2132 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
2133 | rq->timeout = 60 * HZ; | 2133 | rq->timeout = 60 * HZ; |
2134 | bio = rq->bio; | 2134 | bio = rq->bio; |
2135 | 2135 | ||
diff --git a/drivers/cdrom/cdu31a.c b/drivers/cdrom/cdu31a.c index 37bdb0163f0d..ccd91c1a84bd 100644 --- a/drivers/cdrom/cdu31a.c +++ b/drivers/cdrom/cdu31a.c | |||
@@ -1338,8 +1338,10 @@ static void do_cdu31a_request(request_queue_t * q) | |||
1338 | } | 1338 | } |
1339 | 1339 | ||
1340 | /* WTF??? */ | 1340 | /* WTF??? */ |
1341 | if (!(req->flags & REQ_CMD)) | 1341 | if (!blk_fs_request(req)) { |
1342 | end_request(req, 0); | ||
1342 | continue; | 1343 | continue; |
1344 | } | ||
1343 | if (rq_data_dir(req) == WRITE) { | 1345 | if (rq_data_dir(req) == WRITE) { |
1344 | end_request(req, 0); | 1346 | end_request(req, 0); |
1345 | continue; | 1347 | continue; |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 654d4cd09847..69bbb6206a00 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -372,7 +372,7 @@ static int cdrom_log_sense(ide_drive_t *drive, struct request *rq, | |||
372 | { | 372 | { |
373 | int log = 0; | 373 | int log = 0; |
374 | 374 | ||
375 | if (!sense || !rq || (rq->flags & REQ_QUIET)) | 375 | if (!sense || !rq || (rq->cmd_flags & REQ_QUIET)) |
376 | return 0; | 376 | return 0; |
377 | 377 | ||
378 | switch (sense->sense_key) { | 378 | switch (sense->sense_key) { |
@@ -597,7 +597,7 @@ static void cdrom_prepare_request(ide_drive_t *drive, struct request *rq) | |||
597 | struct cdrom_info *cd = drive->driver_data; | 597 | struct cdrom_info *cd = drive->driver_data; |
598 | 598 | ||
599 | ide_init_drive_cmd(rq); | 599 | ide_init_drive_cmd(rq); |
600 | rq->flags = REQ_PC; | 600 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
601 | rq->rq_disk = cd->disk; | 601 | rq->rq_disk = cd->disk; |
602 | } | 602 | } |
603 | 603 | ||
@@ -617,7 +617,7 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense, | |||
617 | rq->cmd[0] = GPCMD_REQUEST_SENSE; | 617 | rq->cmd[0] = GPCMD_REQUEST_SENSE; |
618 | rq->cmd[4] = rq->data_len = 18; | 618 | rq->cmd[4] = rq->data_len = 18; |
619 | 619 | ||
620 | rq->flags = REQ_SENSE; | 620 | rq->cmd_type = REQ_TYPE_SENSE; |
621 | 621 | ||
622 | /* NOTE! Save the failed command in "rq->buffer" */ | 622 | /* NOTE! Save the failed command in "rq->buffer" */ |
623 | rq->buffer = (void *) failed_command; | 623 | rq->buffer = (void *) failed_command; |
@@ -630,10 +630,10 @@ static void cdrom_end_request (ide_drive_t *drive, int uptodate) | |||
630 | struct request *rq = HWGROUP(drive)->rq; | 630 | struct request *rq = HWGROUP(drive)->rq; |
631 | int nsectors = rq->hard_cur_sectors; | 631 | int nsectors = rq->hard_cur_sectors; |
632 | 632 | ||
633 | if ((rq->flags & REQ_SENSE) && uptodate) { | 633 | if (blk_sense_request(rq) && uptodate) { |
634 | /* | 634 | /* |
635 | * For REQ_SENSE, "rq->buffer" points to the original failed | 635 | * For REQ_TYPE_SENSE, "rq->buffer" points to the original |
636 | * request | 636 | * failed request |
637 | */ | 637 | */ |
638 | struct request *failed = (struct request *) rq->buffer; | 638 | struct request *failed = (struct request *) rq->buffer; |
639 | struct cdrom_info *info = drive->driver_data; | 639 | struct cdrom_info *info = drive->driver_data; |
@@ -706,17 +706,17 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | |||
706 | return 1; | 706 | return 1; |
707 | } | 707 | } |
708 | 708 | ||
709 | if (rq->flags & REQ_SENSE) { | 709 | if (blk_sense_request(rq)) { |
710 | /* We got an error trying to get sense info | 710 | /* We got an error trying to get sense info |
711 | from the drive (probably while trying | 711 | from the drive (probably while trying |
712 | to recover from a former error). Just give up. */ | 712 | to recover from a former error). Just give up. */ |
713 | 713 | ||
714 | rq->flags |= REQ_FAILED; | 714 | rq->cmd_flags |= REQ_FAILED; |
715 | cdrom_end_request(drive, 0); | 715 | cdrom_end_request(drive, 0); |
716 | ide_error(drive, "request sense failure", stat); | 716 | ide_error(drive, "request sense failure", stat); |
717 | return 1; | 717 | return 1; |
718 | 718 | ||
719 | } else if (rq->flags & (REQ_PC | REQ_BLOCK_PC)) { | 719 | } else if (blk_pc_request(rq)) { |
720 | /* All other functions, except for READ. */ | 720 | /* All other functions, except for READ. */ |
721 | unsigned long flags; | 721 | unsigned long flags; |
722 | 722 | ||
@@ -724,7 +724,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | |||
724 | * if we have an error, pass back CHECK_CONDITION as the | 724 | * if we have an error, pass back CHECK_CONDITION as the |
725 | * scsi status byte | 725 | * scsi status byte |
726 | */ | 726 | */ |
727 | if ((rq->flags & REQ_BLOCK_PC) && !rq->errors) | 727 | if (!rq->errors) |
728 | rq->errors = SAM_STAT_CHECK_CONDITION; | 728 | rq->errors = SAM_STAT_CHECK_CONDITION; |
729 | 729 | ||
730 | /* Check for tray open. */ | 730 | /* Check for tray open. */ |
@@ -735,12 +735,12 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | |||
735 | cdrom_saw_media_change (drive); | 735 | cdrom_saw_media_change (drive); |
736 | /*printk("%s: media changed\n",drive->name);*/ | 736 | /*printk("%s: media changed\n",drive->name);*/ |
737 | return 0; | 737 | return 0; |
738 | } else if (!(rq->flags & REQ_QUIET)) { | 738 | } else if (!(rq->cmd_flags & REQ_QUIET)) { |
739 | /* Otherwise, print an error. */ | 739 | /* Otherwise, print an error. */ |
740 | ide_dump_status(drive, "packet command error", stat); | 740 | ide_dump_status(drive, "packet command error", stat); |
741 | } | 741 | } |
742 | 742 | ||
743 | rq->flags |= REQ_FAILED; | 743 | rq->cmd_flags |= REQ_FAILED; |
744 | 744 | ||
745 | /* | 745 | /* |
746 | * instead of playing games with moving completions around, | 746 | * instead of playing games with moving completions around, |
@@ -881,7 +881,7 @@ static int cdrom_timer_expiry(ide_drive_t *drive) | |||
881 | wait = ATAPI_WAIT_PC; | 881 | wait = ATAPI_WAIT_PC; |
882 | break; | 882 | break; |
883 | default: | 883 | default: |
884 | if (!(rq->flags & REQ_QUIET)) | 884 | if (!(rq->cmd_flags & REQ_QUIET)) |
885 | printk(KERN_INFO "ide-cd: cmd 0x%x timed out\n", rq->cmd[0]); | 885 | printk(KERN_INFO "ide-cd: cmd 0x%x timed out\n", rq->cmd[0]); |
886 | wait = 0; | 886 | wait = 0; |
887 | break; | 887 | break; |
@@ -1124,7 +1124,7 @@ static ide_startstop_t cdrom_read_intr (ide_drive_t *drive) | |||
1124 | if (rq->current_nr_sectors > 0) { | 1124 | if (rq->current_nr_sectors > 0) { |
1125 | printk (KERN_ERR "%s: cdrom_read_intr: data underrun (%d blocks)\n", | 1125 | printk (KERN_ERR "%s: cdrom_read_intr: data underrun (%d blocks)\n", |
1126 | drive->name, rq->current_nr_sectors); | 1126 | drive->name, rq->current_nr_sectors); |
1127 | rq->flags |= REQ_FAILED; | 1127 | rq->cmd_flags |= REQ_FAILED; |
1128 | cdrom_end_request(drive, 0); | 1128 | cdrom_end_request(drive, 0); |
1129 | } else | 1129 | } else |
1130 | cdrom_end_request(drive, 1); | 1130 | cdrom_end_request(drive, 1); |
@@ -1456,7 +1456,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) | |||
1456 | printk ("%s: cdrom_pc_intr: data underrun %d\n", | 1456 | printk ("%s: cdrom_pc_intr: data underrun %d\n", |
1457 | drive->name, pc->buflen); | 1457 | drive->name, pc->buflen); |
1458 | */ | 1458 | */ |
1459 | rq->flags |= REQ_FAILED; | 1459 | rq->cmd_flags |= REQ_FAILED; |
1460 | cdrom_end_request(drive, 0); | 1460 | cdrom_end_request(drive, 0); |
1461 | } | 1461 | } |
1462 | return ide_stopped; | 1462 | return ide_stopped; |
@@ -1509,7 +1509,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) | |||
1509 | rq->data += thislen; | 1509 | rq->data += thislen; |
1510 | rq->data_len -= thislen; | 1510 | rq->data_len -= thislen; |
1511 | 1511 | ||
1512 | if (rq->flags & REQ_SENSE) | 1512 | if (blk_sense_request(rq)) |
1513 | rq->sense_len += thislen; | 1513 | rq->sense_len += thislen; |
1514 | } else { | 1514 | } else { |
1515 | confused: | 1515 | confused: |
@@ -1517,7 +1517,7 @@ confused: | |||
1517 | "appears confused (ireason = 0x%02x). " | 1517 | "appears confused (ireason = 0x%02x). " |
1518 | "Trying to recover by ending request.\n", | 1518 | "Trying to recover by ending request.\n", |
1519 | drive->name, ireason); | 1519 | drive->name, ireason); |
1520 | rq->flags |= REQ_FAILED; | 1520 | rq->cmd_flags |= REQ_FAILED; |
1521 | cdrom_end_request(drive, 0); | 1521 | cdrom_end_request(drive, 0); |
1522 | return ide_stopped; | 1522 | return ide_stopped; |
1523 | } | 1523 | } |
@@ -1546,7 +1546,7 @@ static ide_startstop_t cdrom_do_packet_command (ide_drive_t *drive) | |||
1546 | struct cdrom_info *info = drive->driver_data; | 1546 | struct cdrom_info *info = drive->driver_data; |
1547 | 1547 | ||
1548 | info->dma = 0; | 1548 | info->dma = 0; |
1549 | rq->flags &= ~REQ_FAILED; | 1549 | rq->cmd_flags &= ~REQ_FAILED; |
1550 | len = rq->data_len; | 1550 | len = rq->data_len; |
1551 | 1551 | ||
1552 | /* Start sending the command to the drive. */ | 1552 | /* Start sending the command to the drive. */ |
@@ -1558,7 +1558,7 @@ static int cdrom_queue_packet_command(ide_drive_t *drive, struct request *rq) | |||
1558 | { | 1558 | { |
1559 | struct request_sense sense; | 1559 | struct request_sense sense; |
1560 | int retries = 10; | 1560 | int retries = 10; |
1561 | unsigned int flags = rq->flags; | 1561 | unsigned int flags = rq->cmd_flags; |
1562 | 1562 | ||
1563 | if (rq->sense == NULL) | 1563 | if (rq->sense == NULL) |
1564 | rq->sense = &sense; | 1564 | rq->sense = &sense; |
@@ -1567,14 +1567,14 @@ static int cdrom_queue_packet_command(ide_drive_t *drive, struct request *rq) | |||
1567 | do { | 1567 | do { |
1568 | int error; | 1568 | int error; |
1569 | unsigned long time = jiffies; | 1569 | unsigned long time = jiffies; |
1570 | rq->flags = flags; | 1570 | rq->cmd_flags = flags; |
1571 | 1571 | ||
1572 | error = ide_do_drive_cmd(drive, rq, ide_wait); | 1572 | error = ide_do_drive_cmd(drive, rq, ide_wait); |
1573 | time = jiffies - time; | 1573 | time = jiffies - time; |
1574 | 1574 | ||
1575 | /* FIXME: we should probably abort/retry or something | 1575 | /* FIXME: we should probably abort/retry or something |
1576 | * in case of failure */ | 1576 | * in case of failure */ |
1577 | if (rq->flags & REQ_FAILED) { | 1577 | if (rq->cmd_flags & REQ_FAILED) { |
1578 | /* The request failed. Retry if it was due to a unit | 1578 | /* The request failed. Retry if it was due to a unit |
1579 | attention status | 1579 | attention status |
1580 | (usually means media was changed). */ | 1580 | (usually means media was changed). */ |
@@ -1596,10 +1596,10 @@ static int cdrom_queue_packet_command(ide_drive_t *drive, struct request *rq) | |||
1596 | } | 1596 | } |
1597 | 1597 | ||
1598 | /* End of retry loop. */ | 1598 | /* End of retry loop. */ |
1599 | } while ((rq->flags & REQ_FAILED) && retries >= 0); | 1599 | } while ((rq->cmd_flags & REQ_FAILED) && retries >= 0); |
1600 | 1600 | ||
1601 | /* Return an error if the command failed. */ | 1601 | /* Return an error if the command failed. */ |
1602 | return (rq->flags & REQ_FAILED) ? -EIO : 0; | 1602 | return (rq->cmd_flags & REQ_FAILED) ? -EIO : 0; |
1603 | } | 1603 | } |
1604 | 1604 | ||
1605 | /* | 1605 | /* |
@@ -1963,7 +1963,7 @@ static ide_startstop_t cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) | |||
1963 | { | 1963 | { |
1964 | struct cdrom_info *info = drive->driver_data; | 1964 | struct cdrom_info *info = drive->driver_data; |
1965 | 1965 | ||
1966 | rq->flags |= REQ_QUIET; | 1966 | rq->cmd_flags |= REQ_QUIET; |
1967 | 1967 | ||
1968 | info->dma = 0; | 1968 | info->dma = 0; |
1969 | 1969 | ||
@@ -2023,11 +2023,11 @@ ide_do_rw_cdrom (ide_drive_t *drive, struct request *rq, sector_t block) | |||
2023 | } | 2023 | } |
2024 | info->last_block = block; | 2024 | info->last_block = block; |
2025 | return action; | 2025 | return action; |
2026 | } else if (rq->flags & (REQ_PC | REQ_SENSE)) { | 2026 | } else if (rq->cmd_type == REQ_TYPE_SENSE) { |
2027 | return cdrom_do_packet_command(drive); | 2027 | return cdrom_do_packet_command(drive); |
2028 | } else if (rq->flags & REQ_BLOCK_PC) { | 2028 | } else if (blk_pc_request(rq)) { |
2029 | return cdrom_do_block_pc(drive, rq); | 2029 | return cdrom_do_block_pc(drive, rq); |
2030 | } else if (rq->flags & REQ_SPECIAL) { | 2030 | } else if (blk_special_request(rq)) { |
2031 | /* | 2031 | /* |
2032 | * right now this can only be a reset... | 2032 | * right now this can only be a reset... |
2033 | */ | 2033 | */ |
@@ -2105,7 +2105,7 @@ static int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense) | |||
2105 | 2105 | ||
2106 | req.sense = sense; | 2106 | req.sense = sense; |
2107 | req.cmd[0] = GPCMD_TEST_UNIT_READY; | 2107 | req.cmd[0] = GPCMD_TEST_UNIT_READY; |
2108 | req.flags |= REQ_QUIET; | 2108 | req.cmd_flags |= REQ_QUIET; |
2109 | 2109 | ||
2110 | #if ! STANDARD_ATAPI | 2110 | #if ! STANDARD_ATAPI |
2111 | /* the Sanyo 3 CD changer uses byte 7 of TEST_UNIT_READY to | 2111 | /* the Sanyo 3 CD changer uses byte 7 of TEST_UNIT_READY to |
@@ -2207,7 +2207,7 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, | |||
2207 | req.cmd[0] = GPCMD_READ_CDVD_CAPACITY; | 2207 | req.cmd[0] = GPCMD_READ_CDVD_CAPACITY; |
2208 | req.data = (char *)&capbuf; | 2208 | req.data = (char *)&capbuf; |
2209 | req.data_len = sizeof(capbuf); | 2209 | req.data_len = sizeof(capbuf); |
2210 | req.flags |= REQ_QUIET; | 2210 | req.cmd_flags |= REQ_QUIET; |
2211 | 2211 | ||
2212 | stat = cdrom_queue_packet_command(drive, &req); | 2212 | stat = cdrom_queue_packet_command(drive, &req); |
2213 | if (stat == 0) { | 2213 | if (stat == 0) { |
@@ -2230,7 +2230,7 @@ static int cdrom_read_tocentry(ide_drive_t *drive, int trackno, int msf_flag, | |||
2230 | req.sense = sense; | 2230 | req.sense = sense; |
2231 | req.data = buf; | 2231 | req.data = buf; |
2232 | req.data_len = buflen; | 2232 | req.data_len = buflen; |
2233 | req.flags |= REQ_QUIET; | 2233 | req.cmd_flags |= REQ_QUIET; |
2234 | req.cmd[0] = GPCMD_READ_TOC_PMA_ATIP; | 2234 | req.cmd[0] = GPCMD_READ_TOC_PMA_ATIP; |
2235 | req.cmd[6] = trackno; | 2235 | req.cmd[6] = trackno; |
2236 | req.cmd[7] = (buflen >> 8); | 2236 | req.cmd[7] = (buflen >> 8); |
@@ -2531,7 +2531,7 @@ static int ide_cdrom_packet(struct cdrom_device_info *cdi, | |||
2531 | req.timeout = cgc->timeout; | 2531 | req.timeout = cgc->timeout; |
2532 | 2532 | ||
2533 | if (cgc->quiet) | 2533 | if (cgc->quiet) |
2534 | req.flags |= REQ_QUIET; | 2534 | req.cmd_flags |= REQ_QUIET; |
2535 | 2535 | ||
2536 | req.sense = cgc->sense; | 2536 | req.sense = cgc->sense; |
2537 | cgc->stat = cdrom_queue_packet_command(drive, &req); | 2537 | cgc->stat = cdrom_queue_packet_command(drive, &req); |
@@ -2629,7 +2629,8 @@ int ide_cdrom_reset (struct cdrom_device_info *cdi) | |||
2629 | int ret; | 2629 | int ret; |
2630 | 2630 | ||
2631 | cdrom_prepare_request(drive, &req); | 2631 | cdrom_prepare_request(drive, &req); |
2632 | req.flags = REQ_SPECIAL | REQ_QUIET; | 2632 | req.cmd_type = REQ_TYPE_SPECIAL; |
2633 | req.cmd_flags = REQ_QUIET; | ||
2633 | ret = ide_do_drive_cmd(drive, &req, ide_wait); | 2634 | ret = ide_do_drive_cmd(drive, &req, ide_wait); |
2634 | 2635 | ||
2635 | /* | 2636 | /* |
@@ -3116,9 +3117,9 @@ static int ide_cdrom_prep_pc(struct request *rq) | |||
3116 | 3117 | ||
3117 | static int ide_cdrom_prep_fn(request_queue_t *q, struct request *rq) | 3118 | static int ide_cdrom_prep_fn(request_queue_t *q, struct request *rq) |
3118 | { | 3119 | { |
3119 | if (rq->flags & REQ_CMD) | 3120 | if (blk_fs_request(rq)) |
3120 | return ide_cdrom_prep_fs(q, rq); | 3121 | return ide_cdrom_prep_fs(q, rq); |
3121 | else if (rq->flags & REQ_BLOCK_PC) | 3122 | else if (blk_pc_request(rq)) |
3122 | return ide_cdrom_prep_pc(rq); | 3123 | return ide_cdrom_prep_pc(rq); |
3123 | 3124 | ||
3124 | return 0; | 3125 | return 0; |
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 7cf3eb023521..0a05a377d66a 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -699,7 +699,8 @@ static void idedisk_prepare_flush(request_queue_t *q, struct request *rq) | |||
699 | rq->cmd[0] = WIN_FLUSH_CACHE; | 699 | rq->cmd[0] = WIN_FLUSH_CACHE; |
700 | 700 | ||
701 | 701 | ||
702 | rq->flags |= REQ_DRIVE_TASK; | 702 | rq->cmd_type = REQ_TYPE_ATA_TASK; |
703 | rq->cmd_flags |= REQ_SOFTBARRIER; | ||
703 | rq->buffer = rq->cmd; | 704 | rq->buffer = rq->cmd; |
704 | } | 705 | } |
705 | 706 | ||
@@ -740,7 +741,7 @@ static int set_multcount(ide_drive_t *drive, int arg) | |||
740 | if (drive->special.b.set_multmode) | 741 | if (drive->special.b.set_multmode) |
741 | return -EBUSY; | 742 | return -EBUSY; |
742 | ide_init_drive_cmd (&rq); | 743 | ide_init_drive_cmd (&rq); |
743 | rq.flags = REQ_DRIVE_CMD; | 744 | rq.cmd_type = REQ_TYPE_ATA_CMD; |
744 | drive->mult_req = arg; | 745 | drive->mult_req = arg; |
745 | drive->special.b.set_multmode = 1; | 746 | drive->special.b.set_multmode = 1; |
746 | (void) ide_do_drive_cmd (drive, &rq, ide_wait); | 747 | (void) ide_do_drive_cmd (drive, &rq, ide_wait); |
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 7c3a13e1cf64..c3546fe9af63 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -205,7 +205,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq) | |||
205 | ide_hwif_t *hwif = HWIF(drive); | 205 | ide_hwif_t *hwif = HWIF(drive); |
206 | struct scatterlist *sg = hwif->sg_table; | 206 | struct scatterlist *sg = hwif->sg_table; |
207 | 207 | ||
208 | BUG_ON((rq->flags & REQ_DRIVE_TASKFILE) && rq->nr_sectors > 256); | 208 | BUG_ON((rq->cmd_type == REQ_TYPE_ATA_TASKFILE) && rq->nr_sectors > 256); |
209 | 209 | ||
210 | ide_map_sg(drive, rq); | 210 | ide_map_sg(drive, rq); |
211 | 211 | ||
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index adbe9f76a505..0edc32204915 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -588,7 +588,7 @@ static int idefloppy_do_end_request(ide_drive_t *drive, int uptodate, int nsecs) | |||
588 | /* Why does this happen? */ | 588 | /* Why does this happen? */ |
589 | if (!rq) | 589 | if (!rq) |
590 | return 0; | 590 | return 0; |
591 | if (!(rq->flags & REQ_SPECIAL)) { //if (!IDEFLOPPY_RQ_CMD (rq->cmd)) { | 591 | if (!blk_special_request(rq)) { |
592 | /* our real local end request function */ | 592 | /* our real local end request function */ |
593 | ide_end_request(drive, uptodate, nsecs); | 593 | ide_end_request(drive, uptodate, nsecs); |
594 | return 0; | 594 | return 0; |
@@ -689,7 +689,7 @@ static void idefloppy_queue_pc_head (ide_drive_t *drive,idefloppy_pc_t *pc,struc | |||
689 | 689 | ||
690 | ide_init_drive_cmd(rq); | 690 | ide_init_drive_cmd(rq); |
691 | rq->buffer = (char *) pc; | 691 | rq->buffer = (char *) pc; |
692 | rq->flags = REQ_SPECIAL; //rq->cmd = IDEFLOPPY_PC_RQ; | 692 | rq->cmd_type = REQ_TYPE_SPECIAL; |
693 | rq->rq_disk = floppy->disk; | 693 | rq->rq_disk = floppy->disk; |
694 | (void) ide_do_drive_cmd(drive, rq, ide_preempt); | 694 | (void) ide_do_drive_cmd(drive, rq, ide_preempt); |
695 | } | 695 | } |
@@ -1250,7 +1250,7 @@ static void idefloppy_create_rw_cmd (idefloppy_floppy_t *floppy, idefloppy_pc_t | |||
1250 | pc->callback = &idefloppy_rw_callback; | 1250 | pc->callback = &idefloppy_rw_callback; |
1251 | pc->rq = rq; | 1251 | pc->rq = rq; |
1252 | pc->b_count = cmd == READ ? 0 : rq->bio->bi_size; | 1252 | pc->b_count = cmd == READ ? 0 : rq->bio->bi_size; |
1253 | if (rq->flags & REQ_RW) | 1253 | if (rq->cmd_flags & REQ_RW) |
1254 | set_bit(PC_WRITING, &pc->flags); | 1254 | set_bit(PC_WRITING, &pc->flags); |
1255 | pc->buffer = NULL; | 1255 | pc->buffer = NULL; |
1256 | pc->request_transfer = pc->buffer_size = blocks * floppy->block_size; | 1256 | pc->request_transfer = pc->buffer_size = blocks * floppy->block_size; |
@@ -1303,7 +1303,7 @@ static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request | |||
1303 | idefloppy_do_end_request(drive, 0, 0); | 1303 | idefloppy_do_end_request(drive, 0, 0); |
1304 | return ide_stopped; | 1304 | return ide_stopped; |
1305 | } | 1305 | } |
1306 | if (rq->flags & REQ_CMD) { | 1306 | if (blk_fs_request(rq)) { |
1307 | if (((long)rq->sector % floppy->bs_factor) || | 1307 | if (((long)rq->sector % floppy->bs_factor) || |
1308 | (rq->nr_sectors % floppy->bs_factor)) { | 1308 | (rq->nr_sectors % floppy->bs_factor)) { |
1309 | printk("%s: unsupported r/w request size\n", | 1309 | printk("%s: unsupported r/w request size\n", |
@@ -1313,9 +1313,9 @@ static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request | |||
1313 | } | 1313 | } |
1314 | pc = idefloppy_next_pc_storage(drive); | 1314 | pc = idefloppy_next_pc_storage(drive); |
1315 | idefloppy_create_rw_cmd(floppy, pc, rq, block); | 1315 | idefloppy_create_rw_cmd(floppy, pc, rq, block); |
1316 | } else if (rq->flags & REQ_SPECIAL) { | 1316 | } else if (blk_special_request(rq)) { |
1317 | pc = (idefloppy_pc_t *) rq->buffer; | 1317 | pc = (idefloppy_pc_t *) rq->buffer; |
1318 | } else if (rq->flags & REQ_BLOCK_PC) { | 1318 | } else if (blk_pc_request(rq)) { |
1319 | pc = idefloppy_next_pc_storage(drive); | 1319 | pc = idefloppy_next_pc_storage(drive); |
1320 | if (idefloppy_blockpc_cmd(floppy, pc, rq)) { | 1320 | if (idefloppy_blockpc_cmd(floppy, pc, rq)) { |
1321 | idefloppy_do_end_request(drive, 0, 0); | 1321 | idefloppy_do_end_request(drive, 0, 0); |
@@ -1343,7 +1343,7 @@ static int idefloppy_queue_pc_tail (ide_drive_t *drive,idefloppy_pc_t *pc) | |||
1343 | 1343 | ||
1344 | ide_init_drive_cmd (&rq); | 1344 | ide_init_drive_cmd (&rq); |
1345 | rq.buffer = (char *) pc; | 1345 | rq.buffer = (char *) pc; |
1346 | rq.flags = REQ_SPECIAL; // rq.cmd = IDEFLOPPY_PC_RQ; | 1346 | rq.cmd_type = REQ_TYPE_SPECIAL; |
1347 | rq.rq_disk = floppy->disk; | 1347 | rq.rq_disk = floppy->disk; |
1348 | 1348 | ||
1349 | return ide_do_drive_cmd(drive, &rq, ide_wait); | 1349 | return ide_do_drive_cmd(drive, &rq, ide_wait); |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index fb6795236e76..3436b1f104eb 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -59,7 +59,7 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq, | |||
59 | { | 59 | { |
60 | int ret = 1; | 60 | int ret = 1; |
61 | 61 | ||
62 | BUG_ON(!(rq->flags & REQ_STARTED)); | 62 | BUG_ON(!blk_rq_started(rq)); |
63 | 63 | ||
64 | /* | 64 | /* |
65 | * if failfast is set on a request, override number of sectors and | 65 | * if failfast is set on a request, override number of sectors and |
@@ -244,7 +244,7 @@ int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, | |||
244 | 244 | ||
245 | spin_lock_irqsave(&ide_lock, flags); | 245 | spin_lock_irqsave(&ide_lock, flags); |
246 | 246 | ||
247 | BUG_ON(!(rq->flags & REQ_STARTED)); | 247 | BUG_ON(!blk_rq_started(rq)); |
248 | 248 | ||
249 | /* | 249 | /* |
250 | * if failfast is set on a request, override number of sectors and | 250 | * if failfast is set on a request, override number of sectors and |
@@ -366,7 +366,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) | |||
366 | rq = HWGROUP(drive)->rq; | 366 | rq = HWGROUP(drive)->rq; |
367 | spin_unlock_irqrestore(&ide_lock, flags); | 367 | spin_unlock_irqrestore(&ide_lock, flags); |
368 | 368 | ||
369 | if (rq->flags & REQ_DRIVE_CMD) { | 369 | if (rq->cmd_type == REQ_TYPE_ATA_CMD) { |
370 | u8 *args = (u8 *) rq->buffer; | 370 | u8 *args = (u8 *) rq->buffer; |
371 | if (rq->errors == 0) | 371 | if (rq->errors == 0) |
372 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); | 372 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); |
@@ -376,7 +376,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) | |||
376 | args[1] = err; | 376 | args[1] = err; |
377 | args[2] = hwif->INB(IDE_NSECTOR_REG); | 377 | args[2] = hwif->INB(IDE_NSECTOR_REG); |
378 | } | 378 | } |
379 | } else if (rq->flags & REQ_DRIVE_TASK) { | 379 | } else if (rq->cmd_type == REQ_TYPE_ATA_TASK) { |
380 | u8 *args = (u8 *) rq->buffer; | 380 | u8 *args = (u8 *) rq->buffer; |
381 | if (rq->errors == 0) | 381 | if (rq->errors == 0) |
382 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); | 382 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); |
@@ -390,7 +390,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) | |||
390 | args[5] = hwif->INB(IDE_HCYL_REG); | 390 | args[5] = hwif->INB(IDE_HCYL_REG); |
391 | args[6] = hwif->INB(IDE_SELECT_REG); | 391 | args[6] = hwif->INB(IDE_SELECT_REG); |
392 | } | 392 | } |
393 | } else if (rq->flags & REQ_DRIVE_TASKFILE) { | 393 | } else if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { |
394 | ide_task_t *args = (ide_task_t *) rq->special; | 394 | ide_task_t *args = (ide_task_t *) rq->special; |
395 | if (rq->errors == 0) | 395 | if (rq->errors == 0) |
396 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); | 396 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); |
@@ -587,7 +587,7 @@ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, u8 stat) | |||
587 | return ide_stopped; | 587 | return ide_stopped; |
588 | 588 | ||
589 | /* retry only "normal" I/O: */ | 589 | /* retry only "normal" I/O: */ |
590 | if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK | REQ_DRIVE_TASKFILE)) { | 590 | if (!blk_fs_request(rq)) { |
591 | rq->errors = 1; | 591 | rq->errors = 1; |
592 | ide_end_drive_cmd(drive, stat, err); | 592 | ide_end_drive_cmd(drive, stat, err); |
593 | return ide_stopped; | 593 | return ide_stopped; |
@@ -638,7 +638,7 @@ ide_startstop_t ide_abort(ide_drive_t *drive, const char *msg) | |||
638 | return ide_stopped; | 638 | return ide_stopped; |
639 | 639 | ||
640 | /* retry only "normal" I/O: */ | 640 | /* retry only "normal" I/O: */ |
641 | if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK | REQ_DRIVE_TASKFILE)) { | 641 | if (!blk_fs_request(rq)) { |
642 | rq->errors = 1; | 642 | rq->errors = 1; |
643 | ide_end_drive_cmd(drive, BUSY_STAT, 0); | 643 | ide_end_drive_cmd(drive, BUSY_STAT, 0); |
644 | return ide_stopped; | 644 | return ide_stopped; |
@@ -808,7 +808,7 @@ void ide_map_sg(ide_drive_t *drive, struct request *rq) | |||
808 | if (hwif->sg_mapped) /* needed by ide-scsi */ | 808 | if (hwif->sg_mapped) /* needed by ide-scsi */ |
809 | return; | 809 | return; |
810 | 810 | ||
811 | if ((rq->flags & REQ_DRIVE_TASKFILE) == 0) { | 811 | if (rq->cmd_type != REQ_TYPE_ATA_TASKFILE) { |
812 | hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); | 812 | hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); |
813 | } else { | 813 | } else { |
814 | sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE); | 814 | sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE); |
@@ -844,7 +844,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, | |||
844 | struct request *rq) | 844 | struct request *rq) |
845 | { | 845 | { |
846 | ide_hwif_t *hwif = HWIF(drive); | 846 | ide_hwif_t *hwif = HWIF(drive); |
847 | if (rq->flags & REQ_DRIVE_TASKFILE) { | 847 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { |
848 | ide_task_t *args = rq->special; | 848 | ide_task_t *args = rq->special; |
849 | 849 | ||
850 | if (!args) | 850 | if (!args) |
@@ -866,7 +866,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, | |||
866 | if (args->tf_out_flags.all != 0) | 866 | if (args->tf_out_flags.all != 0) |
867 | return flagged_taskfile(drive, args); | 867 | return flagged_taskfile(drive, args); |
868 | return do_rw_taskfile(drive, args); | 868 | return do_rw_taskfile(drive, args); |
869 | } else if (rq->flags & REQ_DRIVE_TASK) { | 869 | } else if (rq->cmd_type == REQ_TYPE_ATA_TASK) { |
870 | u8 *args = rq->buffer; | 870 | u8 *args = rq->buffer; |
871 | u8 sel; | 871 | u8 sel; |
872 | 872 | ||
@@ -892,7 +892,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, | |||
892 | hwif->OUTB(sel, IDE_SELECT_REG); | 892 | hwif->OUTB(sel, IDE_SELECT_REG); |
893 | ide_cmd(drive, args[0], args[2], &drive_cmd_intr); | 893 | ide_cmd(drive, args[0], args[2], &drive_cmd_intr); |
894 | return ide_started; | 894 | return ide_started; |
895 | } else if (rq->flags & REQ_DRIVE_CMD) { | 895 | } else if (rq->cmd_type == REQ_TYPE_ATA_CMD) { |
896 | u8 *args = rq->buffer; | 896 | u8 *args = rq->buffer; |
897 | 897 | ||
898 | if (!args) | 898 | if (!args) |
@@ -980,7 +980,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) | |||
980 | ide_startstop_t startstop; | 980 | ide_startstop_t startstop; |
981 | sector_t block; | 981 | sector_t block; |
982 | 982 | ||
983 | BUG_ON(!(rq->flags & REQ_STARTED)); | 983 | BUG_ON(!blk_rq_started(rq)); |
984 | 984 | ||
985 | #ifdef DEBUG | 985 | #ifdef DEBUG |
986 | printk("%s: start_request: current=0x%08lx\n", | 986 | printk("%s: start_request: current=0x%08lx\n", |
@@ -1013,9 +1013,9 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) | |||
1013 | if (!drive->special.all) { | 1013 | if (!drive->special.all) { |
1014 | ide_driver_t *drv; | 1014 | ide_driver_t *drv; |
1015 | 1015 | ||
1016 | if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK)) | 1016 | if (rq->cmd_type == REQ_TYPE_ATA_CMD || |
1017 | return execute_drive_cmd(drive, rq); | 1017 | rq->cmd_type == REQ_TYPE_ATA_TASK || |
1018 | else if (rq->flags & REQ_DRIVE_TASKFILE) | 1018 | rq->cmd_type == REQ_TYPE_ATA_TASKFILE) |
1019 | return execute_drive_cmd(drive, rq); | 1019 | return execute_drive_cmd(drive, rq); |
1020 | else if (blk_pm_request(rq)) { | 1020 | else if (blk_pm_request(rq)) { |
1021 | struct request_pm_state *pm = rq->end_io_data; | 1021 | struct request_pm_state *pm = rq->end_io_data; |
@@ -1264,7 +1264,7 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq) | |||
1264 | * We count how many times we loop here to make sure we service | 1264 | * We count how many times we loop here to make sure we service |
1265 | * all drives in the hwgroup without looping for ever | 1265 | * all drives in the hwgroup without looping for ever |
1266 | */ | 1266 | */ |
1267 | if (drive->blocked && !blk_pm_request(rq) && !(rq->flags & REQ_PREEMPT)) { | 1267 | if (drive->blocked && !blk_pm_request(rq) && !(rq->cmd_flags & REQ_PREEMPT)) { |
1268 | drive = drive->next ? drive->next : hwgroup->drive; | 1268 | drive = drive->next ? drive->next : hwgroup->drive; |
1269 | if (loops++ < 4 && !blk_queue_plugged(drive->queue)) | 1269 | if (loops++ < 4 && !blk_queue_plugged(drive->queue)) |
1270 | goto again; | 1270 | goto again; |
@@ -1670,7 +1670,7 @@ irqreturn_t ide_intr (int irq, void *dev_id, struct pt_regs *regs) | |||
1670 | void ide_init_drive_cmd (struct request *rq) | 1670 | void ide_init_drive_cmd (struct request *rq) |
1671 | { | 1671 | { |
1672 | memset(rq, 0, sizeof(*rq)); | 1672 | memset(rq, 0, sizeof(*rq)); |
1673 | rq->flags = REQ_DRIVE_CMD; | 1673 | rq->cmd_type = REQ_TYPE_ATA_CMD; |
1674 | rq->ref_count = 1; | 1674 | rq->ref_count = 1; |
1675 | } | 1675 | } |
1676 | 1676 | ||
@@ -1727,7 +1727,7 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio | |||
1727 | hwgroup->rq = NULL; | 1727 | hwgroup->rq = NULL; |
1728 | if (action == ide_preempt || action == ide_head_wait) { | 1728 | if (action == ide_preempt || action == ide_head_wait) { |
1729 | where = ELEVATOR_INSERT_FRONT; | 1729 | where = ELEVATOR_INSERT_FRONT; |
1730 | rq->flags |= REQ_PREEMPT; | 1730 | rq->cmd_flags |= REQ_PREEMPT; |
1731 | } | 1731 | } |
1732 | __elv_add_request(drive->queue, rq, where, 0); | 1732 | __elv_add_request(drive->queue, rq, where, 0); |
1733 | ide_do_request(hwgroup, IDE_NO_IRQ); | 1733 | ide_do_request(hwgroup, IDE_NO_IRQ); |
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index 1feff23487d4..850ef63cc986 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c | |||
@@ -456,13 +456,14 @@ static void ide_dump_opcode(ide_drive_t *drive) | |||
456 | spin_unlock(&ide_lock); | 456 | spin_unlock(&ide_lock); |
457 | if (!rq) | 457 | if (!rq) |
458 | return; | 458 | return; |
459 | if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK)) { | 459 | if (rq->cmd_type == REQ_TYPE_ATA_CMD || |
460 | rq->cmd_type == REQ_TYPE_ATA_TASK) { | ||
460 | char *args = rq->buffer; | 461 | char *args = rq->buffer; |
461 | if (args) { | 462 | if (args) { |
462 | opcode = args[0]; | 463 | opcode = args[0]; |
463 | found = 1; | 464 | found = 1; |
464 | } | 465 | } |
465 | } else if (rq->flags & REQ_DRIVE_TASKFILE) { | 466 | } else if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { |
466 | ide_task_t *args = rq->special; | 467 | ide_task_t *args = rq->special; |
467 | if (args) { | 468 | if (args) { |
468 | task_struct_t *tf = (task_struct_t *) args->tfRegister; | 469 | task_struct_t *tf = (task_struct_t *) args->tfRegister; |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 7067ab997927..643e4b9ac651 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -1776,7 +1776,7 @@ static void idetape_create_request_sense_cmd (idetape_pc_t *pc) | |||
1776 | static void idetape_init_rq(struct request *rq, u8 cmd) | 1776 | static void idetape_init_rq(struct request *rq, u8 cmd) |
1777 | { | 1777 | { |
1778 | memset(rq, 0, sizeof(*rq)); | 1778 | memset(rq, 0, sizeof(*rq)); |
1779 | rq->flags = REQ_SPECIAL; | 1779 | rq->cmd_type = REQ_TYPE_SPECIAL; |
1780 | rq->cmd[0] = cmd; | 1780 | rq->cmd[0] = cmd; |
1781 | } | 1781 | } |
1782 | 1782 | ||
@@ -2433,12 +2433,12 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, | |||
2433 | rq->sector, rq->nr_sectors, rq->current_nr_sectors); | 2433 | rq->sector, rq->nr_sectors, rq->current_nr_sectors); |
2434 | #endif /* IDETAPE_DEBUG_LOG */ | 2434 | #endif /* IDETAPE_DEBUG_LOG */ |
2435 | 2435 | ||
2436 | if ((rq->flags & REQ_SPECIAL) == 0) { | 2436 | if (!blk_special_request(rq)) { |
2437 | /* | 2437 | /* |
2438 | * We do not support buffer cache originated requests. | 2438 | * We do not support buffer cache originated requests. |
2439 | */ | 2439 | */ |
2440 | printk(KERN_NOTICE "ide-tape: %s: Unsupported request in " | 2440 | printk(KERN_NOTICE "ide-tape: %s: Unsupported request in " |
2441 | "request queue (%ld)\n", drive->name, rq->flags); | 2441 | "request queue (%d)\n", drive->name, rq->cmd_type); |
2442 | ide_end_request(drive, 0, 0); | 2442 | ide_end_request(drive, 0, 0); |
2443 | return ide_stopped; | 2443 | return ide_stopped; |
2444 | } | 2444 | } |
@@ -2768,7 +2768,7 @@ static void idetape_wait_for_request (ide_drive_t *drive, struct request *rq) | |||
2768 | idetape_tape_t *tape = drive->driver_data; | 2768 | idetape_tape_t *tape = drive->driver_data; |
2769 | 2769 | ||
2770 | #if IDETAPE_DEBUG_BUGS | 2770 | #if IDETAPE_DEBUG_BUGS |
2771 | if (rq == NULL || (rq->flags & REQ_SPECIAL) == 0) { | 2771 | if (rq == NULL || !blk_special_request(rq)) { |
2772 | printk (KERN_ERR "ide-tape: bug: Trying to sleep on non-valid request\n"); | 2772 | printk (KERN_ERR "ide-tape: bug: Trying to sleep on non-valid request\n"); |
2773 | return; | 2773 | return; |
2774 | } | 2774 | } |
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 97a9244312fc..1d0470c1f957 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -363,7 +363,7 @@ static ide_startstop_t task_error(ide_drive_t *drive, struct request *rq, | |||
363 | 363 | ||
364 | static void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat) | 364 | static void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat) |
365 | { | 365 | { |
366 | if (rq->flags & REQ_DRIVE_TASKFILE) { | 366 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { |
367 | ide_task_t *task = rq->special; | 367 | ide_task_t *task = rq->special; |
368 | 368 | ||
369 | if (task->tf_out_flags.all) { | 369 | if (task->tf_out_flags.all) { |
@@ -474,7 +474,7 @@ static int ide_diag_taskfile(ide_drive_t *drive, ide_task_t *args, unsigned long | |||
474 | struct request rq; | 474 | struct request rq; |
475 | 475 | ||
476 | memset(&rq, 0, sizeof(rq)); | 476 | memset(&rq, 0, sizeof(rq)); |
477 | rq.flags = REQ_DRIVE_TASKFILE; | 477 | rq.cmd_type = REQ_TYPE_ATA_TASKFILE; |
478 | rq.buffer = buf; | 478 | rq.buffer = buf; |
479 | 479 | ||
480 | /* | 480 | /* |
@@ -499,7 +499,7 @@ static int ide_diag_taskfile(ide_drive_t *drive, ide_task_t *args, unsigned long | |||
499 | rq.hard_cur_sectors = rq.current_nr_sectors = rq.nr_sectors; | 499 | rq.hard_cur_sectors = rq.current_nr_sectors = rq.nr_sectors; |
500 | 500 | ||
501 | if (args->command_type == IDE_DRIVE_TASK_RAW_WRITE) | 501 | if (args->command_type == IDE_DRIVE_TASK_RAW_WRITE) |
502 | rq.flags |= REQ_RW; | 502 | rq.cmd_flags |= REQ_RW; |
503 | } | 503 | } |
504 | 504 | ||
505 | rq.special = args; | 505 | rq.special = args; |
@@ -737,7 +737,7 @@ static int ide_wait_cmd_task(ide_drive_t *drive, u8 *buf) | |||
737 | struct request rq; | 737 | struct request rq; |
738 | 738 | ||
739 | ide_init_drive_cmd(&rq); | 739 | ide_init_drive_cmd(&rq); |
740 | rq.flags = REQ_DRIVE_TASK; | 740 | rq.cmd_type = REQ_TYPE_ATA_TASK; |
741 | rq.buffer = buf; | 741 | rq.buffer = buf; |
742 | return ide_do_drive_cmd(drive, &rq, ide_wait); | 742 | return ide_do_drive_cmd(drive, &rq, ide_wait); |
743 | } | 743 | } |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 9c8468de1a75..9384a3fdde6c 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -1217,7 +1217,7 @@ static int generic_ide_suspend(struct device *dev, pm_message_t mesg) | |||
1217 | memset(&rq, 0, sizeof(rq)); | 1217 | memset(&rq, 0, sizeof(rq)); |
1218 | memset(&rqpm, 0, sizeof(rqpm)); | 1218 | memset(&rqpm, 0, sizeof(rqpm)); |
1219 | memset(&args, 0, sizeof(args)); | 1219 | memset(&args, 0, sizeof(args)); |
1220 | rq.flags = REQ_PM_SUSPEND; | 1220 | rq.cmd_type = REQ_TYPE_PM_SUSPEND; |
1221 | rq.special = &args; | 1221 | rq.special = &args; |
1222 | rq.end_io_data = &rqpm; | 1222 | rq.end_io_data = &rqpm; |
1223 | rqpm.pm_step = ide_pm_state_start_suspend; | 1223 | rqpm.pm_step = ide_pm_state_start_suspend; |
@@ -1238,7 +1238,7 @@ static int generic_ide_resume(struct device *dev) | |||
1238 | memset(&rq, 0, sizeof(rq)); | 1238 | memset(&rq, 0, sizeof(rq)); |
1239 | memset(&rqpm, 0, sizeof(rqpm)); | 1239 | memset(&rqpm, 0, sizeof(rqpm)); |
1240 | memset(&args, 0, sizeof(args)); | 1240 | memset(&args, 0, sizeof(args)); |
1241 | rq.flags = REQ_PM_RESUME; | 1241 | rq.cmd_type = REQ_TYPE_PM_RESUME; |
1242 | rq.special = &args; | 1242 | rq.special = &args; |
1243 | rq.end_io_data = &rqpm; | 1243 | rq.end_io_data = &rqpm; |
1244 | rqpm.pm_step = ide_pm_state_start_resume; | 1244 | rqpm.pm_step = ide_pm_state_start_resume; |
diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c index aebecd8f51cc..4ab931145673 100644 --- a/drivers/ide/legacy/hd.c +++ b/drivers/ide/legacy/hd.c | |||
@@ -626,7 +626,7 @@ repeat: | |||
626 | req->rq_disk->disk_name, (req->cmd == READ)?"read":"writ", | 626 | req->rq_disk->disk_name, (req->cmd == READ)?"read":"writ", |
627 | cyl, head, sec, nsect, req->buffer); | 627 | cyl, head, sec, nsect, req->buffer); |
628 | #endif | 628 | #endif |
629 | if (req->flags & REQ_CMD) { | 629 | if (blk_fs_request(req)) { |
630 | switch (rq_data_dir(req)) { | 630 | switch (rq_data_dir(req)) { |
631 | case READ: | 631 | case READ: |
632 | hd_out(disk,nsect,sec,head,cyl,WIN_READ,&read_intr); | 632 | hd_out(disk,nsect,sec,head,cyl,WIN_READ,&read_intr); |
diff --git a/drivers/md/dm-emc.c b/drivers/md/dm-emc.c index 2a374ccb30dd..2b2d45d7baaa 100644 --- a/drivers/md/dm-emc.c +++ b/drivers/md/dm-emc.c | |||
@@ -126,7 +126,8 @@ static struct request *get_failover_req(struct emc_handler *h, | |||
126 | memset(&rq->cmd, 0, BLK_MAX_CDB); | 126 | memset(&rq->cmd, 0, BLK_MAX_CDB); |
127 | 127 | ||
128 | rq->timeout = EMC_FAILOVER_TIMEOUT; | 128 | rq->timeout = EMC_FAILOVER_TIMEOUT; |
129 | rq->flags |= (REQ_BLOCK_PC | REQ_FAILFAST | REQ_NOMERGE); | 129 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
130 | rq->cmd_flags |= REQ_FAILFAST | REQ_NOMERGE; | ||
130 | 131 | ||
131 | return rq; | 132 | return rq; |
132 | } | 133 | } |
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index 1ddc2fb429d5..eaba81bf2eca 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c | |||
@@ -390,9 +390,9 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req) | |||
390 | } | 390 | } |
391 | 391 | ||
392 | /* request is already processed by us, so return */ | 392 | /* request is already processed by us, so return */ |
393 | if (req->flags & REQ_SPECIAL) { | 393 | if (blk_special_request(req)) { |
394 | osm_debug("REQ_SPECIAL already set!\n"); | 394 | osm_debug("REQ_SPECIAL already set!\n"); |
395 | req->flags |= REQ_DONTPREP; | 395 | req->cmd_flags |= REQ_DONTPREP; |
396 | return BLKPREP_OK; | 396 | return BLKPREP_OK; |
397 | } | 397 | } |
398 | 398 | ||
@@ -411,7 +411,8 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req) | |||
411 | ireq = req->special; | 411 | ireq = req->special; |
412 | 412 | ||
413 | /* do not come back here */ | 413 | /* do not come back here */ |
414 | req->flags |= REQ_DONTPREP | REQ_SPECIAL; | 414 | req->cmd_type = REQ_TYPE_SPECIAL; |
415 | req->cmd_flags |= REQ_DONTPREP; | ||
415 | 416 | ||
416 | return BLKPREP_OK; | 417 | return BLKPREP_OK; |
417 | }; | 418 | }; |
diff --git a/drivers/mmc/mmc_queue.c b/drivers/mmc/mmc_queue.c index 74f8cdeeff0f..4ccdd82b680f 100644 --- a/drivers/mmc/mmc_queue.c +++ b/drivers/mmc/mmc_queue.c | |||
@@ -28,7 +28,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req) | |||
28 | struct mmc_queue *mq = q->queuedata; | 28 | struct mmc_queue *mq = q->queuedata; |
29 | int ret = BLKPREP_KILL; | 29 | int ret = BLKPREP_KILL; |
30 | 30 | ||
31 | if (req->flags & REQ_SPECIAL) { | 31 | if (blk_special_request(req)) { |
32 | /* | 32 | /* |
33 | * Special commands already have the command | 33 | * Special commands already have the command |
34 | * blocks already setup in req->special. | 34 | * blocks already setup in req->special. |
@@ -36,7 +36,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req) | |||
36 | BUG_ON(!req->special); | 36 | BUG_ON(!req->special); |
37 | 37 | ||
38 | ret = BLKPREP_OK; | 38 | ret = BLKPREP_OK; |
39 | } else if (req->flags & (REQ_CMD | REQ_BLOCK_PC)) { | 39 | } else if (blk_fs_request(req) || blk_pc_request(req)) { |
40 | /* | 40 | /* |
41 | * Block I/O requests need translating according | 41 | * Block I/O requests need translating according |
42 | * to the protocol. | 42 | * to the protocol. |
@@ -50,7 +50,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req) | |||
50 | } | 50 | } |
51 | 51 | ||
52 | if (ret == BLKPREP_OK) | 52 | if (ret == BLKPREP_OK) |
53 | req->flags |= REQ_DONTPREP; | 53 | req->cmd_flags |= REQ_DONTPREP; |
54 | 54 | ||
55 | return ret; | 55 | return ret; |
56 | } | 56 | } |
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 458d3c8ae1ee..6baf5fe14230 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c | |||
@@ -46,7 +46,7 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr, | |||
46 | nsect = req->current_nr_sectors; | 46 | nsect = req->current_nr_sectors; |
47 | buf = req->buffer; | 47 | buf = req->buffer; |
48 | 48 | ||
49 | if (!(req->flags & REQ_CMD)) | 49 | if (!blk_fs_request(req)) |
50 | return 0; | 50 | return 0; |
51 | 51 | ||
52 | if (block + nsect > get_capacity(req->rq_disk)) | 52 | if (block + nsect > get_capacity(req->rq_disk)) |
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index 9d051e5687ea..222a8a71a5e8 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c | |||
@@ -529,7 +529,7 @@ dasd_diag_build_cp(struct dasd_device * device, struct request *req) | |||
529 | } | 529 | } |
530 | cqr->retries = DIAG_MAX_RETRIES; | 530 | cqr->retries = DIAG_MAX_RETRIES; |
531 | cqr->buildclk = get_clock(); | 531 | cqr->buildclk = get_clock(); |
532 | if (req->flags & REQ_FAILFAST) | 532 | if (req->cmd_flags & REQ_FAILFAST) |
533 | set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags); | 533 | set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags); |
534 | cqr->device = device; | 534 | cqr->device = device; |
535 | cqr->expires = DIAG_TIMEOUT; | 535 | cqr->expires = DIAG_TIMEOUT; |
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index b7a7fac3f7c3..5ecea3e4fdef 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
@@ -1266,7 +1266,7 @@ dasd_eckd_build_cp(struct dasd_device * device, struct request *req) | |||
1266 | recid++; | 1266 | recid++; |
1267 | } | 1267 | } |
1268 | } | 1268 | } |
1269 | if (req->flags & REQ_FAILFAST) | 1269 | if (req->cmd_flags & REQ_FAILFAST) |
1270 | set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags); | 1270 | set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags); |
1271 | cqr->device = device; | 1271 | cqr->device = device; |
1272 | cqr->expires = 5 * 60 * HZ; /* 5 minutes */ | 1272 | cqr->expires = 5 * 60 * HZ; /* 5 minutes */ |
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c index e85015be109b..80926c548228 100644 --- a/drivers/s390/block/dasd_fba.c +++ b/drivers/s390/block/dasd_fba.c | |||
@@ -344,7 +344,7 @@ dasd_fba_build_cp(struct dasd_device * device, struct request *req) | |||
344 | recid++; | 344 | recid++; |
345 | } | 345 | } |
346 | } | 346 | } |
347 | if (req->flags & REQ_FAILFAST) | 347 | if (req->cmd_flags & REQ_FAILFAST) |
348 | set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags); | 348 | set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags); |
349 | cqr->device = device; | 349 | cqr->device = device; |
350 | cqr->expires = 5 * 60 * HZ; /* 5 minutes */ | 350 | cqr->expires = 5 * 60 * HZ; /* 5 minutes */ |
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c index 5dcef48d414f..10353379a074 100644 --- a/drivers/scsi/aic7xxx_old.c +++ b/drivers/scsi/aic7xxx_old.c | |||
@@ -2862,7 +2862,7 @@ aic7xxx_done(struct aic7xxx_host *p, struct aic7xxx_scb *scb) | |||
2862 | aic_dev->r_total++; | 2862 | aic_dev->r_total++; |
2863 | ptr = aic_dev->r_bins; | 2863 | ptr = aic_dev->r_bins; |
2864 | } | 2864 | } |
2865 | if(cmd->device->simple_tags && cmd->request->flags & REQ_HARDBARRIER) | 2865 | if(cmd->device->simple_tags && cmd->request->cmd_flags & REQ_HARDBARRIER) |
2866 | { | 2866 | { |
2867 | aic_dev->barrier_total++; | 2867 | aic_dev->barrier_total++; |
2868 | if(scb->tag_action == MSG_ORDERED_Q_TAG) | 2868 | if(scb->tag_action == MSG_ORDERED_Q_TAG) |
@@ -10158,7 +10158,7 @@ aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd, | |||
10158 | /* We always force TEST_UNIT_READY to untagged */ | 10158 | /* We always force TEST_UNIT_READY to untagged */ |
10159 | if (cmd->cmnd[0] != TEST_UNIT_READY && sdptr->simple_tags) | 10159 | if (cmd->cmnd[0] != TEST_UNIT_READY && sdptr->simple_tags) |
10160 | { | 10160 | { |
10161 | if (req->flags & REQ_HARDBARRIER) | 10161 | if (req->cmd_flags & REQ_HARDBARRIER) |
10162 | { | 10162 | { |
10163 | if(sdptr->ordered_tags) | 10163 | if(sdptr->ordered_tags) |
10164 | { | 10164 | { |
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 94d1de55607f..65b19695ebe2 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -344,7 +344,7 @@ static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_co | |||
344 | pc->buffer = buf; | 344 | pc->buffer = buf; |
345 | pc->c[0] = REQUEST_SENSE; | 345 | pc->c[0] = REQUEST_SENSE; |
346 | pc->c[4] = pc->request_transfer = pc->buffer_size = SCSI_SENSE_BUFFERSIZE; | 346 | pc->c[4] = pc->request_transfer = pc->buffer_size = SCSI_SENSE_BUFFERSIZE; |
347 | rq->flags = REQ_SENSE; | 347 | rq->cmd_type = REQ_TYPE_SENSE; |
348 | pc->timeout = jiffies + WAIT_READY; | 348 | pc->timeout = jiffies + WAIT_READY; |
349 | /* NOTE! Save the failed packet command in "rq->buffer" */ | 349 | /* NOTE! Save the failed packet command in "rq->buffer" */ |
350 | rq->buffer = (void *) failed_command->special; | 350 | rq->buffer = (void *) failed_command->special; |
@@ -398,12 +398,12 @@ static int idescsi_end_request (ide_drive_t *drive, int uptodate, int nrsecs) | |||
398 | int errors = rq->errors; | 398 | int errors = rq->errors; |
399 | unsigned long flags; | 399 | unsigned long flags; |
400 | 400 | ||
401 | if (!(rq->flags & (REQ_SPECIAL|REQ_SENSE))) { | 401 | if (!blk_special_request(rq) && !blk_sense_request(rq)) { |
402 | ide_end_request(drive, uptodate, nrsecs); | 402 | ide_end_request(drive, uptodate, nrsecs); |
403 | return 0; | 403 | return 0; |
404 | } | 404 | } |
405 | ide_end_drive_cmd (drive, 0, 0); | 405 | ide_end_drive_cmd (drive, 0, 0); |
406 | if (rq->flags & REQ_SENSE) { | 406 | if (blk_sense_request(rq)) { |
407 | idescsi_pc_t *opc = (idescsi_pc_t *) rq->buffer; | 407 | idescsi_pc_t *opc = (idescsi_pc_t *) rq->buffer; |
408 | if (log) { | 408 | if (log) { |
409 | printk ("ide-scsi: %s: wrap up check %lu, rst = ", drive->name, opc->scsi_cmd->serial_number); | 409 | printk ("ide-scsi: %s: wrap up check %lu, rst = ", drive->name, opc->scsi_cmd->serial_number); |
@@ -712,7 +712,7 @@ static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *r | |||
712 | printk (KERN_INFO "sector: %ld, nr_sectors: %ld, current_nr_sectors: %d\n",rq->sector,rq->nr_sectors,rq->current_nr_sectors); | 712 | printk (KERN_INFO "sector: %ld, nr_sectors: %ld, current_nr_sectors: %d\n",rq->sector,rq->nr_sectors,rq->current_nr_sectors); |
713 | #endif /* IDESCSI_DEBUG_LOG */ | 713 | #endif /* IDESCSI_DEBUG_LOG */ |
714 | 714 | ||
715 | if (rq->flags & (REQ_SPECIAL|REQ_SENSE)) { | 715 | if (blk_sense_request(rq) || blk_special_request(rq)) { |
716 | return idescsi_issue_pc (drive, (idescsi_pc_t *) rq->special); | 716 | return idescsi_issue_pc (drive, (idescsi_pc_t *) rq->special); |
717 | } | 717 | } |
718 | blk_dump_rq_flags(rq, "ide-scsi: unsup command"); | 718 | blk_dump_rq_flags(rq, "ide-scsi: unsup command"); |
@@ -938,7 +938,7 @@ static int idescsi_queue (struct scsi_cmnd *cmd, | |||
938 | 938 | ||
939 | ide_init_drive_cmd (rq); | 939 | ide_init_drive_cmd (rq); |
940 | rq->special = (char *) pc; | 940 | rq->special = (char *) pc; |
941 | rq->flags = REQ_SPECIAL; | 941 | rq->cmd_type = REQ_TYPE_SPECIAL; |
942 | spin_unlock_irq(host->host_lock); | 942 | spin_unlock_irq(host->host_lock); |
943 | rq->rq_disk = scsi->disk; | 943 | rq->rq_disk = scsi->disk; |
944 | (void) ide_do_drive_cmd (drive, rq, ide_end); | 944 | (void) ide_do_drive_cmd (drive, rq, ide_end); |
@@ -992,7 +992,7 @@ static int idescsi_eh_abort (struct scsi_cmnd *cmd) | |||
992 | */ | 992 | */ |
993 | printk (KERN_ERR "ide-scsi: cmd aborted!\n"); | 993 | printk (KERN_ERR "ide-scsi: cmd aborted!\n"); |
994 | 994 | ||
995 | if (scsi->pc->rq->flags & REQ_SENSE) | 995 | if (blk_sense_request(scsi->pc->rq)) |
996 | kfree(scsi->pc->buffer); | 996 | kfree(scsi->pc->buffer); |
997 | kfree(scsi->pc->rq); | 997 | kfree(scsi->pc->rq); |
998 | kfree(scsi->pc); | 998 | kfree(scsi->pc); |
@@ -1042,7 +1042,7 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd) | |||
1042 | /* kill current request */ | 1042 | /* kill current request */ |
1043 | blkdev_dequeue_request(req); | 1043 | blkdev_dequeue_request(req); |
1044 | end_that_request_last(req, 0); | 1044 | end_that_request_last(req, 0); |
1045 | if (req->flags & REQ_SENSE) | 1045 | if (blk_sense_request(req)) |
1046 | kfree(scsi->pc->buffer); | 1046 | kfree(scsi->pc->buffer); |
1047 | kfree(scsi->pc); | 1047 | kfree(scsi->pc); |
1048 | scsi->pc = NULL; | 1048 | scsi->pc = NULL; |
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c index 0bd9c60e6455..aa60a5f1fbc3 100644 --- a/drivers/scsi/pluto.c +++ b/drivers/scsi/pluto.c | |||
@@ -67,7 +67,6 @@ static void __init pluto_detect_done(Scsi_Cmnd *SCpnt) | |||
67 | 67 | ||
68 | static void __init pluto_detect_scsi_done(Scsi_Cmnd *SCpnt) | 68 | static void __init pluto_detect_scsi_done(Scsi_Cmnd *SCpnt) |
69 | { | 69 | { |
70 | SCpnt->request->rq_status = RQ_SCSI_DONE; | ||
71 | PLND(("Detect done %08lx\n", (long)SCpnt)) | 70 | PLND(("Detect done %08lx\n", (long)SCpnt)) |
72 | if (atomic_dec_and_test (&fcss)) | 71 | if (atomic_dec_and_test (&fcss)) |
73 | up(&fc_sem); | 72 | up(&fc_sem); |
@@ -166,7 +165,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt) | |||
166 | 165 | ||
167 | SCpnt->cmd_len = COMMAND_SIZE(INQUIRY); | 166 | SCpnt->cmd_len = COMMAND_SIZE(INQUIRY); |
168 | 167 | ||
169 | SCpnt->request->rq_status = RQ_SCSI_BUSY; | 168 | SCpnt->request->cmd_flags &= ~REQ_STARTED; |
170 | 169 | ||
171 | SCpnt->done = pluto_detect_done; | 170 | SCpnt->done = pluto_detect_done; |
172 | SCpnt->request_bufflen = 256; | 171 | SCpnt->request_bufflen = 256; |
@@ -178,7 +177,8 @@ int __init pluto_detect(struct scsi_host_template *tpnt) | |||
178 | for (retry = 0; retry < 5; retry++) { | 177 | for (retry = 0; retry < 5; retry++) { |
179 | for (i = 0; i < fcscount; i++) { | 178 | for (i = 0; i < fcscount; i++) { |
180 | if (!fcs[i].fc) break; | 179 | if (!fcs[i].fc) break; |
181 | if (fcs[i].cmd.request->rq_status != RQ_SCSI_DONE) { | 180 | if (!(fcs[i].cmd.request->cmd_flags & REQ_STARTED)) { |
181 | fcs[i].cmd.request->cmd_flags |= REQ_STARTED; | ||
182 | disable_irq(fcs[i].fc->irq); | 182 | disable_irq(fcs[i].fc->irq); |
183 | PLND(("queuecommand %d %d\n", retry, i)) | 183 | PLND(("queuecommand %d %d\n", retry, i)) |
184 | fcp_scsi_queuecommand (&(fcs[i].cmd), | 184 | fcp_scsi_queuecommand (&(fcs[i].cmd), |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index d6743b959a72..71084728eb42 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -82,7 +82,7 @@ static void scsi_unprep_request(struct request *req) | |||
82 | { | 82 | { |
83 | struct scsi_cmnd *cmd = req->special; | 83 | struct scsi_cmnd *cmd = req->special; |
84 | 84 | ||
85 | req->flags &= ~REQ_DONTPREP; | 85 | req->cmd_flags &= ~REQ_DONTPREP; |
86 | req->special = NULL; | 86 | req->special = NULL; |
87 | 87 | ||
88 | scsi_put_command(cmd); | 88 | scsi_put_command(cmd); |
@@ -196,7 +196,8 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, | |||
196 | req->sense_len = 0; | 196 | req->sense_len = 0; |
197 | req->retries = retries; | 197 | req->retries = retries; |
198 | req->timeout = timeout; | 198 | req->timeout = timeout; |
199 | req->flags |= flags | REQ_BLOCK_PC | REQ_SPECIAL | REQ_QUIET; | 199 | req->cmd_type = REQ_TYPE_BLOCK_PC; |
200 | req->cmd_flags |= flags | REQ_QUIET | REQ_PREEMPT; | ||
200 | 201 | ||
201 | /* | 202 | /* |
202 | * head injection *required* here otherwise quiesce won't work | 203 | * head injection *required* here otherwise quiesce won't work |
@@ -397,7 +398,8 @@ int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd, | |||
397 | req = blk_get_request(sdev->request_queue, write, gfp); | 398 | req = blk_get_request(sdev->request_queue, write, gfp); |
398 | if (!req) | 399 | if (!req) |
399 | goto free_sense; | 400 | goto free_sense; |
400 | req->flags |= REQ_BLOCK_PC | REQ_QUIET; | 401 | req->cmd_type = REQ_TYPE_BLOCK_PC; |
402 | req->cmd_flags |= REQ_QUIET; | ||
401 | 403 | ||
402 | if (use_sg) | 404 | if (use_sg) |
403 | err = scsi_req_map_sg(req, buffer, use_sg, bufflen, gfp); | 405 | err = scsi_req_map_sg(req, buffer, use_sg, bufflen, gfp); |
@@ -933,7 +935,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) | |||
933 | break; | 935 | break; |
934 | } | 936 | } |
935 | } | 937 | } |
936 | if (!(req->flags & REQ_QUIET)) { | 938 | if (!(req->cmd_flags & REQ_QUIET)) { |
937 | scmd_printk(KERN_INFO, cmd, | 939 | scmd_printk(KERN_INFO, cmd, |
938 | "Device not ready: "); | 940 | "Device not ready: "); |
939 | scsi_print_sense_hdr("", &sshdr); | 941 | scsi_print_sense_hdr("", &sshdr); |
@@ -941,7 +943,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) | |||
941 | scsi_end_request(cmd, 0, this_count, 1); | 943 | scsi_end_request(cmd, 0, this_count, 1); |
942 | return; | 944 | return; |
943 | case VOLUME_OVERFLOW: | 945 | case VOLUME_OVERFLOW: |
944 | if (!(req->flags & REQ_QUIET)) { | 946 | if (!(req->cmd_flags & REQ_QUIET)) { |
945 | scmd_printk(KERN_INFO, cmd, | 947 | scmd_printk(KERN_INFO, cmd, |
946 | "Volume overflow, CDB: "); | 948 | "Volume overflow, CDB: "); |
947 | __scsi_print_command(cmd->cmnd); | 949 | __scsi_print_command(cmd->cmnd); |
@@ -963,7 +965,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) | |||
963 | return; | 965 | return; |
964 | } | 966 | } |
965 | if (result) { | 967 | if (result) { |
966 | if (!(req->flags & REQ_QUIET)) { | 968 | if (!(req->cmd_flags & REQ_QUIET)) { |
967 | scmd_printk(KERN_INFO, cmd, | 969 | scmd_printk(KERN_INFO, cmd, |
968 | "SCSI error: return code = 0x%08x\n", | 970 | "SCSI error: return code = 0x%08x\n", |
969 | result); | 971 | result); |
@@ -995,7 +997,7 @@ static int scsi_init_io(struct scsi_cmnd *cmd) | |||
995 | /* | 997 | /* |
996 | * if this is a rq->data based REQ_BLOCK_PC, setup for a non-sg xfer | 998 | * if this is a rq->data based REQ_BLOCK_PC, setup for a non-sg xfer |
997 | */ | 999 | */ |
998 | if ((req->flags & REQ_BLOCK_PC) && !req->bio) { | 1000 | if (blk_pc_request(req) && !req->bio) { |
999 | cmd->request_bufflen = req->data_len; | 1001 | cmd->request_bufflen = req->data_len; |
1000 | cmd->request_buffer = req->data; | 1002 | cmd->request_buffer = req->data; |
1001 | req->buffer = req->data; | 1003 | req->buffer = req->data; |
@@ -1139,13 +1141,12 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) | |||
1139 | * these two cases differently. We differentiate by looking | 1141 | * these two cases differently. We differentiate by looking |
1140 | * at request->cmd, as this tells us the real story. | 1142 | * at request->cmd, as this tells us the real story. |
1141 | */ | 1143 | */ |
1142 | if (req->flags & REQ_SPECIAL && req->special) { | 1144 | if (blk_special_request(req) && req->special) |
1143 | cmd = req->special; | 1145 | cmd = req->special; |
1144 | } else if (req->flags & (REQ_CMD | REQ_BLOCK_PC)) { | 1146 | else if (blk_pc_request(req) || blk_fs_request(req)) { |
1145 | 1147 | if (unlikely(specials_only) && !(req->cmd_flags & REQ_PREEMPT)){ | |
1146 | if(unlikely(specials_only) && !(req->flags & REQ_SPECIAL)) { | 1148 | if (specials_only == SDEV_QUIESCE || |
1147 | if(specials_only == SDEV_QUIESCE || | 1149 | specials_only == SDEV_BLOCK) |
1148 | specials_only == SDEV_BLOCK) | ||
1149 | goto defer; | 1150 | goto defer; |
1150 | 1151 | ||
1151 | sdev_printk(KERN_ERR, sdev, | 1152 | sdev_printk(KERN_ERR, sdev, |
@@ -1153,7 +1154,6 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) | |||
1153 | goto kill; | 1154 | goto kill; |
1154 | } | 1155 | } |
1155 | 1156 | ||
1156 | |||
1157 | /* | 1157 | /* |
1158 | * Now try and find a command block that we can use. | 1158 | * Now try and find a command block that we can use. |
1159 | */ | 1159 | */ |
@@ -1184,7 +1184,7 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) | |||
1184 | * lock. We hope REQ_STARTED prevents anything untoward from | 1184 | * lock. We hope REQ_STARTED prevents anything untoward from |
1185 | * happening now. | 1185 | * happening now. |
1186 | */ | 1186 | */ |
1187 | if (req->flags & (REQ_CMD | REQ_BLOCK_PC)) { | 1187 | if (blk_fs_request(req) || blk_pc_request(req)) { |
1188 | int ret; | 1188 | int ret; |
1189 | 1189 | ||
1190 | /* | 1190 | /* |
@@ -1216,7 +1216,7 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) | |||
1216 | /* | 1216 | /* |
1217 | * Initialize the actual SCSI command for this request. | 1217 | * Initialize the actual SCSI command for this request. |
1218 | */ | 1218 | */ |
1219 | if (req->flags & REQ_BLOCK_PC) { | 1219 | if (blk_pc_request(req)) { |
1220 | scsi_setup_blk_pc_cmnd(cmd); | 1220 | scsi_setup_blk_pc_cmnd(cmd); |
1221 | } else if (req->rq_disk) { | 1221 | } else if (req->rq_disk) { |
1222 | struct scsi_driver *drv; | 1222 | struct scsi_driver *drv; |
@@ -1233,7 +1233,7 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) | |||
1233 | /* | 1233 | /* |
1234 | * The request is now prepped, no need to come back here | 1234 | * The request is now prepped, no need to come back here |
1235 | */ | 1235 | */ |
1236 | req->flags |= REQ_DONTPREP; | 1236 | req->cmd_flags |= REQ_DONTPREP; |
1237 | return BLKPREP_OK; | 1237 | return BLKPREP_OK; |
1238 | 1238 | ||
1239 | defer: | 1239 | defer: |
@@ -1454,8 +1454,9 @@ static void scsi_request_fn(struct request_queue *q) | |||
1454 | if (unlikely(cmd == NULL)) { | 1454 | if (unlikely(cmd == NULL)) { |
1455 | printk(KERN_CRIT "impossible request in %s.\n" | 1455 | printk(KERN_CRIT "impossible request in %s.\n" |
1456 | "please mail a stack trace to " | 1456 | "please mail a stack trace to " |
1457 | "linux-scsi@vger.kernel.org", | 1457 | "linux-scsi@vger.kernel.org\n", |
1458 | __FUNCTION__); | 1458 | __FUNCTION__); |
1459 | blk_dump_rq_flags(req, "foo"); | ||
1459 | BUG(); | 1460 | BUG(); |
1460 | } | 1461 | } |
1461 | spin_lock(shost->host_lock); | 1462 | spin_lock(shost->host_lock); |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 638cff41d436..10bc99c911fa 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -443,8 +443,7 @@ static int sd_init_command(struct scsi_cmnd * SCpnt) | |||
443 | SCpnt->cmnd[0] = READ_6; | 443 | SCpnt->cmnd[0] = READ_6; |
444 | SCpnt->sc_data_direction = DMA_FROM_DEVICE; | 444 | SCpnt->sc_data_direction = DMA_FROM_DEVICE; |
445 | } else { | 445 | } else { |
446 | printk(KERN_ERR "sd: Unknown command %lx\n", rq->flags); | 446 | printk(KERN_ERR "sd: Unknown command %x\n", rq->cmd_flags); |
447 | /* overkill panic("Unknown sd command %lx\n", rq->flags); */ | ||
448 | return 0; | 447 | return 0; |
449 | } | 448 | } |
450 | 449 | ||
@@ -840,7 +839,7 @@ static int sd_issue_flush(struct device *dev, sector_t *error_sector) | |||
840 | static void sd_prepare_flush(request_queue_t *q, struct request *rq) | 839 | static void sd_prepare_flush(request_queue_t *q, struct request *rq) |
841 | { | 840 | { |
842 | memset(rq->cmd, 0, sizeof(rq->cmd)); | 841 | memset(rq->cmd, 0, sizeof(rq->cmd)); |
843 | rq->flags |= REQ_BLOCK_PC; | 842 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
844 | rq->timeout = SD_TIMEOUT; | 843 | rq->timeout = SD_TIMEOUT; |
845 | rq->cmd[0] = SYNCHRONIZE_CACHE; | 844 | rq->cmd[0] = SYNCHRONIZE_CACHE; |
846 | rq->cmd_len = 10; | 845 | rq->cmd_len = 10; |
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index 2f8073b73bf3..7f9bcef6adfa 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c | |||
@@ -2017,7 +2017,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) | |||
2017 | if((count > SUN3_DMA_MINSIZE) && (sun3_dma_setup_done | 2017 | if((count > SUN3_DMA_MINSIZE) && (sun3_dma_setup_done |
2018 | != cmd)) | 2018 | != cmd)) |
2019 | { | 2019 | { |
2020 | if(cmd->request->flags & REQ_CMD) { | 2020 | if(blk_fs_request(cmd->request)) { |
2021 | sun3scsi_dma_setup(d, count, | 2021 | sun3scsi_dma_setup(d, count, |
2022 | rq_data_dir(cmd->request)); | 2022 | rq_data_dir(cmd->request)); |
2023 | sun3_dma_setup_done = cmd; | 2023 | sun3_dma_setup_done = cmd; |
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c index 837173415d4c..44a99aeb8180 100644 --- a/drivers/scsi/sun3_scsi.c +++ b/drivers/scsi/sun3_scsi.c | |||
@@ -524,7 +524,7 @@ static inline unsigned long sun3scsi_dma_residual(struct Scsi_Host *instance) | |||
524 | static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted, Scsi_Cmnd *cmd, | 524 | static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted, Scsi_Cmnd *cmd, |
525 | int write_flag) | 525 | int write_flag) |
526 | { | 526 | { |
527 | if(cmd->request->flags & REQ_CMD) | 527 | if(blk_fs_request(cmd->request)) |
528 | return wanted; | 528 | return wanted; |
529 | else | 529 | else |
530 | return 0; | 530 | return 0; |
diff --git a/drivers/scsi/sun3_scsi_vme.c b/drivers/scsi/sun3_scsi_vme.c index 008a82ab8521..f5742b84b27a 100644 --- a/drivers/scsi/sun3_scsi_vme.c +++ b/drivers/scsi/sun3_scsi_vme.c | |||
@@ -458,7 +458,7 @@ static inline unsigned long sun3scsi_dma_residual(struct Scsi_Host *instance) | |||
458 | static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted, Scsi_Cmnd *cmd, | 458 | static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted, Scsi_Cmnd *cmd, |
459 | int write_flag) | 459 | int write_flag) |
460 | { | 460 | { |
461 | if(cmd->request->flags & REQ_CMD) | 461 | if(blk_fs_request(cmd->request)) |
462 | return wanted; | 462 | return wanted; |
463 | else | 463 | else |
464 | return 0; | 464 | return 0; |