diff options
author | Tejun Heo <tj@kernel.org> | 2011-12-13 18:33:42 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2011-12-13 18:33:42 -0500 |
commit | 3d3c2379feb177a5fd55bb0ed76776dc9d4f3243 (patch) | |
tree | fafebbef8f0fb5b73ac4db24bff20dcd40b8bf12 /include/linux/elevator.h | |
parent | 47fdd4ca96bf4b28ac4d05d7a6e382df31d3d758 (diff) |
block, cfq: move icq cache management to block core
Let elevators set ->icq_size and ->icq_align in elevator_type and
elv_register() and elv_unregister() respectively create and destroy
kmem_cache for icq.
* elv_register() now can return failure. All callers updated.
* icq caches are automatically named "ELVNAME_io_cq".
* cfq_slab_setup/kill() are collapsed into cfq_init/exit().
* While at it, minor indentation change for iosched_cfq.elevator_name
for consistency.
This will help moving icq management to block core. This doesn't
introduce any functional change.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/elevator.h')
-rw-r--r-- | include/linux/elevator.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 04958ef53e62..d3d3e28cbfd4 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -78,10 +78,19 @@ struct elv_fs_entry { | |||
78 | */ | 78 | */ |
79 | struct elevator_type | 79 | struct elevator_type |
80 | { | 80 | { |
81 | /* managed by elevator core */ | ||
82 | struct kmem_cache *icq_cache; | ||
83 | |||
84 | /* fields provided by elevator implementation */ | ||
81 | struct elevator_ops ops; | 85 | struct elevator_ops ops; |
86 | size_t icq_size; | ||
87 | size_t icq_align; | ||
82 | struct elv_fs_entry *elevator_attrs; | 88 | struct elv_fs_entry *elevator_attrs; |
83 | char elevator_name[ELV_NAME_MAX]; | 89 | char elevator_name[ELV_NAME_MAX]; |
84 | struct module *elevator_owner; | 90 | struct module *elevator_owner; |
91 | |||
92 | /* managed by elevator core */ | ||
93 | char icq_cache_name[ELV_NAME_MAX + 5]; /* elvname + "_io_cq" */ | ||
85 | struct list_head list; | 94 | struct list_head list; |
86 | }; | 95 | }; |
87 | 96 | ||
@@ -127,7 +136,7 @@ extern void elv_drain_elevator(struct request_queue *); | |||
127 | /* | 136 | /* |
128 | * io scheduler registration | 137 | * io scheduler registration |
129 | */ | 138 | */ |
130 | extern void elv_register(struct elevator_type *); | 139 | extern int elv_register(struct elevator_type *); |
131 | extern void elv_unregister(struct elevator_type *); | 140 | extern void elv_unregister(struct elevator_type *); |
132 | 141 | ||
133 | /* | 142 | /* |