Commit 9fa1cb39 authored by Al Viro's avatar Al Viro

aio: aio_nr_lock is taken only synchronously now

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 2dd542b7
...@@ -278,14 +278,14 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) ...@@ -278,14 +278,14 @@ static struct kioctx *ioctx_alloc(unsigned nr_events)
goto out_freectx; goto out_freectx;
/* limit the number of system wide aios */ /* limit the number of system wide aios */
spin_lock_bh(&aio_nr_lock); spin_lock(&aio_nr_lock);
if (aio_nr + nr_events > aio_max_nr || if (aio_nr + nr_events > aio_max_nr ||
aio_nr + nr_events < aio_nr) { aio_nr + nr_events < aio_nr) {
spin_unlock_bh(&aio_nr_lock); spin_unlock(&aio_nr_lock);
goto out_cleanup; goto out_cleanup;
} }
aio_nr += ctx->max_reqs; aio_nr += ctx->max_reqs;
spin_unlock_bh(&aio_nr_lock); spin_unlock(&aio_nr_lock);
/* now link into global list. */ /* now link into global list. */
spin_lock(&mm->ioctx_lock); spin_lock(&mm->ioctx_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