patch-2.4.0-test2 linux/include/linux/blkdev.h

Next file: linux/include/linux/capability.h
Previous file: linux/include/linux/blk.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test1/linux/include/linux/blkdev.h linux/include/linux/blkdev.h
@@ -9,6 +9,8 @@
 
 struct request_queue;
 typedef struct request_queue request_queue_t;
+struct elevator_s;
+typedef struct elevator_s elevator_t;
 
 /*
  * Ok, this is an expanded form so that we can use the same
@@ -19,7 +21,11 @@
 struct request {
 	struct list_head queue;
 	int elevator_sequence;
+	struct list_head table;
 
+	/*
+	 * queue free list belongs to
+	 */
 	volatile int rq_status;	/* should split this into a few status bits */
 #define RQ_INACTIVE		(-1)
 #define RQ_ACTIVE		1
@@ -41,7 +47,8 @@
 	struct semaphore * sem;
 	struct buffer_head * bh;
 	struct buffer_head * bhtail;
-	request_queue_t * q;
+	request_queue_t *q;
+	elevator_t *e;
 };
 
 #include <linux/elevator.h>
@@ -60,11 +67,25 @@
 typedef void (plug_device_fn) (request_queue_t *q, kdev_t device);
 typedef void (unplug_device_fn) (void *q);
 
+/*
+ * Default nr free requests per queue
+ */
+#define QUEUE_NR_REQUESTS	512
+#define QUEUE_WRITES_MAX	((2 * QUEUE_NR_REQUESTS) / 3)
+
 struct request_queue
 {
-	struct list_head queue_head;
-	/* together with queue_head for cacheline sharing */
-	elevator_t elevator;
+	/*
+	 * the queue request freelist, one for reads and one for writes
+	 */
+	struct list_head	request_freelist;
+	int			queue_requests;
+
+	/*
+	 * Together with queue_head for cacheline sharing
+	 */
+	struct list_head	queue_head;
+	elevator_t		elevator;
 
 	request_fn_proc		* request_fn;
 	merge_request_fn	* back_merge_fn;
@@ -76,22 +97,34 @@
 	 * The queue owner gets to use this for whatever they like.
 	 * ll_rw_blk doesn't touch it.
 	 */
-	void                    * queuedata;
+	void			* queuedata;
 
 	/*
 	 * This is used to remove the plug when tq_disk runs.
 	 */
-	struct tq_struct          plug_tq;
+	struct tq_struct	plug_tq;
+
 	/*
 	 * Boolean that indicates whether this queue is plugged or not.
 	 */
-	char			  plugged;
+	char			plugged;
 
 	/*
 	 * Boolean that indicates whether current_request is active or
 	 * not.
 	 */
-	char			  head_active;
+	char			head_active;
+
+	/*
+	 * Is meant to protect the queue in the future instead of
+	 * io_request_lock
+	 */
+	spinlock_t		request_lock;
+
+	/*
+	 * Tasks wait here for free request
+	 */
+	wait_queue_head_t	wait_for_request;
 };
 
 struct blk_dev_struct {
@@ -118,13 +151,13 @@
 
 extern struct sec_size * blk_sec[MAX_BLKDEV];
 extern struct blk_dev_struct blk_dev[MAX_BLKDEV];
-extern wait_queue_head_t wait_for_request;
 extern void grok_partitions(struct gendisk *dev, int drive, unsigned minors, long size);
 extern void register_disk(struct gendisk *dev, kdev_t first, unsigned minors, struct block_device_operations *ops, long size);
-extern void generic_unplug_device(void * data);
+extern void generic_unplug_device(void *data);
 extern int generic_make_request(request_queue_t *q, int rw,
 						struct buffer_head * bh);
-extern request_queue_t * blk_get_queue(kdev_t dev);
+extern request_queue_t *blk_get_queue(kdev_t dev);
+extern void blkdev_release_request(struct request *);
 
 /*
  * Access functions for manipulating queue properties

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)