From e17a9489b4a686bb5e9615e1d375c67619cb99c5 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 18 Mar 2006 13:21:20 -0500 Subject: [PATCH] stop elv_unregister() from rogering other iosched's data, fix locking Signed-off-by: Al Viro --- block/as-iosched.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'block/as-iosched.c') diff --git a/block/as-iosched.c b/block/as-iosched.c index 8da3cf66894..d2ee2af44b5 100644 --- a/block/as-iosched.c +++ b/block/as-iosched.c @@ -195,6 +195,12 @@ static void free_as_io_context(struct as_io_context *aic) kfree(aic); } +static void as_trim(struct io_context *ioc) +{ + kfree(ioc->aic); + ioc->aic = NULL; +} + /* Called when the task exits */ static void exit_as_io_context(struct as_io_context *aic) { @@ -1860,6 +1866,7 @@ static struct elevator_type iosched_as = { .elevator_may_queue_fn = as_may_queue, .elevator_init_fn = as_init_queue, .elevator_exit_fn = as_exit_queue, + .trim = as_trim, }, .elevator_ktype = &as_ktype, -- cgit v1.2.3