d->opd_statfs_fresh_till);
}
+/*
+ * OSP tries to maintain pool of available objects so that calls to create
+ * objects don't block most of time
+ *
+ * each time OSP gets connected to OST, we should start from precreation cleanup
+ */
+static inline bool osp_precreate_running(struct osp_device *d)
+{
+ return !!(d->opd_pre_thread.t_flags & SVC_RUNNING);
+}
+
+static inline bool osp_precreate_stopped(struct osp_device *d)
+{
+ return !!(d->opd_pre_thread.t_flags & SVC_STOPPED);
+}
+
static void osp_statfs_timer_cb(unsigned long _d)
{
struct osp_device *d = (struct osp_device *) _d;
LASSERT(d);
- wake_up(&d->opd_pre_waitq);
+ if (d->opd_pre != NULL && osp_precreate_running(d))
+ wake_up(&d->opd_pre_waitq);
}
static int osp_statfs_interpret(const struct lu_env *env,
RETURN(0);
out:
/* couldn't update statfs, try again as soon as possible */
- wake_up(&d->opd_pre_waitq);
+ if (d->opd_pre != NULL && osp_precreate_running(d))
+ wake_up(&d->opd_pre_waitq);
+
if (req->rq_import_generation == imp->imp_generation)
CDEBUG(D_CACHE, "%s: couldn't update statfs: rc = %d\n",
d->opd_obd->obd_name, rc);
}
}
-
-/*
- * OSP tries to maintain pool of available objects so that calls to create
- * objects don't block most of time
- *
- * each time OSP gets connected to OST, we should start from precreation cleanup
- */
-static inline int osp_precreate_running(struct osp_device *d)
-{
- return !!(d->opd_pre_thread.t_flags & SVC_RUNNING);
-}
-
-static inline int osp_precreate_stopped(struct osp_device *d)
-{
- return !!(d->opd_pre_thread.t_flags & SVC_STOPPED);
-}
-
static inline int osp_objs_precreated(const struct lu_env *env,
struct osp_device *osp)
{