summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lustre/lov
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2018-02-13 10:47:59 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-16 15:19:10 +0100
commit60f51d59744c09d25307d2351ec2ac694c741c42 (patch)
treec3cacafc104ac714225cf378db1fa379e74096e6 /drivers/staging/lustre/lustre/lov
parente3382addbc0a5af8640db4f1f3b46ff22ad74400 (diff)
staging: lustre: open code polling loop instead of using l_wait_event()
Two places that LWI_TIMEOUT_INTERVAL() is used, the outcome is a simple polling loop that polls every second for some event (with a limit). So write a simple loop to make this more apparent. Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: Patrick Farrell <paf@cray.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/lov')
-rw-r--r--drivers/staging/lustre/lustre/lov/lov_request.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c
index fb3b7a7fa32a..c1e58fcc30b3 100644
--- a/drivers/staging/lustre/lustre/lov/lov_request.c
+++ b/drivers/staging/lustre/lustre/lov/lov_request.c
@@ -99,8 +99,7 @@ static int lov_check_set(struct lov_obd *lov, int idx)
*/
static int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx)
{
- wait_queue_head_t waitq;
- struct l_wait_info lwi;
+ int cnt = 0;
struct lov_tgt_desc *tgt;
int rc = 0;
@@ -125,11 +124,10 @@ static int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx)
mutex_unlock(&lov->lov_lock);
- init_waitqueue_head(&waitq);
- lwi = LWI_TIMEOUT_INTERVAL(obd_timeout * HZ,
- HZ, NULL, NULL);
-
- rc = l_wait_event(waitq, lov_check_set(lov, ost_idx), &lwi);
+ while (cnt < obd_timeout && !lov_check_set(lov, ost_idx)) {
+ schedule_timeout_uninterruptible(HZ);
+ cnt ++;
+ }
if (tgt->ltd_active)
return 1;