When polling without any usable wait queue, it is clearest
to have an explicit poll loop.
So don't use l_wait_event() in these two cases, but
use a while loop with ssleep(1);
Signed-off-by: Mr NeilBrown <neilb@suse.com>
Change-Id: Ic6a203085699fb9802d32871479c822ebe3c2510
Reviewed-on: https://review.whamcloud.com/35968
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#include <linux/version.h>
#include <linux/mm.h>
#include <linux/user_namespace.h>
#include <linux/version.h>
#include <linux/mm.h>
#include <linux/user_namespace.h>
+#include <linux/delay.h>
#ifdef HAVE_UIDGID_HEADER
# include <linux/uidgid.h>
#endif
#ifdef HAVE_UIDGID_HEADER
# include <linux/uidgid.h>
#endif
struct ll_sb_info *sbi = ll_s2sbi(sb);
struct obd_device *obd;
struct obd_ioctl_data *ioc_data;
struct ll_sb_info *sbi = ll_s2sbi(sb);
struct obd_device *obd;
struct obd_ioctl_data *ioc_data;
- struct l_wait_info lwi;
- wait_queue_head_t waitq;
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op: superblock %p count %d active %d\n", sb,
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op: superblock %p count %d active %d\n", sb,
* and then continue. For now, we just periodically checking for vfs
* to decrement mnt_cnt and hope to finish it within 10sec.
*/
* and then continue. For now, we just periodically checking for vfs
* to decrement mnt_cnt and hope to finish it within 10sec.
*/
- init_waitqueue_head(&waitq);
- lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(10),
- cfs_time_seconds(1), NULL, NULL);
- l_wait_event(waitq, may_umount(sbi->ll_mnt.mnt), &lwi);
+ cnt = 10;
+ while (cnt > 0 &&
+ !may_umount(sbi->ll_mnt.mnt)) {
+ ssleep(1);
+ cnt -= 1;
+ }
#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>
*/
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;
mutex_lock(&lov->lov_lock);
mutex_lock(&lov->lov_lock);
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;