diff options
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -68,10 +68,8 @@ static void aio_queue_work(struct kioctx *); | |||
68 | */ | 68 | */ |
69 | static int __init aio_setup(void) | 69 | static int __init aio_setup(void) |
70 | { | 70 | { |
71 | kiocb_cachep = kmem_cache_create("kiocb", sizeof(struct kiocb), | 71 | kiocb_cachep = KMEM_CACHE(kiocb, SLAB_HWCACHE_ALIGN|SLAB_PANIC); |
72 | 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL); | 72 | kioctx_cachep = KMEM_CACHE(kioctx,SLAB_HWCACHE_ALIGN|SLAB_PANIC); |
73 | kioctx_cachep = kmem_cache_create("kioctx", sizeof(struct kioctx), | ||
74 | 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL); | ||
75 | 73 | ||
76 | aio_wq = create_workqueue("aio"); | 74 | aio_wq = create_workqueue("aio"); |
77 | 75 | ||
@@ -348,10 +346,9 @@ void fastcall exit_aio(struct mm_struct *mm) | |||
348 | 346 | ||
349 | wait_for_all_aios(ctx); | 347 | wait_for_all_aios(ctx); |
350 | /* | 348 | /* |
351 | * this is an overkill, but ensures we don't leave | 349 | * Ensure we don't leave the ctx on the aio_wq |
352 | * the ctx on the aio_wq | ||
353 | */ | 350 | */ |
354 | flush_workqueue(aio_wq); | 351 | cancel_work_sync(&ctx->wq.work); |
355 | 352 | ||
356 | if (1 != atomic_read(&ctx->users)) | 353 | if (1 != atomic_read(&ctx->users)) |
357 | printk(KERN_DEBUG | 354 | printk(KERN_DEBUG |
@@ -374,7 +371,7 @@ void fastcall __put_ioctx(struct kioctx *ctx) | |||
374 | BUG_ON(ctx->reqs_active); | 371 | BUG_ON(ctx->reqs_active); |
375 | 372 | ||
376 | cancel_delayed_work(&ctx->wq); | 373 | cancel_delayed_work(&ctx->wq); |
377 | flush_workqueue(aio_wq); | 374 | cancel_work_sync(&ctx->wq.work); |
378 | aio_free_ring(ctx); | 375 | aio_free_ring(ctx); |
379 | mmdrop(ctx->mm); | 376 | mmdrop(ctx->mm); |
380 | ctx->mm = NULL; | 377 | ctx->mm = NULL; |