aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-09-30 15:07:01 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-30 15:07:01 -0400
commit56f29d7fe452890eeeb7f2b0138b2d95b9745fb6 (patch)
tree01b6b70297c53c9beb8d11eb186fbad9c166b1a2 /drivers
parente823aff2d6eb43083abcc75a32ddfb167c324089 (diff)
parent059af497c23492cb1ddcbba11c09dad385960bc0 (diff)
Merge branch 'block' of git://brick.kernel.dk/data/git/linux-2.6-block
* 'block' of git://brick.kernel.dk/data/git/linux-2.6-block: (67 commits) [PATCH] blk_queue_start_tag() shared map race fix [PATCH] Update axboe@suse.de email address [PATCH] fix creating zero sized bio mempools in low memory system [PATCH] CONFIG_BLOCK: blk_congestion_wait() fix [PATCH] CONFIG_BLOCK internal.h cleanups [PATCH] BLOCK: Make USB storage depend on SCSI rather than selecting it [try #6] [PATCH] BLOCK: Make it possible to disable the block layer [try #6] [PATCH] BLOCK: Remove no-longer necessary linux/buffer_head.h inclusions [try #6] [PATCH] BLOCK: Remove no-longer necessary linux/mpage.h inclusions [try #6] [PATCH] BLOCK: Move the msdos device ioctl compat stuff to the msdos driver [try #6] [PATCH] BLOCK: Move the Ext3 device ioctl compat stuff to the Ext3 driver [try #6] [PATCH] BLOCK: Move the Ext2 device ioctl compat stuff to the Ext2 driver [try #6] [PATCH] BLOCK: Move the ReiserFS device ioctl compat stuff to the ReiserFS driver [try #6] [PATCH] BLOCK: Move common FS-specific ioctls to linux/fs.h [try #6] [PATCH] BLOCK: Move the loop device ioctl compat stuff to the loop driver [try #6] [PATCH] BLOCK: Move __invalidate_device() to block_dev.c [try #6] [PATCH] BLOCK: Dissociate generic_writepages() from mpage stuff [try #6] [PATCH] BLOCK: Remove dependence on existence of blockdev_superblock [try #6] [PATCH] BLOCK: Move extern declarations out of fs/*.c into header files [try #6] [PATCH] BLOCK: Don't call block_sync_page() from AFS [try #6] ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/DAC960.c2
-rw-r--r--drivers/block/Kconfig4
-rw-r--r--drivers/block/cciss.c1
-rw-r--r--drivers/block/cpqarray.c1
-rw-r--r--drivers/block/floppy.c4
-rw-r--r--drivers/block/loop.c160
-rw-r--r--drivers/block/nbd.c8
-rw-r--r--drivers/block/paride/pd.c6
-rw-r--r--drivers/block/pktcdvd.c8
-rw-r--r--drivers/block/swim3.c4
-rw-r--r--drivers/block/swim_iop.c4
-rw-r--r--drivers/block/xd.c2
-rw-r--r--drivers/cdrom/Kconfig2
-rw-r--r--drivers/cdrom/cdrom.c2
-rw-r--r--drivers/cdrom/cdu31a.c4
-rw-r--r--drivers/char/Kconfig1
-rw-r--r--drivers/char/random.c4
-rw-r--r--drivers/fc4/fc.c1
-rw-r--r--drivers/ide/Kconfig4
-rw-r--r--drivers/ide/ide-cd.c69
-rw-r--r--drivers/ide/ide-disk.c5
-rw-r--r--drivers/ide/ide-dma.c2
-rw-r--r--drivers/ide/ide-floppy.c17
-rw-r--r--drivers/ide/ide-io.c50
-rw-r--r--drivers/ide/ide-lib.c5
-rw-r--r--drivers/ide/ide-tape.c14
-rw-r--r--drivers/ide/ide-taskfile.c8
-rw-r--r--drivers/ide/ide.c8
-rw-r--r--drivers/ide/legacy/hd.c2
-rw-r--r--drivers/md/Kconfig3
-rw-r--r--drivers/md/dm-emc.c3
-rw-r--r--drivers/message/i2o/Kconfig2
-rw-r--r--drivers/message/i2o/i2o_block.c7
-rw-r--r--drivers/mmc/Kconfig2
-rw-r--r--drivers/mmc/Makefile3
-rw-r--r--drivers/mmc/mmc_queue.c6
-rw-r--r--drivers/mtd/Kconfig12
-rw-r--r--drivers/mtd/devices/Kconfig2
-rw-r--r--drivers/mtd/mtd_blkdevs.c2
-rw-r--r--drivers/s390/block/Kconfig2
-rw-r--r--drivers/s390/block/dasd_diag.c2
-rw-r--r--drivers/s390/block/dasd_eckd.c2
-rw-r--r--drivers/s390/block/dasd_fba.c2
-rw-r--r--drivers/scsi/Kconfig2
-rw-r--r--drivers/scsi/aic7xxx_old.c4
-rw-r--r--drivers/scsi/ide-scsi.c16
-rw-r--r--drivers/scsi/pluto.c6
-rw-r--r--drivers/scsi/scsi.c13
-rw-r--r--drivers/scsi/scsi_lib.c37
-rw-r--r--drivers/scsi/sd.c5
-rw-r--r--drivers/scsi/sun3_NCR5380.c2
-rw-r--r--drivers/scsi/sun3_scsi.c2
-rw-r--r--drivers/scsi/sun3_scsi_vme.c2
-rw-r--r--drivers/usb/storage/Kconfig5
54 files changed, 357 insertions, 189 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index a360215dbce7..2568640430fb 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -3331,7 +3331,7 @@ static int DAC960_process_queue(DAC960_Controller_T *Controller, struct request_
3331 Command->DmaDirection = PCI_DMA_TODEVICE; 3331 Command->DmaDirection = PCI_DMA_TODEVICE;
3332 Command->CommandType = DAC960_WriteCommand; 3332 Command->CommandType = DAC960_WriteCommand;
3333 } 3333 }
3334 Command->Completion = Request->waiting; 3334 Command->Completion = Request->end_io_data;
3335 Command->LogicalDriveNumber = (long)Request->rq_disk->private_data; 3335 Command->LogicalDriveNumber = (long)Request->rq_disk->private_data;
3336 Command->BlockNumber = Request->sector; 3336 Command->BlockNumber = Request->sector;
3337 Command->BlockCount = Request->nr_sectors; 3337 Command->BlockCount = Request->nr_sectors;
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index b5382cedf0c0..422e31d5f8e5 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -2,6 +2,8 @@
2# Block device driver configuration 2# Block device driver configuration
3# 3#
4 4
5if BLOCK
6
5menu "Block devices" 7menu "Block devices"
6 8
7config BLK_DEV_FD 9config BLK_DEV_FD
@@ -468,3 +470,5 @@ config ATA_OVER_ETH
468 devices like the Coraid EtherDrive (R) Storage Blade. 470 devices like the Coraid EtherDrive (R) Storage Blade.
469 471
470endmenu 472endmenu
473
474endif
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 2cd3391ff878..c211065ad829 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1229,7 +1229,6 @@ static inline void complete_buffers(struct bio *bio, int status)
1229 int nr_sectors = bio_sectors(bio); 1229 int nr_sectors = bio_sectors(bio);
1230 1230
1231 bio->bi_next = NULL; 1231 bio->bi_next = NULL;
1232 blk_finished_io(len);
1233 bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO); 1232 bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO);
1234 bio = xbh; 1233 bio = xbh;
1235 } 1234 }
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 78082edc14b4..4abc193314ee 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -989,7 +989,6 @@ static inline void complete_buffers(struct bio *bio, int ok)
989 xbh = bio->bi_next; 989 xbh = bio->bi_next;
990 bio->bi_next = NULL; 990 bio->bi_next = NULL;
991 991
992 blk_finished_io(nr_sectors);
993 bio_endio(bio, nr_sectors << 9, ok ? 0 : -EIO); 992 bio_endio(bio, nr_sectors << 9, ok ? 0 : -EIO);
994 993
995 bio = xbh; 994 bio = xbh;
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/loop.c b/drivers/block/loop.c
index 68b0471ad5a6..d6bb8da955a2 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -66,6 +66,7 @@
66#include <linux/swap.h> 66#include <linux/swap.h>
67#include <linux/slab.h> 67#include <linux/slab.h>
68#include <linux/loop.h> 68#include <linux/loop.h>
69#include <linux/compat.h>
69#include <linux/suspend.h> 70#include <linux/suspend.h>
70#include <linux/writeback.h> 71#include <linux/writeback.h>
71#include <linux/buffer_head.h> /* for invalidate_bdev() */ 72#include <linux/buffer_head.h> /* for invalidate_bdev() */
@@ -1165,6 +1166,162 @@ static int lo_ioctl(struct inode * inode, struct file * file,
1165 return err; 1166 return err;
1166} 1167}
1167 1168
1169#ifdef CONFIG_COMPAT
1170struct compat_loop_info {
1171 compat_int_t lo_number; /* ioctl r/o */
1172 compat_dev_t lo_device; /* ioctl r/o */
1173 compat_ulong_t lo_inode; /* ioctl r/o */
1174 compat_dev_t lo_rdevice; /* ioctl r/o */
1175 compat_int_t lo_offset;
1176 compat_int_t lo_encrypt_type;
1177 compat_int_t lo_encrypt_key_size; /* ioctl w/o */
1178 compat_int_t lo_flags; /* ioctl r/o */
1179 char lo_name[LO_NAME_SIZE];
1180 unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
1181 compat_ulong_t lo_init[2];
1182 char reserved[4];
1183};
1184
1185/*
1186 * Transfer 32-bit compatibility structure in userspace to 64-bit loop info
1187 * - noinlined to reduce stack space usage in main part of driver
1188 */
1189static noinline int
1190loop_info64_from_compat(const struct compat_loop_info *arg,
1191 struct loop_info64 *info64)
1192{
1193 struct compat_loop_info info;
1194
1195 if (copy_from_user(&info, arg, sizeof(info)))
1196 return -EFAULT;
1197
1198 memset(info64, 0, sizeof(*info64));
1199 info64->lo_number = info.lo_number;
1200 info64->lo_device = info.lo_device;
1201 info64->lo_inode = info.lo_inode;
1202 info64->lo_rdevice = info.lo_rdevice;
1203 info64->lo_offset = info.lo_offset;
1204 info64->lo_sizelimit = 0;
1205 info64->lo_encrypt_type = info.lo_encrypt_type;
1206 info64->lo_encrypt_key_size = info.lo_encrypt_key_size;
1207 info64->lo_flags = info.lo_flags;
1208 info64->lo_init[0] = info.lo_init[0];
1209 info64->lo_init[1] = info.lo_init[1];
1210 if (info.lo_encrypt_type == LO_CRYPT_CRYPTOAPI)
1211 memcpy(info64->lo_crypt_name, info.lo_name, LO_NAME_SIZE);
1212 else
1213 memcpy(info64->lo_file_name, info.lo_name, LO_NAME_SIZE);
1214 memcpy(info64->lo_encrypt_key, info.lo_encrypt_key, LO_KEY_SIZE);
1215 return 0;
1216}
1217
1218/*
1219 * Transfer 64-bit loop info to 32-bit compatibility structure in userspace
1220 * - noinlined to reduce stack space usage in main part of driver
1221 */
1222static noinline int
1223loop_info64_to_compat(const struct loop_info64 *info64,
1224 struct compat_loop_info __user *arg)
1225{
1226 struct compat_loop_info info;
1227
1228 memset(&info, 0, sizeof(info));
1229 info.lo_number = info64->lo_number;
1230 info.lo_device = info64->lo_device;
1231 info.lo_inode = info64->lo_inode;
1232 info.lo_rdevice = info64->lo_rdevice;
1233 info.lo_offset = info64->lo_offset;
1234 info.lo_encrypt_type = info64->lo_encrypt_type;
1235 info.lo_encrypt_key_size = info64->lo_encrypt_key_size;
1236 info.lo_flags = info64->lo_flags;
1237 info.lo_init[0] = info64->lo_init[0];
1238 info.lo_init[1] = info64->lo_init[1];
1239 if (info.lo_encrypt_type == LO_CRYPT_CRYPTOAPI)
1240 memcpy(info.lo_name, info64->lo_crypt_name, LO_NAME_SIZE);
1241 else
1242 memcpy(info.lo_name, info64->lo_file_name, LO_NAME_SIZE);
1243 memcpy(info.lo_encrypt_key, info64->lo_encrypt_key, LO_KEY_SIZE);
1244
1245 /* error in case values were truncated */
1246 if (info.lo_device != info64->lo_device ||
1247 info.lo_rdevice != info64->lo_rdevice ||
1248 info.lo_inode != info64->lo_inode ||
1249 info.lo_offset != info64->lo_offset ||
1250 info.lo_init[0] != info64->lo_init[0] ||
1251 info.lo_init[1] != info64->lo_init[1])
1252 return -EOVERFLOW;
1253
1254 if (copy_to_user(arg, &info, sizeof(info)))
1255 return -EFAULT;
1256 return 0;
1257}
1258
1259static int
1260loop_set_status_compat(struct loop_device *lo,
1261 const struct compat_loop_info __user *arg)
1262{
1263 struct loop_info64 info64;
1264 int ret;
1265
1266 ret = loop_info64_from_compat(arg, &info64);
1267 if (ret < 0)
1268 return ret;
1269 return loop_set_status(lo, &info64);
1270}
1271
1272static int
1273loop_get_status_compat(struct loop_device *lo,
1274 struct compat_loop_info __user *arg)
1275{
1276 struct loop_info64 info64;
1277 int err = 0;
1278
1279 if (!arg)
1280 err = -EINVAL;
1281 if (!err)
1282 err = loop_get_status(lo, &info64);
1283 if (!err)
1284 err = loop_info64_to_compat(&info64, arg);
1285 return err;
1286}
1287
1288static long lo_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1289{
1290 struct inode *inode = file->f_dentry->d_inode;
1291 struct loop_device *lo = inode->i_bdev->bd_disk->private_data;
1292 int err;
1293
1294 lock_kernel();
1295 switch(cmd) {
1296 case LOOP_SET_STATUS:
1297 mutex_lock(&lo->lo_ctl_mutex);
1298 err = loop_set_status_compat(
1299 lo, (const struct compat_loop_info __user *) arg);
1300 mutex_unlock(&lo->lo_ctl_mutex);
1301 break;
1302 case LOOP_GET_STATUS:
1303 mutex_lock(&lo->lo_ctl_mutex);
1304 err = loop_get_status_compat(
1305 lo, (struct compat_loop_info __user *) arg);
1306 mutex_unlock(&lo->lo_ctl_mutex);
1307 break;
1308 case LOOP_CLR_FD:
1309 case LOOP_GET_STATUS64:
1310 case LOOP_SET_STATUS64:
1311 arg = (unsigned long) compat_ptr(arg);
1312 case LOOP_SET_FD:
1313 case LOOP_CHANGE_FD:
1314 err = lo_ioctl(inode, file, cmd, arg);
1315 break;
1316 default:
1317 err = -ENOIOCTLCMD;
1318 break;
1319 }
1320 unlock_kernel();
1321 return err;
1322}
1323#endif
1324
1168static int lo_open(struct inode *inode, struct file *file) 1325static int lo_open(struct inode *inode, struct file *file)
1169{ 1326{
1170 struct loop_device *lo = inode->i_bdev->bd_disk->private_data; 1327 struct loop_device *lo = inode->i_bdev->bd_disk->private_data;
@@ -1192,6 +1349,9 @@ static struct block_device_operations lo_fops = {
1192 .open = lo_open, 1349 .open = lo_open,
1193 .release = lo_release, 1350 .release = lo_release,
1194 .ioctl = lo_ioctl, 1351 .ioctl = lo_ioctl,
1352#ifdef CONFIG_COMPAT
1353 .compat_ioctl = lo_compat_ioctl,
1354#endif
1195}; 1355};
1196 1356
1197/* 1357/*
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..38578b9dbfd1 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
438static enum action do_pd_io_start(void) 438static 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 }
@@ -719,14 +719,12 @@ static int pd_special_command(struct pd_unit *disk,
719 719
720 memset(&rq, 0, sizeof(rq)); 720 memset(&rq, 0, sizeof(rq));
721 rq.errors = 0; 721 rq.errors = 0;
722 rq.rq_status = RQ_ACTIVE;
723 rq.rq_disk = disk->gd; 722 rq.rq_disk = disk->gd;
724 rq.ref_count = 1; 723 rq.ref_count = 1;
725 rq.waiting = &wait; 724 rq.end_io_data = &wait;
726 rq.end_io = blk_end_sync_rq; 725 rq.end_io = blk_end_sync_rq;
727 blk_insert_request(disk->gd->queue, &rq, 0, func); 726 blk_insert_request(disk->gd->queue, &rq, 0, func);
728 wait_for_completion(&wait); 727 wait_for_completion(&wait);
729 rq.waiting = NULL;
730 if (rq.errors) 728 if (rq.errors)
731 err = -EIO; 729 err = -EIO;
732 blk_put_request(&rq); 730 blk_put_request(&rq);
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 451b996bba91..888d1aceeeff 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -365,17 +365,17 @@ 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->end_io_data = &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);
381 generic_unplug_device(q); 381 generic_unplug_device(q);
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index cc42e762396f..f2305ee792a1 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -319,8 +319,8 @@ static void start_request(struct floppy_state *fs)
319 printk("do_fd_req: dev=%s cmd=%d sec=%ld nr_sec=%ld buf=%p\n", 319 printk("do_fd_req: dev=%s cmd=%d sec=%ld nr_sec=%ld buf=%p\n",
320 req->rq_disk->disk_name, req->cmd, 320 req->rq_disk->disk_name, req->cmd,
321 (long)req->sector, req->nr_sectors, req->buffer); 321 (long)req->sector, req->nr_sectors, req->buffer);
322 printk(" rq_status=%d errors=%d current_nr_sectors=%ld\n", 322 printk(" errors=%d current_nr_sectors=%ld\n",
323 req->rq_status, req->errors, req->current_nr_sectors); 323 req->errors, req->current_nr_sectors);
324#endif 324#endif
325 325
326 if (req->sector < 0 || req->sector >= fs->total_secs) { 326 if (req->sector < 0 || req->sector >= fs->total_secs) {
diff --git a/drivers/block/swim_iop.c b/drivers/block/swim_iop.c
index 89e3c2f8b776..dfda796eba56 100644
--- a/drivers/block/swim_iop.c
+++ b/drivers/block/swim_iop.c
@@ -529,8 +529,8 @@ static void start_request(struct floppy_state *fs)
529 printk("do_fd_req: dev=%s cmd=%d sec=%ld nr_sec=%ld buf=%p\n", 529 printk("do_fd_req: dev=%s cmd=%d sec=%ld nr_sec=%ld buf=%p\n",
530 CURRENT->rq_disk->disk_name, CURRENT->cmd, 530 CURRENT->rq_disk->disk_name, CURRENT->cmd,
531 CURRENT->sector, CURRENT->nr_sectors, CURRENT->buffer); 531 CURRENT->sector, CURRENT->nr_sectors, CURRENT->buffer);
532 printk(" rq_status=%d errors=%d current_nr_sectors=%ld\n", 532 printk(" errors=%d current_nr_sectors=%ld\n",
533 CURRENT->rq_status, CURRENT->errors, CURRENT->current_nr_sectors); 533 CURRENT->errors, CURRENT->current_nr_sectors);
534#endif 534#endif
535 535
536 if (CURRENT->sector < 0 || CURRENT->sector >= fs->total_secs) { 536 if (CURRENT->sector < 0 || CURRENT->sector >= fs->total_secs) {
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/Kconfig b/drivers/cdrom/Kconfig
index ff5652d40619..4b12e9031fb3 100644
--- a/drivers/cdrom/Kconfig
+++ b/drivers/cdrom/Kconfig
@@ -3,7 +3,7 @@
3# 3#
4 4
5menu "Old CD-ROM drivers (not SCSI, not IDE)" 5menu "Old CD-ROM drivers (not SCSI, not IDE)"
6 depends on ISA 6 depends on ISA && BLOCK
7 7
8config CD_NO_IDESCSI 8config CD_NO_IDESCSI
9 bool "Support non-SCSI/IDE/ATAPI CDROM drives" 9 bool "Support non-SCSI/IDE/ATAPI CDROM drives"
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/char/Kconfig b/drivers/char/Kconfig
index 4cc619edf424..bde1c665d9f4 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -1006,6 +1006,7 @@ config GPIO_VR41XX
1006 1006
1007config RAW_DRIVER 1007config RAW_DRIVER
1008 tristate "RAW driver (/dev/raw/rawN) (OBSOLETE)" 1008 tristate "RAW driver (/dev/raw/rawN) (OBSOLETE)"
1009 depends on BLOCK
1009 help 1010 help
1010 The raw driver permits block devices to be bound to /dev/raw/rawN. 1011 The raw driver permits block devices to be bound to /dev/raw/rawN.
1011 Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O. 1012 Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O.
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 4c3a5ca9d8f7..b430a12eb819 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -655,6 +655,7 @@ void add_interrupt_randomness(int irq)
655 add_timer_randomness(irq_timer_state[irq], 0x100 + irq); 655 add_timer_randomness(irq_timer_state[irq], 0x100 + irq);
656} 656}
657 657
658#ifdef CONFIG_BLOCK
658void add_disk_randomness(struct gendisk *disk) 659void add_disk_randomness(struct gendisk *disk)
659{ 660{
660 if (!disk || !disk->random) 661 if (!disk || !disk->random)
@@ -667,6 +668,7 @@ void add_disk_randomness(struct gendisk *disk)
667} 668}
668 669
669EXPORT_SYMBOL(add_disk_randomness); 670EXPORT_SYMBOL(add_disk_randomness);
671#endif
670 672
671#define EXTRACT_SIZE 10 673#define EXTRACT_SIZE 10
672 674
@@ -918,6 +920,7 @@ void rand_initialize_irq(int irq)
918 } 920 }
919} 921}
920 922
923#ifdef CONFIG_BLOCK
921void rand_initialize_disk(struct gendisk *disk) 924void rand_initialize_disk(struct gendisk *disk)
922{ 925{
923 struct timer_rand_state *state; 926 struct timer_rand_state *state;
@@ -932,6 +935,7 @@ void rand_initialize_disk(struct gendisk *disk)
932 disk->random = state; 935 disk->random = state;
933 } 936 }
934} 937}
938#endif
935 939
936static ssize_t 940static ssize_t
937random_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) 941random_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos)
diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c
index 1a159e8843ca..22d17474755f 100644
--- a/drivers/fc4/fc.c
+++ b/drivers/fc4/fc.c
@@ -974,7 +974,6 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
974 */ 974 */
975 975
976 fc->rst_pkt->device->host->eh_action = &sem; 976 fc->rst_pkt->device->host->eh_action = &sem;
977 fc->rst_pkt->request->rq_status = RQ_SCSI_BUSY;
978 977
979 fc->rst_pkt->done = fcp_scsi_reset_done; 978 fc->rst_pkt->done = fcp_scsi_reset_done;
980 979
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index b6fb167e20f6..69d627bd537a 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -4,6 +4,8 @@
4# Andre Hedrick <andre@linux-ide.org> 4# Andre Hedrick <andre@linux-ide.org>
5# 5#
6 6
7if BLOCK
8
7menu "ATA/ATAPI/MFM/RLL support" 9menu "ATA/ATAPI/MFM/RLL support"
8 10
9config IDE 11config IDE
@@ -1082,3 +1084,5 @@ config BLK_DEV_HD
1082endif 1084endif
1083 1085
1084endmenu 1086endmenu
1087
1088endif
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 {
1515confused: 1515confused:
@@ -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
3117static int ide_cdrom_prep_fn(request_queue_t *q, struct request *rq) 3118static 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..8ccee9c769f8 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;
@@ -1281,8 +1281,7 @@ static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request
1281 idefloppy_pc_t *pc; 1281 idefloppy_pc_t *pc;
1282 unsigned long block = (unsigned long)block_s; 1282 unsigned long block = (unsigned long)block_s;
1283 1283
1284 debug_log(KERN_INFO "rq_status: %d, dev: %s, flags: %lx, errors: %d\n", 1284 debug_log(KERN_INFO "dev: %s, flags: %lx, errors: %d\n",
1285 rq->rq_status,
1286 rq->rq_disk ? rq->rq_disk->disk_name : "?", 1285 rq->rq_disk ? rq->rq_disk->disk_name : "?",
1287 rq->flags, rq->errors); 1286 rq->flags, rq->errors);
1288 debug_log(KERN_INFO "sector: %ld, nr_sectors: %ld, " 1287 debug_log(KERN_INFO "sector: %ld, nr_sectors: %ld, "
@@ -1303,7 +1302,7 @@ static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request
1303 idefloppy_do_end_request(drive, 0, 0); 1302 idefloppy_do_end_request(drive, 0, 0);
1304 return ide_stopped; 1303 return ide_stopped;
1305 } 1304 }
1306 if (rq->flags & REQ_CMD) { 1305 if (blk_fs_request(rq)) {
1307 if (((long)rq->sector % floppy->bs_factor) || 1306 if (((long)rq->sector % floppy->bs_factor) ||
1308 (rq->nr_sectors % floppy->bs_factor)) { 1307 (rq->nr_sectors % floppy->bs_factor)) {
1309 printk("%s: unsupported r/w request size\n", 1308 printk("%s: unsupported r/w request size\n",
@@ -1313,9 +1312,9 @@ static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request
1313 } 1312 }
1314 pc = idefloppy_next_pc_storage(drive); 1313 pc = idefloppy_next_pc_storage(drive);
1315 idefloppy_create_rw_cmd(floppy, pc, rq, block); 1314 idefloppy_create_rw_cmd(floppy, pc, rq, block);
1316 } else if (rq->flags & REQ_SPECIAL) { 1315 } else if (blk_special_request(rq)) {
1317 pc = (idefloppy_pc_t *) rq->buffer; 1316 pc = (idefloppy_pc_t *) rq->buffer;
1318 } else if (rq->flags & REQ_BLOCK_PC) { 1317 } else if (blk_pc_request(rq)) {
1319 pc = idefloppy_next_pc_storage(drive); 1318 pc = idefloppy_next_pc_storage(drive);
1320 if (idefloppy_blockpc_cmd(floppy, pc, rq)) { 1319 if (idefloppy_blockpc_cmd(floppy, pc, rq)) {
1321 idefloppy_do_end_request(drive, 0, 0); 1320 idefloppy_do_end_request(drive, 0, 0);
@@ -1343,7 +1342,7 @@ static int idefloppy_queue_pc_tail (ide_drive_t *drive,idefloppy_pc_t *pc)
1343 1342
1344 ide_init_drive_cmd (&rq); 1343 ide_init_drive_cmd (&rq);
1345 rq.buffer = (char *) pc; 1344 rq.buffer = (char *) pc;
1346 rq.flags = REQ_SPECIAL; // rq.cmd = IDEFLOPPY_PC_RQ; 1345 rq.cmd_type = REQ_TYPE_SPECIAL;
1347 rq.rq_disk = floppy->disk; 1346 rq.rq_disk = floppy->disk;
1348 1347
1349 return ide_do_drive_cmd(drive, &rq, ide_wait); 1348 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..38479a29d3e1 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
@@ -141,7 +141,7 @@ enum {
141 141
142static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error) 142static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error)
143{ 143{
144 struct request_pm_state *pm = rq->end_io_data; 144 struct request_pm_state *pm = rq->data;
145 145
146 if (drive->media != ide_disk) 146 if (drive->media != ide_disk)
147 return; 147 return;
@@ -164,7 +164,7 @@ static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 s
164 164
165static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq) 165static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq)
166{ 166{
167 struct request_pm_state *pm = rq->end_io_data; 167 struct request_pm_state *pm = rq->data;
168 ide_task_t *args = rq->special; 168 ide_task_t *args = rq->special;
169 169
170 memset(args, 0, sizeof(*args)); 170 memset(args, 0, sizeof(*args));
@@ -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);
@@ -421,7 +421,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
421 } 421 }
422 } 422 }
423 } else if (blk_pm_request(rq)) { 423 } else if (blk_pm_request(rq)) {
424 struct request_pm_state *pm = rq->end_io_data; 424 struct request_pm_state *pm = rq->data;
425#ifdef DEBUG_PM 425#ifdef DEBUG_PM
426 printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n", 426 printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n",
427 drive->name, rq->pm->pm_step, stat, err); 427 drive->name, rq->pm->pm_step, stat, err);
@@ -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)
@@ -933,7 +933,7 @@ done:
933 933
934static void ide_check_pm_state(ide_drive_t *drive, struct request *rq) 934static void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
935{ 935{
936 struct request_pm_state *pm = rq->end_io_data; 936 struct request_pm_state *pm = rq->data;
937 937
938 if (blk_pm_suspend_request(rq) && 938 if (blk_pm_suspend_request(rq) &&
939 pm->pm_step == ide_pm_state_start_suspend) 939 pm->pm_step == ide_pm_state_start_suspend)
@@ -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,12 +1013,12 @@ 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->data;
1022#ifdef DEBUG_PM 1022#ifdef DEBUG_PM
1023 printk("%s: start_power_step(step: %d)\n", 1023 printk("%s: start_power_step(step: %d)\n",
1024 drive->name, rq->pm->pm_step); 1024 drive->name, rq->pm->pm_step);
@@ -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)
1670void ide_init_drive_cmd (struct request *rq) 1670void 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
@@ -1710,7 +1710,6 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
1710 int must_wait = (action == ide_wait || action == ide_head_wait); 1710 int must_wait = (action == ide_wait || action == ide_head_wait);
1711 1711
1712 rq->errors = 0; 1712 rq->errors = 0;
1713 rq->rq_status = RQ_ACTIVE;
1714 1713
1715 /* 1714 /*
1716 * we need to hold an extra reference to request for safe inspection 1715 * we need to hold an extra reference to request for safe inspection
@@ -1718,7 +1717,7 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
1718 */ 1717 */
1719 if (must_wait) { 1718 if (must_wait) {
1720 rq->ref_count++; 1719 rq->ref_count++;
1721 rq->waiting = &wait; 1720 rq->end_io_data = &wait;
1722 rq->end_io = blk_end_sync_rq; 1721 rq->end_io = blk_end_sync_rq;
1723 } 1722 }
1724 1723
@@ -1727,7 +1726,7 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
1727 hwgroup->rq = NULL; 1726 hwgroup->rq = NULL;
1728 if (action == ide_preempt || action == ide_head_wait) { 1727 if (action == ide_preempt || action == ide_head_wait) {
1729 where = ELEVATOR_INSERT_FRONT; 1728 where = ELEVATOR_INSERT_FRONT;
1730 rq->flags |= REQ_PREEMPT; 1729 rq->cmd_flags |= REQ_PREEMPT;
1731 } 1730 }
1732 __elv_add_request(drive->queue, rq, where, 0); 1731 __elv_add_request(drive->queue, rq, where, 0);
1733 ide_do_request(hwgroup, IDE_NO_IRQ); 1732 ide_do_request(hwgroup, IDE_NO_IRQ);
@@ -1736,7 +1735,6 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
1736 err = 0; 1735 err = 0;
1737 if (must_wait) { 1736 if (must_wait) {
1738 wait_for_completion(&wait); 1737 wait_for_completion(&wait);
1739 rq->waiting = NULL;
1740 if (rq->errors) 1738 if (rq->errors)
1741 err = -EIO; 1739 err = -EIO;
1742 1740
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..2ebc3760f261 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)
1776static void idetape_init_rq(struct request *rq, u8 cmd) 1776static 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
@@ -2423,8 +2423,8 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
2423#if IDETAPE_DEBUG_LOG 2423#if IDETAPE_DEBUG_LOG
2424#if 0 2424#if 0
2425 if (tape->debug_level >= 5) 2425 if (tape->debug_level >= 5)
2426 printk(KERN_INFO "ide-tape: rq_status: %d, " 2426 printk(KERN_INFO "ide-tape: %d, "
2427 "dev: %s, cmd: %ld, errors: %d\n", rq->rq_status, 2427 "dev: %s, cmd: %ld, errors: %d\n",
2428 rq->rq_disk->disk_name, rq->cmd[0], rq->errors); 2428 rq->rq_disk->disk_name, rq->cmd[0], rq->errors);
2429#endif 2429#endif
2430 if (tape->debug_level >= 2) 2430 if (tape->debug_level >= 2)
@@ -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,12 +2768,12 @@ 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 }
2775#endif /* IDETAPE_DEBUG_BUGS */ 2775#endif /* IDETAPE_DEBUG_BUGS */
2776 rq->waiting = &wait; 2776 rq->end_io_data = &wait;
2777 rq->end_io = blk_end_sync_rq; 2777 rq->end_io = blk_end_sync_rq;
2778 spin_unlock_irq(&tape->spinlock); 2778 spin_unlock_irq(&tape->spinlock);
2779 wait_for_completion(&wait); 2779 wait_for_completion(&wait);
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
364static void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat) 364static 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..2b1a1389c318 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1217,9 +1217,9 @@ 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.data = &rqpm;
1223 rqpm.pm_step = ide_pm_state_start_suspend; 1223 rqpm.pm_step = ide_pm_state_start_suspend;
1224 if (mesg.event == PM_EVENT_PRETHAW) 1224 if (mesg.event == PM_EVENT_PRETHAW)
1225 mesg.event = PM_EVENT_FREEZE; 1225 mesg.event = PM_EVENT_FREEZE;
@@ -1238,9 +1238,9 @@ 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.data = &rqpm;
1244 rqpm.pm_step = ide_pm_state_start_resume; 1244 rqpm.pm_step = ide_pm_state_start_resume;
1245 rqpm.pm_state = PM_EVENT_ON; 1245 rqpm.pm_state = PM_EVENT_ON;
1246 1246
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/Kconfig b/drivers/md/Kconfig
index bf869ed03eed..6dd31a291d84 100644
--- a/drivers/md/Kconfig
+++ b/drivers/md/Kconfig
@@ -2,6 +2,8 @@
2# Block device driver configuration 2# Block device driver configuration
3# 3#
4 4
5if BLOCK
6
5menu "Multi-device support (RAID and LVM)" 7menu "Multi-device support (RAID and LVM)"
6 8
7config MD 9config MD
@@ -251,3 +253,4 @@ config DM_MULTIPATH_EMC
251 253
252endmenu 254endmenu
253 255
256endif
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/Kconfig b/drivers/message/i2o/Kconfig
index fef677103880..6443392bffff 100644
--- a/drivers/message/i2o/Kconfig
+++ b/drivers/message/i2o/Kconfig
@@ -88,7 +88,7 @@ config I2O_BUS
88 88
89config I2O_BLOCK 89config I2O_BLOCK
90 tristate "I2O Block OSM" 90 tristate "I2O Block OSM"
91 depends on I2O 91 depends on I2O && BLOCK
92 ---help--- 92 ---help---
93 Include support for the I2O Block OSM. The Block OSM presents disk 93 Include support for the I2O Block OSM. The Block OSM presents disk
94 and other structured block devices to the operating system. If you 94 and other structured block devices to the operating system. If you
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/Kconfig b/drivers/mmc/Kconfig
index 45bcf098e762..f540bd88dc5a 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -21,7 +21,7 @@ config MMC_DEBUG
21 21
22config MMC_BLOCK 22config MMC_BLOCK
23 tristate "MMC block device driver" 23 tristate "MMC block device driver"
24 depends on MMC 24 depends on MMC && BLOCK
25 default y 25 default y
26 help 26 help
27 Say Y here to enable the MMC block device driver support. 27 Say Y here to enable the MMC block device driver support.
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index d2957e35cc6f..b1f6e03e7aa9 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -24,7 +24,8 @@ obj-$(CONFIG_MMC_AU1X) += au1xmmc.o
24obj-$(CONFIG_MMC_OMAP) += omap.o 24obj-$(CONFIG_MMC_OMAP) += omap.o
25obj-$(CONFIG_MMC_AT91RM9200) += at91_mci.o 25obj-$(CONFIG_MMC_AT91RM9200) += at91_mci.o
26 26
27mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o 27mmc_core-y := mmc.o mmc_sysfs.o
28mmc_core-$(CONFIG_BLOCK) += mmc_queue.o
28 29
29ifeq ($(CONFIG_MMC_DEBUG),y) 30ifeq ($(CONFIG_MMC_DEBUG),y)
30EXTRA_CFLAGS += -DDEBUG 31EXTRA_CFLAGS += -DDEBUG
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/Kconfig b/drivers/mtd/Kconfig
index a03e862851db..a304b34c2632 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -166,7 +166,7 @@ config MTD_CHAR
166 166
167config MTD_BLOCK 167config MTD_BLOCK
168 tristate "Caching block device access to MTD devices" 168 tristate "Caching block device access to MTD devices"
169 depends on MTD 169 depends on MTD && BLOCK
170 ---help--- 170 ---help---
171 Although most flash chips have an erase size too large to be useful 171 Although most flash chips have an erase size too large to be useful
172 as block devices, it is possible to use MTD devices which are based 172 as block devices, it is possible to use MTD devices which are based
@@ -188,7 +188,7 @@ config MTD_BLOCK
188 188
189config MTD_BLOCK_RO 189config MTD_BLOCK_RO
190 tristate "Readonly block device access to MTD devices" 190 tristate "Readonly block device access to MTD devices"
191 depends on MTD_BLOCK!=y && MTD 191 depends on MTD_BLOCK!=y && MTD && BLOCK
192 help 192 help
193 This allows you to mount read-only file systems (such as cramfs) 193 This allows you to mount read-only file systems (such as cramfs)
194 from an MTD device, without the overhead (and danger) of the caching 194 from an MTD device, without the overhead (and danger) of the caching
@@ -199,7 +199,7 @@ config MTD_BLOCK_RO
199 199
200config FTL 200config FTL
201 tristate "FTL (Flash Translation Layer) support" 201 tristate "FTL (Flash Translation Layer) support"
202 depends on MTD 202 depends on MTD && BLOCK
203 ---help--- 203 ---help---
204 This provides support for the original Flash Translation Layer which 204 This provides support for the original Flash Translation Layer which
205 is part of the PCMCIA specification. It uses a kind of pseudo- 205 is part of the PCMCIA specification. It uses a kind of pseudo-
@@ -215,7 +215,7 @@ config FTL
215 215
216config NFTL 216config NFTL
217 tristate "NFTL (NAND Flash Translation Layer) support" 217 tristate "NFTL (NAND Flash Translation Layer) support"
218 depends on MTD 218 depends on MTD && BLOCK
219 ---help--- 219 ---help---
220 This provides support for the NAND Flash Translation Layer which is 220 This provides support for the NAND Flash Translation Layer which is
221 used on M-Systems' DiskOnChip devices. It uses a kind of pseudo- 221 used on M-Systems' DiskOnChip devices. It uses a kind of pseudo-
@@ -238,7 +238,7 @@ config NFTL_RW
238 238
239config INFTL 239config INFTL
240 tristate "INFTL (Inverse NAND Flash Translation Layer) support" 240 tristate "INFTL (Inverse NAND Flash Translation Layer) support"
241 depends on MTD 241 depends on MTD && BLOCK
242 ---help--- 242 ---help---
243 This provides support for the Inverse NAND Flash Translation 243 This provides support for the Inverse NAND Flash Translation
244 Layer which is used on M-Systems' newer DiskOnChip devices. It 244 Layer which is used on M-Systems' newer DiskOnChip devices. It
@@ -255,7 +255,7 @@ config INFTL
255 255
256config RFD_FTL 256config RFD_FTL
257 tristate "Resident Flash Disk (Flash Translation Layer) support" 257 tristate "Resident Flash Disk (Flash Translation Layer) support"
258 depends on MTD 258 depends on MTD && BLOCK
259 ---help--- 259 ---help---
260 This provides support for the flash translation layer known 260 This provides support for the flash translation layer known
261 as the Resident Flash Disk (RFD), as used by the Embedded BIOS 261 as the Resident Flash Disk (RFD), as used by the Embedded BIOS
diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig
index 16c02b5ccf7e..440f6851da69 100644
--- a/drivers/mtd/devices/Kconfig
+++ b/drivers/mtd/devices/Kconfig
@@ -136,7 +136,7 @@ config MTDRAM_ABS_POS
136 136
137config MTD_BLOCK2MTD 137config MTD_BLOCK2MTD
138 tristate "MTD using block device" 138 tristate "MTD using block device"
139 depends on MTD 139 depends on MTD && BLOCK
140 help 140 help
141 This driver allows a block device to appear as an MTD. It would 141 This driver allows a block device to appear as an MTD. It would
142 generally be used in the following cases: 142 generally be used in the following cases:
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/Kconfig b/drivers/s390/block/Kconfig
index 929d6fff6152..b250c5354503 100644
--- a/drivers/s390/block/Kconfig
+++ b/drivers/s390/block/Kconfig
@@ -1,4 +1,4 @@
1if S390 1if S390 && BLOCK
2 2
3comment "S/390 block device drivers" 3comment "S/390 block device drivers"
4 depends on S390 4 depends on S390
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/Kconfig b/drivers/scsi/Kconfig
index c4dfcc91ddda..dab082002e6f 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -3,11 +3,13 @@ menu "SCSI device support"
3config RAID_ATTRS 3config RAID_ATTRS
4 tristate "RAID Transport Class" 4 tristate "RAID Transport Class"
5 default n 5 default n
6 depends on BLOCK
6 ---help--- 7 ---help---
7 Provides RAID 8 Provides RAID
8 9
9config SCSI 10config SCSI
10 tristate "SCSI device support" 11 tristate "SCSI device support"
12 depends on BLOCK
11 ---help--- 13 ---help---
12 If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or 14 If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
13 any other SCSI device under Linux, say Y and make sure that you know 15 any other SCSI device under Linux, say Y and make sure that you know
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..1427a41e8441 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);
@@ -708,11 +708,11 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc)
708static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *rq, sector_t block) 708static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *rq, sector_t block)
709{ 709{
710#if IDESCSI_DEBUG_LOG 710#if IDESCSI_DEBUG_LOG
711 printk (KERN_INFO "rq_status: %d, dev: %s, cmd: %x, errors: %d\n",rq->rq_status, rq->rq_disk->disk_name,rq->cmd[0],rq->errors); 711 printk (KERN_INFO "dev: %s, cmd: %x, errors: %d\n", rq->rq_disk->disk_name,rq->cmd[0],rq->errors);
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
68static void __init pluto_detect_scsi_done(Scsi_Cmnd *SCpnt) 68static 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.c b/drivers/scsi/scsi.c
index 7a054f9d1ee3..da95bce907dd 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -592,12 +592,6 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
592 return rtn; 592 return rtn;
593} 593}
594 594
595
596/*
597 * Per-CPU I/O completion queue.
598 */
599static DEFINE_PER_CPU(struct list_head, scsi_done_q);
600
601/** 595/**
602 * scsi_req_abort_cmd -- Request command recovery for the specified command 596 * scsi_req_abort_cmd -- Request command recovery for the specified command
603 * cmd: pointer to the SCSI command of interest 597 * cmd: pointer to the SCSI command of interest
@@ -1065,7 +1059,7 @@ int scsi_device_cancel(struct scsi_device *sdev, int recovery)
1065 1059
1066 spin_lock_irqsave(&sdev->list_lock, flags); 1060 spin_lock_irqsave(&sdev->list_lock, flags);
1067 list_for_each_entry(scmd, &sdev->cmd_list, list) { 1061 list_for_each_entry(scmd, &sdev->cmd_list, list) {
1068 if (scmd->request && scmd->request->rq_status != RQ_INACTIVE) { 1062 if (scmd->request) {
1069 /* 1063 /*
1070 * If we are unable to remove the timer, it means 1064 * If we are unable to remove the timer, it means
1071 * that the command has already timed out or 1065 * that the command has already timed out or
@@ -1102,7 +1096,7 @@ MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels");
1102 1096
1103static int __init init_scsi(void) 1097static int __init init_scsi(void)
1104{ 1098{
1105 int error, i; 1099 int error;
1106 1100
1107 error = scsi_init_queue(); 1101 error = scsi_init_queue();
1108 if (error) 1102 if (error)
@@ -1123,9 +1117,6 @@ static int __init init_scsi(void)
1123 if (error) 1117 if (error)
1124 goto cleanup_sysctl; 1118 goto cleanup_sysctl;
1125 1119
1126 for_each_possible_cpu(i)
1127 INIT_LIST_HEAD(&per_cpu(scsi_done_q, i));
1128
1129 scsi_netlink_init(); 1120 scsi_netlink_init();
1130 1121
1131 printk(KERN_NOTICE "SCSI subsystem initialized\n"); 1122 printk(KERN_NOTICE "SCSI subsystem initialized\n");
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)
840static void sd_prepare_flush(request_queue_t *q, struct request *rq) 839static 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)
524static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted, Scsi_Cmnd *cmd, 524static 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)
458static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted, Scsi_Cmnd *cmd, 458static 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;
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
index 86e48c42d6af..422a4b288e34 100644
--- a/drivers/usb/storage/Kconfig
+++ b/drivers/usb/storage/Kconfig
@@ -8,8 +8,7 @@ comment "may also be needed; see USB_STORAGE Help for more information"
8 8
9config USB_STORAGE 9config USB_STORAGE
10 tristate "USB Mass Storage support" 10 tristate "USB Mass Storage support"
11 depends on USB 11 depends on USB && SCSI
12 select SCSI
13 ---help--- 12 ---help---
14 Say Y here if you want to connect USB mass storage devices to your 13 Say Y here if you want to connect USB mass storage devices to your
15 computer's USB port. This is the driver you need for USB 14 computer's USB port. This is the driver you need for USB
@@ -18,7 +17,7 @@ config USB_STORAGE
18 similar devices. This driver may also be used for some cameras 17 similar devices. This driver may also be used for some cameras
19 and card readers. 18 and card readers.
20 19
21 This option 'selects' (turns on, enables) 'SCSI', but you 20 This option depends on 'SCSI' support being enabled, but you
22 probably also need 'SCSI device support: SCSI disk support' 21 probably also need 'SCSI device support: SCSI disk support'
23 (BLK_DEV_SD) for most USB storage devices. 22 (BLK_DEV_SD) for most USB storage devices.
24 23