patch-2.4.1 linux/include/linux/elevator.h
Next file: linux/include/linux/fs.h
Previous file: linux/include/linux/dn.h
Back to the patch index
Back to the overall index
- Lines: 113
- Date:
Mon Jan 15 13:08:15 2001
- Orig file:
v2.4.0/linux/include/linux/elevator.h
- Orig date:
Tue Jul 18 21:43:10 2000
diff -u --recursive --new-file v2.4.0/linux/include/linux/elevator.h linux/include/linux/elevator.h
@@ -7,34 +7,32 @@
struct list_head *,
struct list_head *, int);
-typedef int (elevator_merge_fn) (request_queue_t *, struct request **,
- struct buffer_head *, int, int *, int *);
+typedef int (elevator_merge_fn) (request_queue_t *, struct request **, struct list_head *,
+ struct buffer_head *, int, int, int);
-typedef void (elevator_dequeue_fn) (struct request *);
+typedef void (elevator_merge_cleanup_fn) (request_queue_t *, struct request *, int);
+
+typedef void (elevator_merge_req_fn) (struct request *, struct request *);
struct elevator_s
{
- int sequence;
-
int read_latency;
int write_latency;
- int max_bomb_segments;
- unsigned int nr_segments;
- int read_pendings;
-
- elevator_fn * elevator_fn;
elevator_merge_fn *elevator_merge_fn;
- elevator_dequeue_fn *dequeue_fn;
+ elevator_merge_cleanup_fn *elevator_merge_cleanup_fn;
+ elevator_merge_req_fn *elevator_merge_req_fn;
unsigned int queue_ID;
};
-void elevator_noop(struct request *, elevator_t *, struct list_head *, struct list_head *, int);
-int elevator_noop_merge(request_queue_t *, struct request **, struct buffer_head *, int, int *, int *);
-void elevator_noop_dequeue(struct request *);
-void elevator_linus(struct request *, elevator_t *, struct list_head *, struct list_head *, int);
-int elevator_linus_merge(request_queue_t *, struct request **, struct buffer_head *, int, int *, int *);
+int elevator_noop_merge(request_queue_t *, struct request **, struct list_head *, struct buffer_head *, int, int, int);
+void elevator_noop_merge_cleanup(request_queue_t *, struct request *, int);
+void elevator_noop_merge_req(struct request *, struct request *);
+
+int elevator_linus_merge(request_queue_t *, struct request **, struct list_head *, struct buffer_head *, int, int, int);
+void elevator_linus_merge_cleanup(request_queue_t *, struct request *, int);
+void elevator_linus_merge_req(struct request *, struct request *);
typedef struct blkelv_ioctl_arg_s {
int queue_ID;
@@ -69,6 +67,10 @@
(s1)->sector < (s2)->sector)) || \
(s1)->rq_dev < (s2)->rq_dev)
+#define BHRQ_IN_ORDER(bh, rq) \
+ (((bh)->b_rdev == (rq)->rq_dev && \
+ (bh)->b_rsector < (rq)->sector))
+
static inline int elevator_request_latency(elevator_t * elevator, int rw)
{
int latency;
@@ -80,36 +82,24 @@
return latency;
}
-#define ELEVATOR_NOOP \
-((elevator_t) { \
- 0, /* sequence */ \
- \
- 0, /* read_latency */ \
- 0, /* write_latency */ \
- 0, /* max_bomb_segments */ \
- \
- 0, /* nr_segments */ \
- 0, /* read_pendings */ \
- \
- elevator_noop, /* elevator_fn */ \
- elevator_noop_merge, /* elevator_merge_fn */ \
- elevator_noop_dequeue, /* dequeue_fn */ \
+#define ELEVATOR_NOOP \
+((elevator_t) { \
+ 0, /* read_latency */ \
+ 0, /* write_latency */ \
+ \
+ elevator_noop_merge, /* elevator_merge_fn */ \
+ elevator_noop_merge_cleanup, /* elevator_merge_cleanup_fn */ \
+ elevator_noop_merge_req, /* elevator_merge_req_fn */ \
})
-#define ELEVATOR_LINUS \
-((elevator_t) { \
- 0, /* not used */ \
- \
- 1000000, /* read passovers */ \
- 2000000, /* write passovers */ \
- 0, /* max_bomb_segments */ \
- \
- 0, /* not used */ \
- 0, /* not used */ \
- \
- elevator_linus, /* elevator_fn */ \
- elevator_linus_merge, /* elevator_merge_fn */ \
- elevator_noop_dequeue, /* dequeue_fn */ \
+#define ELEVATOR_LINUS \
+((elevator_t) { \
+ 8192, /* read passovers */ \
+ 16384, /* write passovers */ \
+ \
+ elevator_linus_merge, /* elevator_merge_fn */ \
+ elevator_linus_merge_cleanup, /* elevator_merge_cleanup_fn */ \
+ elevator_linus_merge_req, /* elevator_merge_req_fn */ \
})
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)