Whamcloud - gitweb
Revert "LU-6245 libcfs: remove cfs_fs_time handling"
[fs/lustre-release.git] / libcfs / include / libcfs / libcfs_time.h
index 21619ba..6ac5659 100644 (file)
@@ -39,7 +39,6 @@
 
 #ifndef __LIBCFS_TIME_H__
 #define __LIBCFS_TIME_H__
-
 /*
  * generic time manipulation functions.
  */
@@ -109,6 +108,17 @@ static inline void cfs_slow_warning(cfs_time_t now, int seconds, char *msg)
 })
 
 /*
+ * helper function similar to do_gettimeofday() of Linux kernel
+ */
+static inline void cfs_fs_timeval(struct timeval *tv)
+{
+        cfs_fs_time_t time;
+
+        cfs_fs_time_current(&time);
+        cfs_fs_time_usec(&time, tv);
+}
+
+/*
  * return valid time-out based on user supplied one. Currently we only check
  * that time-out is not shorted than allowed.
  */