Whamcloud - gitweb
LU-6401 uapi: migrate remaining uapi headers to uapi directory
[fs/lustre-release.git] / lustre / include / lustre_import.h
index f5fc224..108cec3 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -27,7 +23,7 @@
  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2014, Intel Corporation.
+ * Copyright (c) 2011, 2016, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -48,8 +44,7 @@
  */
 
 #include <lustre_handles.h>
-#include <lustre/lustre_idl.h>
-
+#include <uapi/linux/lustre/lustre_idl.h>
 
 /**
  * Adaptive Timeout stuff
 #define AT_FLG_NOHIST 0x1          /* use last reported value only */
 
 struct adaptive_timeout {
-       time_t          at_binstart;         /* bin start time */
+       time64_t        at_binstart;         /* bin start time */
        unsigned int    at_hist[AT_BINS];    /* timeout history bins */
        unsigned int    at_flags;
        unsigned int    at_current;          /* current timeout value */
        unsigned int    at_worst_ever;       /* worst-ever timeout value */
-       time_t          at_worst_time;       /* worst-ever timeout timestamp */
+       time64_t        at_worst_time;       /* worst-ever timeout timestamp */
        spinlock_t      at_lock;
 };
 
@@ -79,7 +74,7 @@ struct ptlrpc_at_array {
        struct list_head *paa_reqs_array; /** array to hold requests */
         __u32             paa_size;       /** the size of array */
         __u32             paa_count;      /** the total count of reqs */
-        time_t            paa_deadline;   /** the earliest deadline of reqs */
+       time64_t          paa_deadline;   /** the earliest deadline of reqs */
         __u32            *paa_reqs_count; /** the count of reqs in each entry */
 };
 
@@ -152,8 +147,8 @@ struct obd_import_conn {
 /* state history */
 #define IMP_STATE_HIST_LEN 16
 struct import_state_hist {
-        enum lustre_imp_state ish_state;
-        time_t                ish_time;
+       enum lustre_imp_state   ish_state;
+       time64_t                ish_time;
 };
 
 /**
@@ -196,6 +191,11 @@ struct obd_import {
        struct list_head        *imp_replay_cursor;
        /** @} */
 
+       /** List of not replied requests */
+       struct list_head        imp_unreplied_list;
+       /** Known maximal replied XID */
+       __u64                   imp_known_replied_xid;
+
        /** obd device for this import */
        struct obd_device       *imp_obd;
 
@@ -203,9 +203,10 @@ struct obd_import {
          * some seciruty-related fields
          * @{
          */
-        struct ptlrpc_sec        *imp_sec;
+       struct ptlrpc_sec        *imp_sec;
        struct mutex              imp_sec_mutex;
-        cfs_time_t                imp_sec_expire;
+       time64_t                imp_sec_expire;
+       pid_t                     imp_sec_refpid;
         /** @} */
 
        /** Wait queue for those who need to wait for recovery completion */
@@ -304,17 +305,22 @@ struct obd_import {
                                   * chouse new connection */
                                  imp_force_reconnect:1,
                                  /* import has tried to connect with server */
-                                 imp_connect_tried:1;
-        __u32                     imp_connect_op;
-        struct obd_connect_data   imp_connect_data;
-        __u64                     imp_connect_flags_orig;
-        int                       imp_connect_error;
-
-        __u32                     imp_msg_magic;
-        __u32                     imp_msghdr_flags;       /* adjusted based on server capability */
-
-        struct imp_at             imp_at;                 /* adaptive timeout data */
-        time_t                    imp_last_reply_time;    /* for health check */
+                                 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_msg_magic;
+                                 /* adjusted based on server capability */
+       __u32                     imp_msghdr_flags;
+
+                                 /* adaptive timeout data */
+       struct imp_at             imp_at;
+       time64_t                  imp_last_reply_time;  /* for health check */
 };
 
 /* import.c */
@@ -335,7 +341,7 @@ static inline void at_reset_nolock(struct adaptive_timeout *at, int val)
 {
         at->at_current = val;
         at->at_worst_ever = val;
-        at->at_worst_time = cfs_time_current_sec();
+       at->at_worst_time = ktime_get_real_seconds();
 }
 
 static inline void at_reset(struct adaptive_timeout *at, int val)