Commit 672b63e5 authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman
Browse files

staging: lustre: discard cfs_time_seconds()



cfs_time_seconds() converts a number of seconds to the
matching number of jiffies.
The standard way to do this in Linux is  "* HZ".
So discard cfs_time_seconds() and use "* HZ" instead.

Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Reviewed-by: default avatarPatrick Farrell <paf@cray.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent db1d6cbc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -66,8 +66,8 @@ extern unsigned int libcfs_panic_on_lbug;
# define DEBUG_SUBSYSTEM S_UNDEFINED
#endif

#define CDEBUG_DEFAULT_MAX_DELAY (cfs_time_seconds(600))	 /* jiffies */
#define CDEBUG_DEFAULT_MIN_DELAY ((cfs_time_seconds(1) + 1) / 2) /* jiffies */
#define CDEBUG_DEFAULT_MAX_DELAY (600 * HZ)	 /* jiffies */
#define CDEBUG_DEFAULT_MIN_DELAY ((HZ + 1) / 2) /* jiffies */
#define CDEBUG_DEFAULT_BACKOFF   2
struct cfs_debug_limit_state {
	unsigned long   cdls_next;
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ static inline int cfs_time_aftereq(unsigned long t1, unsigned long t2)

static inline unsigned long cfs_time_shift(int seconds)
{
	return cfs_time_add(cfs_time_current(), cfs_time_seconds(seconds));
	return cfs_time_add(cfs_time_current(), seconds * HZ);
}

/*
+1 −6
Original line number Diff line number Diff line
@@ -65,11 +65,6 @@ static inline unsigned long cfs_time_current(void)
	return jiffies;
}

static inline long cfs_time_seconds(int seconds)
{
	return ((long)seconds) * msecs_to_jiffies(MSEC_PER_SEC);
}

static inline long cfs_duration_sec(long d)
{
	return d / msecs_to_jiffies(MSEC_PER_SEC);
@@ -85,7 +80,7 @@ static inline u64 cfs_time_add_64(u64 t, u64 d)
static inline u64 cfs_time_shift_64(int seconds)
{
	return cfs_time_add_64(cfs_time_current_64(),
			       cfs_time_seconds(seconds));
			       seconds * HZ);
}

static inline int cfs_time_before_64(u64 t1, u64 t2)
+4 −4
Original line number Diff line number Diff line
@@ -1211,7 +1211,7 @@ static struct kib_hca_dev *kiblnd_current_hdev(struct kib_dev *dev)
			CDEBUG(D_NET, "%s: Wait for failover\n",
			       dev->ibd_ifname);
		set_current_state(TASK_INTERRUPTIBLE);
		schedule_timeout(cfs_time_seconds(1) / 100);
		schedule_timeout(HZ / 100);

		read_lock_irqsave(&kiblnd_data.kib_global_lock, flags);
	}
@@ -1921,7 +1921,7 @@ struct list_head *kiblnd_pool_alloc_node(struct kib_poolset *ps)

		set_current_state(TASK_INTERRUPTIBLE);
		schedule_timeout(interval);
		if (interval < cfs_time_seconds(1))
		if (interval < HZ)
			interval *= 2;

		goto again;
@@ -2541,7 +2541,7 @@ static void kiblnd_base_shutdown(void)
			       "Waiting for %d threads to terminate\n",
			       atomic_read(&kiblnd_data.kib_nthreads));
			set_current_state(TASK_UNINTERRUPTIBLE);
			schedule_timeout(cfs_time_seconds(1));
			schedule_timeout(HZ);
		}

		/* fall through */
@@ -2592,7 +2592,7 @@ static void kiblnd_shutdown(struct lnet_ni *ni)
			       libcfs_nid2str(ni->ni_nid),
			       atomic_read(&net->ibn_npeers));
			set_current_state(TASK_UNINTERRUPTIBLE);
			schedule_timeout(cfs_time_seconds(1));
			schedule_timeout(HZ);
		}

		kiblnd_net_fini_pools(net);
+2 −2
Original line number Diff line number Diff line
@@ -3728,8 +3728,8 @@ kiblnd_failover_thread(void *arg)
		add_wait_queue(&kiblnd_data.kib_failover_waitq, &wait);
		write_unlock_irqrestore(glock, flags);

		rc = schedule_timeout(long_sleep ? cfs_time_seconds(10) :
						   cfs_time_seconds(1));
		rc = schedule_timeout(long_sleep ? 10 * HZ :
						   HZ);
		remove_wait_queue(&kiblnd_data.kib_failover_waitq, &wait);
		write_lock_irqsave(glock, flags);

Loading