#include <linux/blkdev.h>
#include <linux/locks.h>
#include <linux/config.h>
-
-#include <asm/spinlock.h>
+#include <linux/spinlock.h>
/*
* Spinlock for protecting the request queue which
@@ -19,7+18,7 @@ extern spinlock_t io_request_lock; * NOTE that writes may use only the low 2/3 of these: reads
* take precedence.
*/
-#define NR_REQUEST 64
+#define NR_REQUEST 128
/*
* This is used in the elevator algorithm. We don't prioritise reads
@@ -57,6+56,7 @@ extern int ap_init(void); extern int ddv_init(void);
extern int z2_init(void);
extern int swim3_init(void);
+extern int swimiop_init(void);
extern int amiga_floppy_init(void);
extern int atari_floppy_init(void);
extern int nbd_init(void);
@@ -85,13+85,20 @@ void initrd_init(void);
#endif
-#define RO_IOCTLS(dev,where) \
- case BLKROSET: { int __val; if (!capable(CAP_SYS_ADMIN)) return -EACCES; \
- if (get_user(__val, (int *)(where))) return -EFAULT; \
- set_device_ro((dev),__val); return 0; } \
- case BLKROGET: { int __val = (is_read_only(dev) != 0) ; \
- return put_user(__val,(int *) (where)); }
+/*
+ * end_request() and friends. Must be called with the request queue spinlock
+ * acquired. All functions called within end_request() _must_be_ atomic.
+ *
+ * Several drivers define their own end_request and call
+ * end_that_request_first() and end_that_request_last()
+ * for parts of the original function. This prevents
+ * code duplication in drivers.
+ */
+
+int end_that_request_first(struct request *req, int uptodate, char *name);
+void end_that_request_last(struct request *req);
+
#if defined(MAJOR_NR) || defined(IDE_DRIVER)
/*
@@ -137,8+144,8 @@ static void floppy_off(unsigned int nr);
#elif (MAJOR_NR == HD_MAJOR)
-/* harddisk: timeout is 6 seconds.. */
-#define DEVICE_NAME "harddisk"
+/* Hard disk: timeout is 6 seconds. */
+#define DEVICE_NAME "hard disk"
#define DEVICE_INTR do_hd
#define DEVICE_TIMEOUT HD_TIMER
#define TIMEOUT_VALUE (6*HZ)
@@ -147,13+154,13 @@ static void floppy_off(unsigned int nr); #define DEVICE_ON(device)
#define DEVICE_OFF(device)
-#elif (MAJOR_NR == SCSI_DISK_MAJOR)
+#elif (SCSI_DISK_MAJOR(MAJOR_NR))
#define DEVICE_NAME "scsidisk"
#define DEVICE_INTR do_sd
#define TIMEOUT_VALUE (2*HZ)
#define DEVICE_REQUEST do_sd_request
-#define DEVICE_NR(device) (MINOR(device) >> 4)
+#define DEVICE_NR(device) (((MAJOR(device) & SD_MAJOR_MASK) << (8 - 4)) + (MINOR(device) >> 4))
#define DEVICE_ON(device)
#define DEVICE_OFF(device)
@@ -292,7+299,7 @@ static void floppy_off(unsigned int nr); #define DEVICE_OFF(device)
#elif (MAJOR_NR == CM206_CDROM_MAJOR)
-#define DEVICE_NAME "Philips/LMS cd-rom cm206"
+#define DEVICE_NAME "Philips/LMS CD-ROM cm206"
#define DEVICE_REQUEST do_cm206_request
#define DEVICE_NR(device) (MINOR(device))
#define DEVICE_ON(device)
@@ -347,6+354,33 @@ static void floppy_off(unsigned int nr); #define DEVICE_ON(device)
#define DEVICE_OFF(device)
+#elif (MAJOR_NR == I2O_MAJOR)
+
+#define DEVICE_NAME "I2O block"
+#define DEVICE_REQUEST do_i2ob_request
+#define DEVICE_NR(device) (MINOR(device)>>4)
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == COMPAQ_SMART2_MAJOR)
+
+#define DEVICE_NAME "ida"
+#define DEVICE_INTR do_ida
+#define TIMEOUT_VALUE (25*HZ)
+#define DEVICE_REQUEST do_ida_request0
+#define DEVICE_NR(device) (MINOR(device) >> 4)
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == COMPAQ_SMART2_MAJOR)
+
+#define DEVICE_NAME "ida"
+#define TIMEOUT_VALUE (25*HZ)
+#define DEVICE_REQUEST do_ida_request0
+#define DEVICE_NR(device) (MINOR(device) >> 4)
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
#endif /* MAJOR_NR == whatever */
#if (MAJOR_NR != SCSI_TAPE_MAJOR)
@@ -409,21+443,10 @@ static void (DEVICE_REQUEST)(void);
#endif /* !defined(IDE_DRIVER) */
-/*
- * end_request() and friends. Must be called with the request queue spinlock
- * acquired. All functions called within end_request() _must_be_ atomic.
- *
- * Several drivers define their own end_request and call end_that_request_first()
- * and end_that_request_last() for parts of the original function. This prevents
- * code duplication in drivers.
- */
-
-int end_that_request_first(struct request *req, int uptodate, char *name);
-void end_that_request_last(struct request *req);
#ifndef LOCAL_END_REQUEST /* If we have our own end_request, we do not want to include this mess */
-#if ! SCSI_BLK_MAJOR(MAJOR_NR)
+#if ! SCSI_BLK_MAJOR(MAJOR_NR) && (MAJOR_NR != COMPAQ_SMART2_MAJOR)
static void end_request(int uptodate) {
struct request *req = CURRENT;