Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284475
b: refs/heads/master
c: 69e4747
h: refs/heads/master
i:
  284473: 2a2f11d
  284471: 16d2e7b
v: v3
  • Loading branch information
Gleb Natapov authored and Linus Torvalds committed Jan 14, 2012
1 parent 20019e1 commit 823fbea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: a3301b751b19f0efbafddc4034f8e7ce6bf3007b
refs/heads/master: 69e4747ee9727d660b88d7e1efe0f4afcb35db1b
11 changes: 9 additions & 2 deletions trunk/fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,21 @@ static void kiocb_batch_init(struct kiocb_batch *batch, long total)
batch->count = total;
}

static void kiocb_batch_free(struct kiocb_batch *batch)
static void kiocb_batch_free(struct kioctx *ctx, struct kiocb_batch *batch)
{
struct kiocb *req, *n;

if (list_empty(&batch->head))
return;

spin_lock_irq(&ctx->ctx_lock);
list_for_each_entry_safe(req, n, &batch->head, ki_batch) {
list_del(&req->ki_batch);
list_del(&req->ki_list);
kmem_cache_free(kiocb_cachep, req);
ctx->reqs_active--;
}
spin_unlock_irq(&ctx->ctx_lock);
}

/*
Expand Down Expand Up @@ -1742,7 +1749,7 @@ long do_io_submit(aio_context_t ctx_id, long nr,
}
blk_finish_plug(&plug);

kiocb_batch_free(&batch);
kiocb_batch_free(ctx, &batch);
put_ioctx(ctx);
return i ? i : ret;
}
Expand Down

0 comments on commit 823fbea

Please sign in to comment.