diff options
Diffstat (limited to 'drivers/staging/lustre/include/linux/libcfs/libcfs_time.h')
-rw-r--r-- | drivers/staging/lustre/include/linux/libcfs/libcfs_time.h | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h index 4bdd77163d5e..1344139c46c3 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h @@ -43,28 +43,27 @@ * generic time manipulation functions. */ -static inline cfs_time_t cfs_time_add(cfs_time_t t, cfs_duration_t d) +static inline unsigned long cfs_time_add(unsigned long t, long d) { - return (cfs_time_t)(t + d); + return (unsigned long)(t + d); } -static inline cfs_duration_t cfs_time_sub(cfs_time_t t1, cfs_time_t t2) +static inline unsigned long cfs_time_sub(unsigned long t1, unsigned long t2) { - return (cfs_time_t)(t1 - t2); + return (unsigned long)(t1 - t2); } -static inline int cfs_time_after(cfs_time_t t1, cfs_time_t t2) +static inline int cfs_time_after(unsigned long t1, unsigned long t2) { - return cfs_time_before(t2, t1); + return time_before(t2, t1); } -static inline int cfs_time_aftereq(cfs_time_t t1, cfs_time_t t2) +static inline int cfs_time_aftereq(unsigned long t1, unsigned long t2) { - return cfs_time_beforeq(t2, t1); + return time_before_eq(t2, t1); } - -static inline cfs_time_t cfs_time_shift(int seconds) +static inline unsigned long cfs_time_shift(int seconds) { return cfs_time_add(cfs_time_current(), cfs_time_seconds(seconds)); } @@ -72,7 +71,7 @@ static inline cfs_time_t cfs_time_shift(int seconds) static inline long cfs_timeval_sub(struct timeval *large, struct timeval *small, struct timeval *result) { - long r = (long) ( + long r = (long)( (large->tv_sec - small->tv_sec) * ONE_MILLION + (large->tv_usec - small->tv_usec)); if (result != NULL) { @@ -82,12 +81,12 @@ static inline long cfs_timeval_sub(struct timeval *large, struct timeval *small, return r; } -static inline void cfs_slow_warning(cfs_time_t now, int seconds, char *msg) +static inline void cfs_slow_warning(unsigned long now, int seconds, char *msg) { if (cfs_time_after(cfs_time_current(), cfs_time_add(now, cfs_time_seconds(15)))) CERROR("slow %s "CFS_TIME_T" sec\n", msg, - cfs_duration_sec(cfs_time_sub(cfs_time_current(),now))); + cfs_duration_sec(cfs_time_sub(cfs_time_current(), now))); } #define CFS_RATELIMIT(seconds) \ @@ -112,7 +111,7 @@ static inline void cfs_slow_warning(cfs_time_t now, int seconds, char *msg) */ static inline void cfs_fs_timeval(struct timeval *tv) { - cfs_fs_time_t time; + struct timespec time; cfs_fs_time_current(&time); cfs_fs_time_usec(&time, tv); @@ -122,7 +121,7 @@ static inline void cfs_fs_timeval(struct timeval *tv) * return valid time-out based on user supplied one. Currently we only check * that time-out is not shorted than allowed. */ -static inline cfs_duration_t cfs_timeout_cap(cfs_duration_t timeout) +static inline long cfs_timeout_cap(long timeout) { if (timeout < CFS_TICK) timeout = CFS_TICK; |