From 9dbdbf383e3e528ed7ed260a7781185d8a3b9c12 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 11 Aug 2009 08:31:14 +0200 Subject: [PATCH] --- yaml --- r: 161214 b: refs/heads/master c: d62f843b295393124970d29316344150c7de009b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/blk-iopoll.h | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 2a9f0c7159d7..5812018dbbae 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1b379d8daf4e981b2220f057683e35af022d45bc +refs/heads/master: d62f843b295393124970d29316344150c7de009b diff --git a/trunk/include/linux/blk-iopoll.h b/trunk/include/linux/blk-iopoll.h index b2e1739a2e7b..308734d3d4a2 100644 --- a/trunk/include/linux/blk-iopoll.h +++ b/trunk/include/linux/blk-iopoll.h @@ -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)