*
* @{
*/
-
-#include <lustre_handles.h>
+#include <linux/atomic.h>
+#include <linux/list.h>
+#include <linux/mutex.h>
+#include <linux/spinlock.h>
+#include <linux/time.h>
+#include <linux/types.h>
+#include <linux/workqueue.h>
+#include <libcfs/libcfs.h>
#include <uapi/linux/lustre/lustre_idl.h>
/**
LUSTRE_IMP_RECOVER = 8,
LUSTRE_IMP_FULL = 9,
LUSTRE_IMP_EVICTED = 10,
+ LUSTRE_IMP_IDLE = 11,
+ LUSTRE_IMP_LAST
};
/** Returns test string representation of numeric import state \a state */
static inline char * ptlrpc_import_state_name(enum lustre_imp_state state)
{
- static char* import_state_names[] = {
- "<UNKNOWN>", "CLOSED", "NEW", "DISCONN",
- "CONNECTING", "REPLAY", "REPLAY_LOCKS", "REPLAY_WAIT",
- "RECOVER", "FULL", "EVICTED",
- };
-
- LASSERT (state <= LUSTRE_IMP_EVICTED);
- return import_state_names[state];
+ static char *import_state_names[] = {
+ "<UNKNOWN>", "CLOSED", "NEW", "DISCONN",
+ "CONNECTING", "REPLAY", "REPLAY_LOCKS", "REPLAY_WAIT",
+ "RECOVER", "FULL", "EVICTED", "IDLE",
+ };
+
+ LASSERT(state < LUSTRE_IMP_LAST);
+ return import_state_names[state];
}
/**
* Imports are representing client-side view to remote target.
*/
struct obd_import {
- /** Local handle (== id) for this import. */
- struct portals_handle imp_handle;
/** Reference counter */
atomic_t imp_refcount;
struct lustre_handle imp_dlm_handle; /* client's ldlm export */
struct ptlrpc_client *imp_client;
/** List element for linking into pinger chain */
struct list_head imp_pinger_chain;
- /** List element for linking into chain for destruction */
- struct list_head imp_zombie_chain;
+ /** work struct for destruction of import */
+ struct work_struct imp_zombie_work;
/**
* Lists of requests that are retained for replay, waiting for a reply,
int imp_state_hist_idx;
/** Current import generation. Incremented on every reconnect */
int imp_generation;
+ /** Idle connection initiated at this generation */
+ int imp_initiated_at;
/** Incremented every time we send reconnection request */
__u32 imp_conn_cnt;
/**
imp_resend_replay:1,
/* disable normal recovery, for test only. */
imp_no_pinger_recover:1,
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 0, 53, 0)
- /* need IR MNE swab */
- imp_need_mne_swab:1,
-#endif
/* import must be reconnected instead of
* chouse new connection */
imp_force_reconnect:1,
imp_connect_tried:1,
/* connected but not FULL yet */
imp_connected:1;
- __u32 imp_connect_op;
- struct obd_connect_data imp_connect_data;
- __u64 imp_connect_flags_orig;
- __u64 imp_connect_flags2_orig;
- int imp_connect_error;
+ u32 imp_connect_op;
+ u32 imp_idle_timeout;
+ u32 imp_idle_debug;
+ struct obd_connect_data imp_connect_data;
+ __u64 imp_connect_flags_orig;
+ __u64 imp_connect_flags2_orig;
+ int imp_connect_error;
enum lustre_msg_magic imp_msg_magic;
/* adjusted based on server capability */
/* genops.c */
struct obd_export;
extern struct obd_import *class_exp2cliimp(struct obd_export *);
-extern struct obd_import *class_conn2cliimp(struct lustre_handle *);
/** @} import */