Use only target_recovery_fini() to finish recovery.
i=rread
#define OBD_RECOVERY_MAX_TIME (obd_timeout * 18) /* b13079 */
-void target_cancel_recovery_timer(struct obd_device *obd);
-void target_stop_recovery_thread(struct obd_device *obd);
-void target_cleanup_recovery(struct obd_device *obd);
int target_queue_recovery_request(struct ptlrpc_request *req,
struct obd_device *obd);
void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id);
target_request_copy_put(req);
}
}
-#endif
+
+/* obd_processing_task_lock should be held */
+static void target_cancel_recovery_timer(struct obd_device *obd)
+{
+ CDEBUG(D_HA, "%s: cancel recovery timer\n", obd->obd_name);
+ cfs_timer_disarm(&obd->obd_recovery_timer);
+}
/* Called from a cleanup function if the device is being cleaned up
forcefully. The exports should all have been disconnected already,
Because the obd_stopping flag is set, no new requests should be received.
*/
-void target_cleanup_recovery(struct obd_device *obd)
+static void target_cleanup_recovery(struct obd_device *obd)
{
struct ptlrpc_request *req, *n;
cfs_list_t clean_list;
EXIT;
}
-
-/* obd_processing_task_lock should be held */
-void target_cancel_recovery_timer(struct obd_device *obd)
-{
- CDEBUG(D_HA, "%s: cancel recovery timer\n", obd->obd_name);
- cfs_timer_disarm(&obd->obd_recovery_timer);
-}
+#endif
/* extend = 1 means require at least "duration" seconds left in the timer,
extend = 0 means set the total duration (start_recovery_timer) */
return rc;
}
-void target_stop_recovery_thread(struct obd_device *obd)
+static void target_stop_recovery_thread(struct obd_device *obd)
{
cfs_spin_lock_bh(&obd->obd_processing_task_lock);
if (obd->obd_recovery_data.trd_processing_task > 0) {
EXPORT_SYMBOL(client_connect_import);
EXPORT_SYMBOL(client_disconnect_export);
EXPORT_SYMBOL(server_disconnect_export);
-EXPORT_SYMBOL(target_stop_recovery_thread);
EXPORT_SYMBOL(target_handle_connect);
-EXPORT_SYMBOL(target_cleanup_recovery);
EXPORT_SYMBOL(target_destroy_export);
-EXPORT_SYMBOL(target_cancel_recovery_timer);
EXPORT_SYMBOL(target_send_reply);
EXPORT_SYMBOL(target_queue_recovery_request);
EXPORT_SYMBOL(target_handle_ping);
break;
case OBD_IOC_ABORT_RECOVERY:
CERROR("Aborting recovery for device %s\n", obd->obd_name);
- target_stop_recovery_thread(obd);
+ target_recovery_fini(obd);
rc = 0;
break;
case OBD_IOC_CHANGELOG_REG:
switch (cmd) {
case OBD_IOC_ABORT_RECOVERY: {
LCONSOLE_WARN("%s: Aborting recovery.\n", obd->obd_name);
- target_stop_recovery_thread(obd);
+ target_recovery_fini(obd);
RETURN(0);
}
ping_evictor_stop();
- cfs_spin_lock_bh(&obd->obd_processing_task_lock);
- if (obd->obd_recovering) {
- target_cancel_recovery_timer(obd);
- obd->obd_recovering = 0;
- }
- cfs_spin_unlock_bh(&obd->obd_processing_task_lock);
+ LASSERT(obd->obd_recovering == 0);
cfs_down(&ost->ost_health_sem);
ptlrpc_unregister_service(ost->ost_service);