diff options
author | Tejun Heo <tj@kernel.org> | 2011-12-14 00:33:42 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2011-12-14 00:33:42 +0100 |
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 04958ef53e6..d3d3e28cbfd 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -78,10 +78,19 @@ struct elv_fs_entry { */ struct elevator_type { + /* managed by elevator core */ + struct kmem_cache *icq_cache; + + /* fields provided by elevator implementation */ struct elevator_ops ops; + size_t icq_size; + size_t icq_align; struct elv_fs_entry *elevator_attrs; char elevator_name[ELV_NAME_MAX]; struct module *elevator_owner; + + /* managed by elevator core */ + char icq_cache_name[ELV_NAME_MAX + 5]; /* elvname + "_io_cq" */ struct list_head list; }; @@ -127,7 +136,7 @@ extern void elv_drain_elevator(struct request_queue *); /* * io scheduler registration */ -extern void elv_register(struct elevator_type *); +extern int elv_register(struct elevator_type *); extern void elv_unregister(struct elevator_type *); /* |