Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2d201bd authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

staging: lustre: remove cfs_duration_t typedef



Just use 'long' as that is what it was defined as.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7264b8a5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -43,12 +43,12 @@
 * generic time manipulation functions.
 */

static inline unsigned long cfs_time_add(unsigned long t, cfs_duration_t d)
static inline unsigned long cfs_time_add(unsigned long t, long d)
{
	return (unsigned long)(t + d);
}

static inline cfs_duration_t cfs_time_sub(unsigned long t1, unsigned long t2)
static inline long cfs_time_sub(unsigned long t1, unsigned long t2)
{
	return (unsigned long)(t1 - t2);
}
@@ -121,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;
+11 −23
Original line number Diff line number Diff line
@@ -50,26 +50,16 @@
/*
 * Platform provides three opaque data-types:
 *
 *  unsigned long	represents point in time. This is internal kernel
 *		    time rather than "wall clock". This time bears no
 *		    relation to gettimeofday().
 *
 *  cfs_duration_t    represents time interval with resolution of internal
 *		    platform clock
 *
 *  struct timespec     represents instance in world-visible time. This is
 *		    used in file-system time-stamps
 *
 *  unsigned long     cfs_time_current(void);
 *  unsigned long     cfs_time_add    (unsigned long, cfs_duration_t);
 *  cfs_duration_t cfs_time_sub    (unsigned long, unsigned long);
 *  unsigned long     cfs_time_add    (unsigned long, long);
 *  long cfs_time_sub    (unsigned long, unsigned long);
 *  int	    cfs_impl_time_before (unsigned long, unsigned long);
 *  int	    cfs_impl_time_before_eq(unsigned long, unsigned long);
 *
 *  cfs_duration_t cfs_duration_build(int64_t);
 *  long cfs_duration_build(int64_t);
 *
 *  time_t	 cfs_duration_sec (cfs_duration_t);
 *  void	   cfs_duration_usec(cfs_duration_t, struct timeval *);
 *  time_t	 cfs_duration_sec (long);
 *  void	   cfs_duration_usec(long, struct timeval *);
 *
 *  void	   cfs_fs_time_current(struct timespec *);
 *  time_t	 cfs_fs_time_sec    (struct timespec *);
@@ -107,8 +97,6 @@ static inline void cfs_fs_time_usec(struct timespec *t, struct timeval *v)
 * Generic kernel stuff
 */

typedef long cfs_duration_t;

static inline int cfs_time_before(unsigned long t1, unsigned long t2)
{
	return time_before(t1, t2);
@@ -129,28 +117,28 @@ static inline time_t cfs_fs_time_sec(struct timespec *t)
	return t->tv_sec;
}

static inline cfs_duration_t cfs_time_seconds(int seconds)
static inline long cfs_time_seconds(int seconds)
{
	return ((cfs_duration_t)seconds) * HZ;
	return ((long)seconds) * HZ;
}

static inline time_t cfs_duration_sec(cfs_duration_t d)
static inline time_t cfs_duration_sec(long d)
{
	return d / HZ;
}

static inline void cfs_duration_usec(cfs_duration_t d, struct timeval *s)
static inline void cfs_duration_usec(long d, struct timeval *s)
{
#if (BITS_PER_LONG == 32) && (HZ > 4096)
	__u64 t;

	s->tv_sec = d / HZ;
	t = (d - (cfs_duration_t)s->tv_sec * HZ) * ONE_MILLION;
	t = (d - (long)s->tv_sec * HZ) * ONE_MILLION;
	do_div(t, HZ);
	s->tv_usec = t;
#else
	s->tv_sec = d / HZ;
	s->tv_usec = ((d - (cfs_duration_t)s->tv_sec * HZ) * \
	s->tv_usec = ((d - (long)s->tv_sec * HZ) * \
		ONE_MILLION) / HZ;
#endif
}
+1 −1
Original line number Diff line number Diff line
@@ -320,7 +320,7 @@ typedef struct ksock_route
	struct ksock_peer    *ksnr_peer;	/* owning peer */
	atomic_t	  ksnr_refcount;    /* # users */
	unsigned long	    ksnr_timeout;     /* when (in jiffies) reconnection can happen next */
	cfs_duration_t	ksnr_retry_interval; /* how long between retries */
	long	ksnr_retry_interval; /* how long between retries */
	__u32		 ksnr_myipaddr;    /* my IP */
	__u32		 ksnr_ipaddr;      /* IP address to connect to */
	int		   ksnr_port;	/* port to connect to */
+1 −1
Original line number Diff line number Diff line
@@ -2526,7 +2526,7 @@ ksocknal_reaper (void *arg)
	ksock_sched_t     *sched;
	struct list_head	 enomem_conns;
	int		nenomem_conns;
	cfs_duration_t     timeout;
	long     timeout;
	int		i;
	int		peer_index = 0;
	unsigned long	 deadline = cfs_time_current();
+1 −1
Original line number Diff line number Diff line
@@ -512,7 +512,7 @@ int LL_PROC_PROTO(proc_lnet_peers)

			if (lnet_peer_aliveness_enabled(peer)) {
				unsigned long     now = cfs_time_current();
				cfs_duration_t delta;
				long delta;

				delta = cfs_time_sub(now, peer->lp_last_alive);
				lastalive = cfs_duration_sec(delta);
Loading