Commit d62f843b authored by Jens Axboe's avatar Jens Axboe

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: default avatarJens Axboe <jens.axboe@oracle.com>
parent 1b379d8d
...@@ -18,10 +18,17 @@ enum { ...@@ -18,10 +18,17 @@ enum {
IOPOLL_F_DISABLE = 1, IOPOLL_F_DISABLE = 1,
}; };
/*
* Returns 0 if we successfully set the IOPOLL_F_SCHED bit, indicating
* that we were the first to acquire this iop for scheduling. If this iop
* is currently disabled, return "failure".
*/
static inline int blk_iopoll_sched_prep(struct blk_iopoll *iop) static inline int blk_iopoll_sched_prep(struct blk_iopoll *iop)
{ {
return !test_bit(IOPOLL_F_DISABLE, &iop->state) && if (!test_bit(IOPOLL_F_DISABLE, &iop->state))
!test_and_set_bit(IOPOLL_F_SCHED, &iop->state); return test_and_set_bit(IOPOLL_F_SCHED, &iop->state);
return 1;
} }
static inline int blk_iopoll_disable_pending(struct blk_iopoll *iop) static inline int blk_iopoll_disable_pending(struct blk_iopoll *iop)
......
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