patch-1.3.63 linux/drivers/block/ll_rw_blk.c

Next file: linux/drivers/block/qd6580.c
Previous file: linux/drivers/block/ide_modes.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.62/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
@@ -24,7 +24,12 @@
 /*
  * The request-struct contains all necessary data
  * to load a nr of sectors into memory
+ *
+ * NR_REQUEST is the number of entries in the request-queue.
+ * NOTE that writes may use only the low 2/3 of these: reads
+ * take precedence.
  */
+#define NR_REQUEST	16
 static struct request all_requests[NR_REQUEST];
 
 /*
@@ -37,34 +42,10 @@
 int read_ahead[MAX_BLKDEV] = {0, };
 
 /* blk_dev_struct is:
- *	do_request-address
- *	next-request
+ *	*request_fn
+ *	*current_request
  */
-struct blk_dev_struct blk_dev[MAX_BLKDEV] = {
-	{ NULL, NULL },		/* 0 no_dev */
-	{ NULL, NULL },		/* 1 dev mem */
-	{ NULL, NULL },		/* 2 dev fd */
-	{ NULL, NULL },		/* 3 dev ide0 or hd */
-	{ NULL, NULL },		/* 4 dev ttyx */
-	{ NULL, NULL },		/* 5 dev tty */
-	{ NULL, NULL },		/* 6 dev lp */
-	{ NULL, NULL },		/* 7 dev pipes */
-	{ NULL, NULL },		/* 8 dev sd */
-	{ NULL, NULL },		/* 9 dev st */
-	{ NULL, NULL },		/* 10 */
-	{ NULL, NULL },		/* 11 */
-	{ NULL, NULL },		/* 12 */
-	{ NULL, NULL },		/* 13 */
-	{ NULL, NULL },		/* 14 */
-	{ NULL, NULL },		/* 15 */
-	{ NULL, NULL },		/* 16 */
-	{ NULL, NULL },		/* 17 */
-	{ NULL, NULL },		/* 18 */
-	{ NULL, NULL },		/* 19 */
-	{ NULL, NULL },		/* 20 */
-	{ NULL, NULL },		/* 21 */
-	{ NULL, NULL }		/* 22 dev ide1 */
-};
+struct blk_dev_struct blk_dev[MAX_BLKDEV]; /* initialized by blk_dev_init() */
 
 /*
  * blk_size contains the size of all block-devices in units of 1024 byte
@@ -610,6 +591,12 @@
 int blk_dev_init(void)
 {
 	struct request * req;
+	struct blk_dev_struct *dev;
+
+	for (dev = blk_dev + MAX_BLKDEV; dev-- != blk_dev;) {
+		dev->request_fn      = NULL;
+		dev->current_request = NULL;
+	}
 
 	req = all_requests + NR_REQUEST;
 	while (--req >= all_requests) {
@@ -634,6 +621,9 @@
 #else
 	outb_p(0xc, 0x3f2);
 #endif
+#ifdef CONFIG_CDI_INIT
+	cdi_init();
+#endif CONFIG_CDI_INIT
 #ifdef CONFIG_CDU31A
 	cdu31a_init();
 #endif CONFIG_CDU31A

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this