aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/elevator.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/elevator.h')
-rw-r--r--include/linux/elevator.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index c03af7687bb4..acd0312d46fb 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -2,6 +2,7 @@
2#define _LINUX_ELEVATOR_H 2#define _LINUX_ELEVATOR_H
3 3
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5#include <linux/hashtable.h>
5 6
6#ifdef CONFIG_BLOCK 7#ifdef CONFIG_BLOCK
7 8
@@ -96,6 +97,8 @@ struct elevator_type
96 struct list_head list; 97 struct list_head list;
97}; 98};
98 99
100#define ELV_HASH_BITS 6
101
99/* 102/*
100 * each queue has an elevator_queue associated with it 103 * each queue has an elevator_queue associated with it
101 */ 104 */
@@ -105,8 +108,8 @@ struct elevator_queue
105 void *elevator_data; 108 void *elevator_data;
106 struct kobject kobj; 109 struct kobject kobj;
107 struct mutex sysfs_lock; 110 struct mutex sysfs_lock;
108 struct hlist_head *hash;
109 unsigned int registered:1; 111 unsigned int registered:1;
112 DECLARE_HASHTABLE(hash, ELV_HASH_BITS);
110}; 113};
111 114
112/* 115/*
@@ -138,6 +141,7 @@ extern void elv_drain_elevator(struct request_queue *);
138/* 141/*
139 * io scheduler registration 142 * io scheduler registration
140 */ 143 */
144extern void __init load_default_elevator_module(void);
141extern int elv_register(struct elevator_type *); 145extern int elv_register(struct elevator_type *);
142extern void elv_unregister(struct elevator_type *); 146extern void elv_unregister(struct elevator_type *);
143 147
@@ -206,5 +210,9 @@ enum {
206 INIT_LIST_HEAD(&(rq)->csd.list); \ 210 INIT_LIST_HEAD(&(rq)->csd.list); \
207 } while (0) 211 } while (0)
208 212
213#else /* CONFIG_BLOCK */
214
215static inline void load_default_elevator_module(void) { }
216
209#endif /* CONFIG_BLOCK */ 217#endif /* CONFIG_BLOCK */
210#endif 218#endif