Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9503
b: refs/heads/master
c: 998765e
h: refs/heads/master
i:
  9501: d0a8e77
  9499: a640a28
  9495: 9dbc99c
  9487: aca1309
  9471: 4661b39
v: v3
  • Loading branch information
Zach Brown authored and Linus Torvalds committed Sep 30, 2005
1 parent 871bc8b commit 9f9b728
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6e3254c4e2927c117044a02acf5f5b56e1373053
refs/heads/master: 998765e5588b197737d457e16f72832d8036190f
19 changes: 12 additions & 7 deletions trunk/fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -899,16 +899,24 @@ static void aio_kick_handler(void *data)
* and if required activate the aio work queue to process
* it
*/
static void queue_kicked_iocb(struct kiocb *iocb)
static void try_queue_kicked_iocb(struct kiocb *iocb)
{
struct kioctx *ctx = iocb->ki_ctx;
unsigned long flags;
int run = 0;

WARN_ON((!list_empty(&iocb->ki_wait.task_list)));
/* We're supposed to be the only path putting the iocb back on the run
* list. If we find that the iocb is *back* on a wait queue already
* than retry has happened before we could queue the iocb. This also
* means that the retry could have completed and freed our iocb, no
* good. */
BUG_ON((!list_empty(&iocb->ki_wait.task_list)));

spin_lock_irqsave(&ctx->ctx_lock, flags);
run = __queue_kicked_iocb(iocb);
/* set this inside the lock so that we can't race with aio_run_iocb()
* testing it and putting the iocb on the run list under the lock */
if (!kiocbTryKick(iocb))
run = __queue_kicked_iocb(iocb);
spin_unlock_irqrestore(&ctx->ctx_lock, flags);
if (run)
aio_queue_work(ctx);
Expand All @@ -931,10 +939,7 @@ void fastcall kick_iocb(struct kiocb *iocb)
return;
}

/* If its already kicked we shouldn't queue it again */
if (!kiocbTryKick(iocb)) {
queue_kicked_iocb(iocb);
}
try_queue_kicked_iocb(iocb);
}
EXPORT_SYMBOL(kick_iocb);

Expand Down

0 comments on commit 9f9b728

Please sign in to comment.