diff options
author | Benjamin LaHaise <bcrl@kvack.org> | 2014-07-22 09:56:56 -0400 |
---|---|---|
committer | Benjamin LaHaise <bcrl@kvack.org> | 2014-07-22 09:56:56 -0400 |
commit | be6fb451a24582732c66e28cb0beb3f19c4289fd (patch) | |
tree | a7576a73fa72dffe3bdc246cb3bf42b25725feaf /fs/aio.c | |
parent | 6e830d53717cf3d5c30c1afce3773ef97e436cd9 (diff) | |
download | linux-be6fb451a24582732c66e28cb0beb3f19c4289fd.tar.gz linux-be6fb451a24582732c66e28cb0beb3f19c4289fd.tar.bz2 linux-be6fb451a24582732c66e28cb0beb3f19c4289fd.zip |
aio: remove no longer needed preempt_disable()
Based on feedback from Jens Axboe on 263782c1c95bbddbb022dc092fd89a36bb8d5577,
clean up get/put_reqs_available() to remove the no longer needed preempt_disable()
and preempt_enable() pair.
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Cc: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -814,10 +814,8 @@ static void put_reqs_available(struct kioctx *ctx, unsigned nr) struct kioctx_cpu *kcpu; unsigned long flags; - preempt_disable(); - kcpu = this_cpu_ptr(ctx->cpu); - local_irq_save(flags); + kcpu = this_cpu_ptr(ctx->cpu); kcpu->reqs_available += nr; while (kcpu->reqs_available >= ctx->req_batch * 2) { @@ -826,7 +824,6 @@ static void put_reqs_available(struct kioctx *ctx, unsigned nr) } local_irq_restore(flags); - preempt_enable(); } static bool get_reqs_available(struct kioctx *ctx) @@ -835,10 +832,8 @@ static bool get_reqs_available(struct kioctx *ctx) bool ret = false; unsigned long flags; - preempt_disable(); - kcpu = this_cpu_ptr(ctx->cpu); - local_irq_save(flags); + kcpu = this_cpu_ptr(ctx->cpu); if (!kcpu->reqs_available) { int old, avail = atomic_read(&ctx->reqs_available); @@ -858,7 +853,6 @@ static bool get_reqs_available(struct kioctx *ctx) kcpu->reqs_available--; out: local_irq_restore(flags); - preempt_enable(); return ret; } |