X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Flinux%2Flustre_ha.h;h=fe83b7d9a6005b197c1bf339c5c71f58de51544c;hb=57e6d88a8a8d858e2d74aeefba4c764ad08cf86d;hp=09610b23358486f023877fb3d1d08196d4c0c48a;hpb=a4c2aa85752707b2725863c9cce4e924d0cfa9d0;p=fs%2Flustre-release.git diff --git a/lustre/include/linux/lustre_ha.h b/lustre/include/linux/lustre_ha.h index 09610b2..fe83b7d9 100644 --- a/lustre/include/linux/lustre_ha.h +++ b/lustre/include/linux/lustre_ha.h @@ -5,51 +5,23 @@ #ifndef _LUSTRE_HA_H #define _LUSTRE_HA_H -#define LUSTRE_HA_NAME "ptlrpc" - -struct recovd_data; -struct recovd_obd; -struct ptlrpc_connection; - -/* rd_phase/rd_next_phase values */ -#define RD_IDLE 0 -#define RD_TROUBLED 1 -#define RD_PREPARING 2 -#define RD_PREPARED 3 -#define RD_RECOVERING 4 -#define RD_RECOVERED 5 -#define RD_FAILED 6 - -/* recovd_state values */ -#define RECOVD_READY 1 -#define RECOVD_STOPPING 2 /* how cleanup tells recovd to quit */ -#define RECOVD_STOPPED 4 /* after recovd has stopped */ - -#define PTLRPC_RECOVD_PHASE_PREPARE 1 -#define PTLRPC_RECOVD_PHASE_RECOVER 2 -#define PTLRPC_RECOVD_PHASE_FAILURE 3 - -typedef int (*ptlrpc_recovery_cb_t)(struct recovd_data *, int); - -struct recovd_data { - struct list_head rd_managed_chain; - ptlrpc_recovery_cb_t rd_recover; - struct recovd_obd *rd_recovd; - __u32 rd_phase; - __u32 rd_next_phase; - __u32 rd_flags; -}; - -void recovd_conn_fail(struct ptlrpc_connection *conn); -void recovd_conn_manage(struct ptlrpc_connection *conn, struct recovd_obd *mgr, - ptlrpc_recovery_cb_t recover); -void recovd_conn_fixed(struct ptlrpc_connection *conn); -int recovd_setup(struct recovd_obd *mgr); -int recovd_cleanup(struct recovd_obd *mgr); - -extern struct recovd_obd *ptlrpc_recovd; - -int ptlrpc_run_recovery_upcall(struct ptlrpc_connection *conn); -int ptlrpc_reconnect_and_replay(struct ptlrpc_connection *conn); +struct obd_import; +struct obd_export; +struct obd_device; +struct ptlrpc_request; + + +void ptlrpc_run_failed_import_upcall(struct obd_import *imp); +void ptlrpc_run_recovery_over_upcall(struct obd_device *obd); +int ptlrpc_replay(struct obd_import *imp); +int ptlrpc_resend(struct obd_import *imp); +void ptlrpc_free_committed(struct obd_import *imp); +void ptlrpc_wake_delayed(struct obd_import *imp); +int ptlrpc_recover_import(struct obd_import *imp, char *new_uuid); +int ptlrpc_set_import_active(struct obd_import *imp, int active); +void ptlrpc_deactivate_import(struct obd_import *imp); +void ptlrpc_invalidate_import(struct obd_import *imp, int in_rpc); +void ptlrpc_fail_import(struct obd_import *imp, int generation); +void ptlrpc_fail_export(struct obd_export *exp); #endif