diff options
author | Arnd Bergmann <arnd@arndb.de> | 2015-09-27 16:45:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-29 04:06:16 +0200 |
commit | 117e2ce8cf35ce7b16ef39138bbba81a7cc38277 (patch) | |
tree | 49967ab42b21b3ff6e2551667c64112411807452 | |
parent | 922da0c58e4107fb70364e1032c8243ac8646107 (diff) |
staging/lustre: remove unused time handling functions
A bunch of API functions deal with time values but are now
completely unused in lustre. This removes them in order to
remove all references to time_t from the header files.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/lustre/include/linux/libcfs/libcfs_time.h | 49 | ||||
-rw-r--r-- | drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h | 17 |
2 files changed, 0 insertions, 66 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h index 5de6da085712..2c7ec2d28f38 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h @@ -68,55 +68,6 @@ static inline unsigned long cfs_time_shift(int seconds) return cfs_time_add(cfs_time_current(), cfs_time_seconds(seconds)); } -static inline long cfs_timeval_sub(struct timeval *large, struct timeval *small, - struct timeval *result) -{ - long r = (long)( - (large->tv_sec - small->tv_sec) * ONE_MILLION + - (large->tv_usec - small->tv_usec)); - if (result != NULL) { - result->tv_usec = r % ONE_MILLION; - result->tv_sec = r / ONE_MILLION; - } - return r; -} - -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))); -} - -#define CFS_RATELIMIT(seconds) \ -({ \ - /* \ - * XXX nikita: non-portable initializer \ - */ \ - static time_t __next_message; \ - int result; \ - \ - if (cfs_time_after(cfs_time_current(), __next_message)) \ - result = 1; \ - else { \ - __next_message = cfs_time_shift(seconds); \ - result = 0; \ - } \ - result; \ -}) - -/* - * helper function similar to do_gettimeofday() of Linux kernel - */ -static inline void cfs_fs_timeval(struct timeval *tv) -{ - struct timespec 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. diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h index f193f8bdee6e..09c59f080ca3 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h @@ -59,13 +59,6 @@ #include <linux/jiffies.h> - -static inline void cfs_fs_time_usec(struct timespec *t, struct timeval *v) -{ - v->tv_sec = t->tv_sec; - v->tv_usec = t->tv_nsec / 1000; -} - /* * Generic kernel stuff */ @@ -75,16 +68,6 @@ static inline unsigned long cfs_time_current(void) return jiffies; } -static inline void cfs_fs_time_current(struct timespec *t) -{ - *t = CURRENT_TIME; -} - -static inline time_t cfs_fs_time_sec(struct timespec *t) -{ - return t->tv_sec; -} - static inline long cfs_time_seconds(int seconds) { return ((long)seconds) * HZ; |