diff options
-rw-r--r-- | include/linux/blk-iopoll.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/blk-iopoll.h b/include/linux/blk-iopoll.h index b2e1739a2e7b..308734d3d4a2 100644 --- a/include/linux/blk-iopoll.h +++ b/include/linux/blk-iopoll.h | |||
@@ -18,10 +18,17 @@ enum { | |||
18 | IOPOLL_F_DISABLE = 1, | 18 | IOPOLL_F_DISABLE = 1, |
19 | }; | 19 | }; |
20 | 20 | ||
21 | /* | ||
22 | * Returns 0 if we successfully set the IOPOLL_F_SCHED bit, indicating | ||
23 | * that we were the first to acquire this iop for scheduling. If this iop | ||
24 | * is currently disabled, return "failure". | ||
25 | */ | ||
21 | static inline int blk_iopoll_sched_prep(struct blk_iopoll *iop) | 26 | static inline int blk_iopoll_sched_prep(struct blk_iopoll *iop) |
22 | { | 27 | { |
23 | return !test_bit(IOPOLL_F_DISABLE, &iop->state) && | 28 | if (!test_bit(IOPOLL_F_DISABLE, &iop->state)) |
24 | !test_and_set_bit(IOPOLL_F_SCHED, &iop->state); | 29 | return test_and_set_bit(IOPOLL_F_SCHED, &iop->state); |
30 | |||
31 | return 1; | ||
25 | } | 32 | } |
26 | 33 | ||
27 | static inline int blk_iopoll_disable_pending(struct blk_iopoll *iop) | 34 | static inline int blk_iopoll_disable_pending(struct blk_iopoll *iop) |