Whamcloud - gitweb
Landing b_hd_newconfig on HEAD
[fs/lustre-release.git] / lnet / include / libcfs / user-time.h
index 7abc9e8..86cbc2d 100644 (file)
  *  int            cfs_fs_time_before (cfs_fs_time_t *, cfs_fs_time_t *);
  *  int            cfs_fs_time_beforeq(cfs_fs_time_t *, cfs_fs_time_t *);
  *
- *  cfs_duration_t cfs_time_minimal_timeout(void)
- *
  *  CFS_TIME_FORMAT
  *  CFS_DURATION_FORMAT
  *
  */
 
-#define ONE_BILLION ((u_int64_t)1000000000)
-#define ONE_MILLION ((u_int64_t)   1000000)
-
 #ifndef __KERNEL__
 
+#define ONE_BILLION ((u_int64_t)1000000000)
+#define ONE_MILLION 1000000
+
 /*
  * Liblustre. time(2) based implementation.
  */
@@ -98,6 +96,11 @@ static inline cfs_duration_t cfs_time_seconds(int seconds)
         return seconds;
 }
 
+static inline time_t cfs_time_current_sec(void)
+{
+        return cfs_time_seconds(cfs_time_current());
+}
+
 static inline int cfs_time_before(cfs_time_t t1, cfs_time_t t2)
 {
         return t1 < t2;
@@ -110,7 +113,7 @@ static inline int cfs_time_beforeq(cfs_time_t t1, cfs_time_t t2)
 
 static inline cfs_duration_t cfs_duration_build(int64_t nano)
 {
-        return nano / ONE_BILLION;
+        return (cfs_duration_t) (nano / ONE_BILLION);
 }
 
 static inline time_t cfs_duration_sec(cfs_duration_t d)
@@ -162,12 +165,7 @@ static inline int cfs_fs_time_beforeq(cfs_fs_time_t *t1, cfs_fs_time_t *t2)
         return *t1 <= *t2;
 }
 
-static inline cfs_duration_t cfs_time_minimal_timeout(void)
-{
-        return 1;
-}
-
-#define CFS_MIN_DELAY           (1)
+#define CFS_TICK                (1)
 
 static inline cfs_time_t cfs_time_add(cfs_time_t t, cfs_duration_t d)
 {
@@ -179,6 +177,11 @@ static inline cfs_duration_t cfs_time_sub(cfs_time_t t1, cfs_time_t t2)
         return t1 - t2;
 }
 
+#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_T              "%lu"
 #define CFS_DURATION_T          "%ld"