aboutsummaryrefslogtreecommitdiff
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-03-18 13:21:20 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2006-03-18 18:34:12 -0500
commite17a9489b4a686bb5e9615e1d375c67619cb99c5 (patch)
treee6574d24ad8f16fefe7663c91cf19109e48f8c6c /block/cfq-iosched.c
parent25975f863b0fd42c58109e253e7a4c65d9fdaf48 (diff)
downloadlinux-2.6.34-ux500-e17a9489b4a686bb5e9615e1d375c67619cb99c5.tar.gz
[PATCH] stop elv_unregister() from rogering other iosched's data, fix locking
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 521c56d4fdb..7102bafc98b 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1211,6 +1211,13 @@ static void cfq_free_io_context(struct cfq_io_context *cic)
kmem_cache_free(cfq_ioc_pool, cic);
}
+static void cfq_trim(struct io_context *ioc)
+{
+ ioc->set_ioprio = NULL;
+ if (ioc->cic)
+ cfq_free_io_context(ioc->cic);
+}
+
/*
* Called with interrupts disabled
*/
@@ -2472,6 +2479,7 @@ static struct elevator_type iosched_cfq = {
.elevator_may_queue_fn = cfq_may_queue,
.elevator_init_fn = cfq_init_queue,
.elevator_exit_fn = cfq_exit_queue,
+ .trim = cfq_trim,
},
.elevator_ktype = &cfq_ktype,
.elevator_name = "cfq",