diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-03-18 13:21:20 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-03-18 18:34:12 -0500 |
commit | e17a9489b4a686bb5e9615e1d375c67619cb99c5 (patch) | |
tree | e6574d24ad8f16fefe7663c91cf19109e48f8c6c /block/as-iosched.c | |
parent | 25975f863b0fd42c58109e253e7a4c65d9fdaf48 (diff) |
[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/as-iosched.c')
-rw-r--r-- | block/as-iosched.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/block/as-iosched.c b/block/as-iosched.c index 8da3cf66894c..d2ee2af44b58 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) | |||
195 | kfree(aic); | 195 | kfree(aic); |
196 | } | 196 | } |
197 | 197 | ||
198 | static void as_trim(struct io_context *ioc) | ||
199 | { | ||
200 | kfree(ioc->aic); | ||
201 | ioc->aic = NULL; | ||
202 | } | ||
203 | |||
198 | /* Called when the task exits */ | 204 | /* Called when the task exits */ |
199 | static void exit_as_io_context(struct as_io_context *aic) | 205 | static void exit_as_io_context(struct as_io_context *aic) |
200 | { | 206 | { |
@@ -1860,6 +1866,7 @@ static struct elevator_type iosched_as = { | |||
1860 | .elevator_may_queue_fn = as_may_queue, | 1866 | .elevator_may_queue_fn = as_may_queue, |
1861 | .elevator_init_fn = as_init_queue, | 1867 | .elevator_init_fn = as_init_queue, |
1862 | .elevator_exit_fn = as_exit_queue, | 1868 | .elevator_exit_fn = as_exit_queue, |
1869 | .trim = as_trim, | ||
1863 | }, | 1870 | }, |
1864 | 1871 | ||
1865 | .elevator_ktype = &as_ktype, | 1872 | .elevator_ktype = &as_ktype, |