From 69a4dc47a19794cbcee606923d97c17d99eed4d7 Mon Sep 17 00:00:00 2001
From: johann <johann>
Date: Thu, 30 Aug 2007 16:16:33 +0000
Subject: [PATCH] Branch b1_6 b=12459 i=adilger,tianzy i=scjody

Severity   : normal
Bugzilla   : 12459
Description: Client eviction due to failover config
Details    : after a connection loss, the lustre client should attempt to
	     reconnect to the last active server first before trying the
	     other potential connections.
---
 lnet/include/libcfs/darwin/darwin-time.h | 1 +
 lnet/include/libcfs/linux/linux-time.h   | 7 ++++++-
 lnet/include/libcfs/user-time.h          | 1 +
 lnet/include/libcfs/winnt/winnt-time.h   | 1 +
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/lnet/include/libcfs/darwin/darwin-time.h b/lnet/include/libcfs/darwin/darwin-time.h
index 43ad274630..35862a63d6 100644
--- a/lnet/include/libcfs/darwin/darwin-time.h
+++ b/lnet/include/libcfs/darwin/darwin-time.h
@@ -213,6 +213,7 @@ static inline void cfs_duration_nsec(cfs_duration_t d, struct timespec *s)
 #define cfs_time_add_64     cfs_time_add
 #define cfs_time_shift_64   cfs_time_shift
 #define cfs_time_before_64  cfs_time_before
+#define cfs_time_beforeq_64 cfs_time_beforeq
 
 /* 
  * One jiffy (in nanoseconds)
diff --git a/lnet/include/libcfs/linux/linux-time.h b/lnet/include/libcfs/linux/linux-time.h
index 1b31dd87bd..626defd470 100644
--- a/lnet/include/libcfs/linux/linux-time.h
+++ b/lnet/include/libcfs/linux/linux-time.h
@@ -281,12 +281,17 @@ static inline int cfs_time_before_64(__u64 t1, __u64 t2)
         return (__s64)t2 - (__s64)t1 > 0;
 }
 
+static inline int cfs_time_beforeq_64(__u64 t1, __u64 t2)
+{
+        return (__s64)t2 - (__s64)t1 >= 0;
+}
+
 #else
 #define cfs_time_current_64 cfs_time_current
 #define cfs_time_add_64     cfs_time_add
 #define cfs_time_shift_64   cfs_time_shift
 #define cfs_time_before_64  cfs_time_before
-
+#define cfs_time_beforeq_64 cfs_time_beforeq
 #endif
 
 /*
diff --git a/lnet/include/libcfs/user-time.h b/lnet/include/libcfs/user-time.h
index 86cbc2ded2..3fb801da9d 100644
--- a/lnet/include/libcfs/user-time.h
+++ b/lnet/include/libcfs/user-time.h
@@ -181,6 +181,7 @@ static inline cfs_duration_t cfs_time_sub(cfs_time_t t1, cfs_time_t t2)
 #define cfs_time_add_64     cfs_time_add
 #define cfs_time_shift_64   cfs_time_shift
 #define cfs_time_before_64  cfs_time_before
+#define cfs_time_beforeq_64 cfs_time_beforeq
 
 #define CFS_TIME_T              "%lu"
 #define CFS_DURATION_T          "%ld"
diff --git a/lnet/include/libcfs/winnt/winnt-time.h b/lnet/include/libcfs/winnt/winnt-time.h
index d31f854b9e..a7a570cf40 100644
--- a/lnet/include/libcfs/winnt/winnt-time.h
+++ b/lnet/include/libcfs/winnt/winnt-time.h
@@ -221,6 +221,7 @@ static inline void cfs_fs_time_nsec(cfs_fs_time_t *t, struct timespec *s)
 #define cfs_time_add_64     cfs_time_add
 #define cfs_time_shift_64   cfs_time_shift
 #define cfs_time_before_64  cfs_time_before
+#define cfs_time_beforeq_64 cfs_time_beforeq
 
 /*
  * One jiffy
-- 
GitLab