Commit c9f26fb1 authored by Anton Blanchard's avatar Anton Blanchard

[PATCH] AIO

Hi,

I started looking at AIO on 2.5 for ppc64. Ive got a small patch which:

1. fixes a dprintk.
2. from what I can see, __aio_get_req returns NULL not -EAGAIN on failure
   so fix comment.
3. we were setting okay in the failure path.

So far I get Im getting 6 passes, 5 fails, any idea how that compares
with x86?

Anton


===== fs/aio.c 1.20 vs edited =====
parent 71660e15
...@@ -248,7 +248,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) ...@@ -248,7 +248,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events)
write_unlock(&mm->ioctx_list_lock); write_unlock(&mm->ioctx_list_lock);
dprintk("aio: allocated ioctx %p[%ld]: mm=%p mask=0x%x\n", dprintk("aio: allocated ioctx %p[%ld]: mm=%p mask=0x%x\n",
ctx, ctx->user_id, current->mm, ctx->ring_info.ring->nr); ctx, ctx->user_id, current->mm, ctx->ring_info.nr);
return ctx; return ctx;
out_cleanup: out_cleanup:
...@@ -376,7 +376,7 @@ void __put_ioctx(struct kioctx *ctx) ...@@ -376,7 +376,7 @@ void __put_ioctx(struct kioctx *ctx)
/* aio_get_req /* aio_get_req
* Allocate a slot for an aio request. Increments the users count * Allocate a slot for an aio request. Increments the users count
* of the kioctx so that the kioctx stays around until all requests are * of the kioctx so that the kioctx stays around until all requests are
* complete. Returns -EAGAIN if no requests are free. * complete. Returns NULL if no requests are free.
*/ */
static struct kiocb *FASTCALL(__aio_get_req(struct kioctx *ctx)); static struct kiocb *FASTCALL(__aio_get_req(struct kioctx *ctx));
static struct kiocb *__aio_get_req(struct kioctx *ctx) static struct kiocb *__aio_get_req(struct kioctx *ctx)
...@@ -409,9 +409,9 @@ static struct kiocb *__aio_get_req(struct kioctx *ctx) ...@@ -409,9 +409,9 @@ static struct kiocb *__aio_get_req(struct kioctx *ctx)
req->ki_user_obj = NULL; req->ki_user_obj = NULL;
req->ki_ctx = ctx; req->ki_ctx = ctx;
req->ki_users = 1; req->ki_users = 1;
okay = 1;
} else { } else {
kmem_cache_free(kiocb_cachep, req); kmem_cache_free(kiocb_cachep, req);
okay = 1;
} }
kunmap_atomic(ring, KM_USER0); kunmap_atomic(ring, KM_USER0);
spin_unlock_irq(&ctx->ctx_lock); spin_unlock_irq(&ctx->ctx_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment