Skip to content

Commit

Permalink
block: make blk_iopoll_prep_sched() follow normal 0/1 return convention
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe committed Sep 11, 2009
1 parent 1b379d8 commit d62f843
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/linux/blk-iopoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@ enum {
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)
{
return !test_bit(IOPOLL_F_DISABLE, &iop->state) &&
!test_and_set_bit(IOPOLL_F_SCHED, &iop->state);
if (!test_bit(IOPOLL_F_DISABLE, &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)
Expand Down

0 comments on commit d62f843

Please sign in to comment.