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) |
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) | |||
814 | struct kioctx_cpu *kcpu; | 814 | struct kioctx_cpu *kcpu; |
815 | unsigned long flags; | 815 | unsigned long flags; |
816 | 816 | ||
817 | preempt_disable(); | ||
818 | kcpu = this_cpu_ptr(ctx->cpu); | ||
819 | |||
820 | local_irq_save(flags); | 817 | local_irq_save(flags); |
818 | kcpu = this_cpu_ptr(ctx->cpu); | ||
821 | kcpu->reqs_available += nr; | 819 | kcpu->reqs_available += nr; |
822 | 820 | ||
823 | while (kcpu->reqs_available >= ctx->req_batch * 2) { | 821 | while (kcpu->reqs_available >= ctx->req_batch * 2) { |
@@ -826,7 +824,6 @@ static void put_reqs_available(struct kioctx *ctx, unsigned nr) | |||
826 | } | 824 | } |
827 | 825 | ||
828 | local_irq_restore(flags); | 826 | local_irq_restore(flags); |
829 | preempt_enable(); | ||
830 | } | 827 | } |
831 | 828 | ||
832 | static bool get_reqs_available(struct kioctx *ctx) | 829 | static bool get_reqs_available(struct kioctx *ctx) |
@@ -835,10 +832,8 @@ static bool get_reqs_available(struct kioctx *ctx) | |||
835 | bool ret = false; | 832 | bool ret = false; |
836 | unsigned long flags; | 833 | unsigned long flags; |
837 | 834 | ||
838 | preempt_disable(); | ||
839 | kcpu = this_cpu_ptr(ctx->cpu); | ||
840 | |||
841 | local_irq_save(flags); | 835 | local_irq_save(flags); |
836 | kcpu = this_cpu_ptr(ctx->cpu); | ||
842 | if (!kcpu->reqs_available) { | 837 | if (!kcpu->reqs_available) { |
843 | int old, avail = atomic_read(&ctx->reqs_available); | 838 | int old, avail = atomic_read(&ctx->reqs_available); |
844 | 839 | ||
@@ -858,7 +853,6 @@ static bool get_reqs_available(struct kioctx *ctx) | |||
858 | kcpu->reqs_available--; | 853 | kcpu->reqs_available--; |
859 | out: | 854 | out: |
860 | local_irq_restore(flags); | 855 | local_irq_restore(flags); |
861 | preempt_enable(); | ||
862 | return ret; | 856 | return ret; |
863 | } | 857 | } |
864 | 858 | ||