@@ -40,6 +40,7 @@
#define DEBUG_SUBSYSTEM S_FID
#include <linux/module.h>
+#include <linux/delay.h>
#include <obd.h>
#include <obd_class.h>
@@ -155,6 +156,12 @@ static int seq_client_alloc_meta(const struct lu_env *env,
*/
rc = seq_client_rpc(seq, &seq->lcs_space,
SEQ_ALLOC_META, "meta");
+ if (rc == -EINPROGRESS || rc == -EAGAIN)
+ /* MDT0 is not ready, let's wait for 2
+ * seconds and retry.
+ */
+ ssleep(2);
+
} while (rc == -EINPROGRESS || rc == -EAGAIN);
return rc;
@@ -42,6 +42,7 @@
#include <linux/statfs.h>
#include <linux/types.h>
#include <linux/mm.h>
+#include <linux/delay.h>
#include <linux/uuid.h>
#include <linux/random.h>
#include <linux/security.h>
@@ -2344,7 +2345,7 @@ void ll_umount_begin(struct super_block *sb)
* to decrement mnt_cnt and hope to finish it within 10sec.
*/
while (cnt < 10 && !may_umount(sbi->ll_mnt.mnt)) {
- schedule_timeout_uninterruptible(HZ);
+ ssleep(1);
cnt++;
}
@@ -33,6 +33,8 @@
#define DEBUG_SUBSYSTEM S_LOV
+#include <linux/delay.h>
+
#include <obd_class.h>
#include <uapi/linux/lustre/lustre_idl.h>
#include "lov_internal.h"
@@ -130,7 +132,7 @@ static int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx)
mutex_unlock(&lov->lov_lock);
while (cnt < obd_timeout && !lov_check_set(lov, ost_idx)) {
- schedule_timeout_uninterruptible(HZ);
+ ssleep(1);
cnt++;
}
if (tgt->ltd_active)
@@ -37,6 +37,7 @@
#include <linux/pagemap.h>
#include <linux/init.h>
#include <linux/utsname.h>
+#include <linux/delay.h>
#include <linux/file.h>
#include <linux/kthread.h>
#include <linux/prefetch.h>
@@ -1043,13 +1044,11 @@ static int mdc_getpage(struct obd_export *exp, const struct lu_fid *fid,
{
struct ptlrpc_bulk_desc *desc;
struct ptlrpc_request *req;
- wait_queue_head_t waitq;
int resends = 0;
int rc;
int i;
*request = NULL;
- init_waitqueue_head(&waitq);
restart_bulk:
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_READPAGE);
@@ -1093,7 +1092,7 @@ static int mdc_getpage(struct obd_export *exp, const struct lu_fid *fid,
exp->exp_obd->obd_name, -EIO);
return -EIO;
}
- wait_event_idle_timeout(waitq, 0, resends * HZ);
+ ssleep(resends);
goto restart_bulk;
}
@@ -34,9 +34,8 @@
#define DEBUG_SUBSYSTEM S_RPC
#include <linux/libcfs/libcfs.h>
-# ifdef __mips64__
-# include <linux/kernel.h>
-# endif
+#include <linux/kernel.h>
+#include <linux/delay.h>
#include <obd_class.h>
#include <lustre_net.h>
@@ -522,7 +521,7 @@ static void ptlrpc_ni_fini(void)
if (retries != 0)
CWARN("Event queue still busy\n");
- schedule_timeout_uninterruptible(2 * HZ);
+ ssleep(2);
break;
}
}