diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-08-11 02:31:14 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-09-11 08:33:32 -0400 |
commit | d62f843b295393124970d29316344150c7de009b (patch) | |
tree | e4ed17a6e34f43a7c292e7d6f8fe64652b075dd6 /include/linux | |
parent | 1b379d8daf4e981b2220f057683e35af022d45bc (diff) |
block: make blk_iopoll_prep_sched() follow normal 0/1 return convention
Return 0 if we successfully marked this iopoll structure as ours for
scheduling, instead of 1.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux')
-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) |