+static void cdt_start_pending_restore(struct mdt_device *mdt,
+ struct coordinator *cdt)
+{
+ struct mdt_thread_info *cdt_mti;
+ unsigned int i = 0;
+ int rc;
+
+ /* wait until MDD initialize hsm actions llog */
+ while (!test_bit(MDT_FL_CFGLOG, &mdt->mdt_state) && i < obd_timeout) {
+ schedule_timeout_interruptible(cfs_time_seconds(1));
+ i++;
+ }
+ if (!test_bit(MDT_FL_CFGLOG, &mdt->mdt_state))
+ CWARN("%s: trying to init HSM before MDD\n", mdt_obd_name(mdt));
+
+ /* set up list of started restore requests */
+ cdt_mti = lu_context_key_get(&cdt->cdt_env.le_ctx, &mdt_thread_key);
+ rc = mdt_hsm_pending_restore(cdt_mti);
+ if (rc)
+ CERROR("%s: cannot take the layout locks needed for registered restore: %d\n",
+ mdt_obd_name(mdt), rc);
+
+}