Whamcloud - gitweb
LU-8760 lib: avoid unexpected out of order execution
[fs/lustre-release.git] / lustre / include / lustre_import.h
index 6bc308d..1b44d32 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/
 #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 +75,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 +148,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;
 };
 
 /**
@@ -208,9 +204,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 */
@@ -312,16 +309,19 @@ struct obd_import {
                                  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;
-        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 */
+       __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 */
@@ -342,7 +342,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)