Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-10467 lustre: don't use l_wait_event() for poll loops.
[fs/lustre-release.git]
/
lustre
/
lov
/
lov_request.c
diff --git
a/lustre/lov/lov_request.c
b/lustre/lov/lov_request.c
index
75e5c90
..
f69383e
100644
(file)
--- a/
lustre/lov/lov_request.c
+++ b/
lustre/lov/lov_request.c
@@
-32,6
+32,7
@@
#define DEBUG_SUBSYSTEM S_LOV
#define DEBUG_SUBSYSTEM S_LOV
+#include <linux/delay.h>
#include <libcfs/libcfs.h>
#include <obd_class.h>
#include <libcfs/libcfs.h>
#include <obd_class.h>
@@
-105,11
+106,10
@@
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)
{
*/
static int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx)
{
- wait_queue_head_t waitq;
- struct l_wait_info lwi;
struct lov_tgt_desc *tgt;
struct obd_import *imp = NULL;
int rc = 0;
struct lov_tgt_desc *tgt;
struct obd_import *imp = NULL;
int rc = 0;
+ int cnt;
mutex_lock(&lov->lov_lock);
mutex_lock(&lov->lov_lock);
@@
-130,11
+130,12
@@
static int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx)
mutex_unlock(&lov->lov_lock);
mutex_unlock(&lov->lov_lock);
- init_waitqueue_head(&waitq);
- lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(obd_timeout),
- cfs_time_seconds(1), NULL, NULL);
-
- rc = l_wait_event(waitq, lov_check_set(lov, ost_idx), &lwi);
+ cnt = obd_timeout;
+ while (cnt > 0 &&
+ !lov_check_set(lov, ost_idx)) {
+ ssleep(1);
+ cnt -= 1;
+ }
if (tgt->ltd_active)
return 1;
if (tgt->ltd_active)
return 1;