1 #ifndef _LINUX_ELEVATOR_H
2 #define _LINUX_ELEVATOR_H
20 struct request *,
struct bio *);
29 typedef void (elevator_init_icq_fn) (
struct io_cq *);
30 typedef void (elevator_exit_icq_fn) (
struct io_cq *);
33 typedef void (elevator_put_req_fn) (
struct request *);
38 typedef void (elevator_exit_fn) (
struct elevator_queue *);
42 elevator_merge_fn *elevator_merge_fn;
43 elevator_merged_fn *elevator_merged_fn;
44 elevator_merge_req_fn *elevator_merge_req_fn;
45 elevator_allow_merge_fn *elevator_allow_merge_fn;
46 elevator_bio_merged_fn *elevator_bio_merged_fn;
48 elevator_dispatch_fn *elevator_dispatch_fn;
49 elevator_add_req_fn *elevator_add_req_fn;
50 elevator_activate_req_fn *elevator_activate_req_fn;
51 elevator_deactivate_req_fn *elevator_deactivate_req_fn;
53 elevator_completed_req_fn *elevator_completed_req_fn;
55 elevator_request_list_fn *elevator_former_req_fn;
56 elevator_request_list_fn *elevator_latter_req_fn;
58 elevator_init_icq_fn *elevator_init_icq_fn;
59 elevator_exit_icq_fn *elevator_exit_icq_fn;
61 elevator_set_req_fn *elevator_set_req_fn;
62 elevator_put_req_fn *elevator_put_req_fn;
64 elevator_may_queue_fn *elevator_may_queue_fn;
66 elevator_init_fn *elevator_init_fn;
67 elevator_exit_fn *elevator_exit_fn;
70 #define ELV_NAME_MAX (16)
74 ssize_t (*show)(
struct elevator_queue *,
char *);
75 ssize_t (*store)(
struct elevator_queue *,
const char *,
size_t);
87 struct elevator_ops
ops;
90 struct elv_fs_entry *elevator_attrs;
91 char elevator_name[ELV_NAME_MAX];
92 struct module *elevator_owner;
95 char icq_cache_name[ELV_NAME_MAX + 5];
102 struct elevator_queue
104 struct elevator_type *
type;
107 struct mutex sysfs_lock;
109 unsigned int registered:1;
171 #define ELEVATOR_NO_MERGE 0
172 #define ELEVATOR_FRONT_MERGE 1
173 #define ELEVATOR_BACK_MERGE 2
178 #define ELEVATOR_INSERT_FRONT 1
179 #define ELEVATOR_INSERT_BACK 2
180 #define ELEVATOR_INSERT_SORT 3
181 #define ELEVATOR_INSERT_REQUEUE 4
182 #define ELEVATOR_INSERT_FLUSH 5
183 #define ELEVATOR_INSERT_SORT_MERGE 6
194 #define rq_end_sector(rq) (blk_rq_pos(rq) + blk_rq_sectors(rq))
195 #define rb_entry_rq(node) rb_entry((node), struct request, rb_node)
201 #define rq_fifo_time(rq) ((unsigned long) (rq)->csd.list.next)
202 #define rq_set_fifo_time(rq,exp) ((rq)->csd.list.next = (void *) (exp))
203 #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist)
204 #define rq_fifo_clear(rq) do { \
205 list_del_init(&(rq)->queuelist); \
206 INIT_LIST_HEAD(&(rq)->csd.list); \