+/* This might block waiting for the upcall to start, so it should
+ * not be called from a thread that shouldn't block. (Like ptlrpcd) */
+void ptlrpc_initiate_recovery(struct obd_import *imp)
+{
+ ENTRY;
+
+ LASSERT (obd_lustre_upcall != NULL);
+
+ if (strcmp(obd_lustre_upcall, "DEFAULT") == 0) {
+ CDEBUG(D_HA, "%s: starting recovery without upcall\n",
+ imp->imp_target_uuid.uuid);
+ ptlrpc_connect_import(imp, NULL);
+ }
+ else if (strcmp(obd_lustre_upcall, "NONE") == 0) {
+ CDEBUG(D_HA, "%s: recovery disabled\n",
+ imp->imp_target_uuid.uuid);
+ }
+ else {
+ CDEBUG(D_HA, "%s: calling upcall to start recovery\n",
+ imp->imp_target_uuid.uuid);
+ ptlrpc_run_failed_import_upcall(imp);
+ }
+
+ EXIT;
+}
+
+int ptlrpc_replay_next(struct obd_import *imp, int *inflight)