From 0262af0a48d51cc06271381dc987d4dd47bcbb0c Mon Sep 17 00:00:00 2001 From: Ken Chen Date: Sun, 1 May 2005 08:59:16 -0700 Subject: [PATCH] --- yaml --- r: 751 b: refs/heads/master c: 954d3e95369cf73b4bc1e570729f68264a0e6fe0 h: refs/heads/master i: 749: c24160c8af43f79da6497f6155faeacdae7fe5b5 747: cf4628e6e338bc1be408ba46fc0855caf9ef479a 743: d5a2a372fcd5c43ea6c60bb5a9be878a57c32542 735: 07b8a370473178725b4e84bf4cfc10fef0afcb9e v: v3 --- [refs] | 2 +- trunk/fs/aio.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 7789ef8d3675..8ccc32a1b264 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 644d3a088a3b862ed0b57c286cf58a6bd338ce08 +refs/heads/master: 954d3e95369cf73b4bc1e570729f68264a0e6fe0 diff --git a/trunk/fs/aio.c b/trunk/fs/aio.c index 674bb47fed29..7afa222f6802 100644 --- a/trunk/fs/aio.c +++ b/trunk/fs/aio.c @@ -1514,10 +1514,14 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, goto out_put_req; spin_lock_irq(&ctx->ctx_lock); - list_add_tail(&req->ki_run_list, &ctx->run_list); - /* drain the run list */ - while (__aio_run_iocbs(ctx)) - ; + if (likely(list_empty(&ctx->run_list))) { + aio_run_iocb(req); + } else { + list_add_tail(&req->ki_run_list, &ctx->run_list); + /* drain the run list */ + while (__aio_run_iocbs(ctx)) + ; + } spin_unlock_irq(&ctx->ctx_lock); aio_put_req(req); /* drop extra ref to req */ return 0;