Whamcloud - gitweb
LU-2446 build: Update Whamcloud copyright messages for Intel
[fs/lustre-release.git] / lnet / selftest / console.h
index 676f5d9..bbfb502 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -134,15 +132,22 @@ typedef struct lstcon_test {
 #define LST_CONSOLE_TIMEOUT     300             /* default console timeout */
 
 typedef struct {
-        cfs_mutex_t             ses_mutex;      /* lock for session, only one thread can enter session */
+       struct mutex            ses_mutex;      /* only 1 thread in session */
         lst_sid_t               ses_id;         /* global session id */
         int                     ses_key;        /* local session key */
         int                     ses_state;      /* state of session */
         int                     ses_timeout;    /* timeout in seconds */
         time_t                  ses_laststamp;  /* last operation stamp (seconds) */
-        int                     ses_force:1;    /* force creating */
-        int                     ses_shutdown:1; /* session is shutting down */
-        int                     ses_expired:1;  /* console is timedout */
+       /** tests features of the session */
+       unsigned                ses_features;
+       /** features are synced with remote test nodes */
+       unsigned                ses_feats_updated:1;
+       /** force creating */
+       unsigned                ses_force:1;
+       /** session is shutting down */
+       unsigned                ses_shutdown:1;
+       /** console is timedout */
+       unsigned                ses_expired:1;
         __u64                   ses_id_cookie;  /* batch id cookie */
         char                    ses_name[LST_NAME_SIZE];  /* session name */
         lstcon_rpc_trans_t     *ses_ping;       /* session pinger */
@@ -155,12 +160,13 @@ typedef struct {
         cfs_list_t              ses_ndl_list;   /* global list of nodes */
         cfs_list_t             *ses_ndl_hash;   /* hash table of nodes */
 
-        cfs_spinlock_t          ses_rpc_lock;   /* serialize */
+       spinlock_t          ses_rpc_lock;   /* serialize */
         cfs_atomic_t            ses_rpc_counter;/* # of initialized RPCs */
         cfs_list_t              ses_rpc_freelist; /* idle console rpc */
 } lstcon_session_t;                             /*** session descriptor */
 
 extern lstcon_session_t         console_session;
+
 static inline lstcon_trans_stat_t *
 lstcon_trans_stat(void)
 {
@@ -176,13 +182,14 @@ lstcon_id2hash (lnet_process_id_t id, cfs_list_t *hash)
 }
 
 extern int lstcon_session_match(lst_sid_t sid);
-extern int lstcon_session_new(char *name, int key,
+extern int lstcon_session_new(char *name, int key, unsigned version,
                               int timeout, int flags, lst_sid_t *sid_up);
-extern int lstcon_session_info(lst_sid_t *sid_up, int *key,
+extern int lstcon_session_info(lst_sid_t *sid_up, int *key, unsigned *verp,
                                lstcon_ndlist_ent_t *entp, char *name_up, int len);
 extern int lstcon_session_end(void);
 extern int lstcon_session_debug(int timeout, cfs_list_t *result_up);
-extern int lstcon_batch_debug(int timeout, char *name, 
+extern int lstcon_session_feats_check(unsigned feats);
+extern int lstcon_batch_debug(int timeout, char *name,
                               int client, cfs_list_t *result_up);
 extern int lstcon_group_debug(int timeout, char *name,
                               cfs_list_t *result_up);
@@ -193,7 +200,7 @@ extern int lstcon_group_del(char *name);
 extern int lstcon_group_clean(char *name, int args);
 extern int lstcon_group_refresh(char *name, cfs_list_t *result_up);
 extern int lstcon_nodes_add(char *name, int nnd, lnet_process_id_t *nds_up,
-                            cfs_list_t *result_up);
+                           unsigned *featp, cfs_list_t *result_up);
 extern int lstcon_nodes_remove(char *name, int nnd, lnet_process_id_t *nds_up,
                                cfs_list_t *result_up);
 extern int lstcon_group_info(char *name, lstcon_ndlist_ent_t *gent_up,