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

staging: lustre: libcfs: discard cfs_time_after()



cfs_time_after() behaves exactly like time_after()
similarly cfs_time_aftereq() matches time_after_eq()

so discard the cfs versions.

Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e990f1c6
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -36,20 +36,6 @@

#ifndef __LIBCFS_TIME_H__
#define __LIBCFS_TIME_H__
/*
 * generic time manipulation functions.
 */

static inline int cfs_time_after(unsigned long t1, unsigned long t2)
{
	return time_before(t2, t1);
}

static inline int cfs_time_aftereq(unsigned long t1, unsigned long t2)
{
	return time_before_eq(t2, t1);
}

/*
 * return valid time-out based on user supplied one. Currently we only check
 * that time-out is not shorted than allowed.
+2 −2
Original line number Diff line number Diff line
@@ -1522,7 +1522,7 @@ static int kiblnd_fmr_pool_is_idle(struct kib_fmr_pool *fpo, unsigned long now)
		return 0;
	if (fpo->fpo_failed)
		return 1;
	return cfs_time_aftereq(now, fpo->fpo_deadline);
	return time_after_eq(now, fpo->fpo_deadline);
}

static int
@@ -1850,7 +1850,7 @@ static int kiblnd_pool_is_idle(struct kib_pool *pool, unsigned long now)
		return 0;
	if (pool->po_failed)
		return 1;
	return cfs_time_aftereq(now, pool->po_deadline);
	return time_after_eq(now, pool->po_deadline);
}

void kiblnd_pool_free_node(struct kib_pool *pool, struct list_head *node)
+3 −3
Original line number Diff line number Diff line
@@ -754,7 +754,7 @@ static inline int
kiblnd_send_keepalive(struct kib_conn *conn)
{
	return (*kiblnd_tunables.kib_keepalive > 0) &&
		cfs_time_after(jiffies, conn->ibc_last_send +
		time_after(jiffies, conn->ibc_last_send +
			   msecs_to_jiffies(*kiblnd_tunables.kib_keepalive *
					    MSEC_PER_SEC));
}
+1 −1
Original line number Diff line number Diff line
@@ -3141,7 +3141,7 @@ kiblnd_check_txs_locked(struct kib_conn *conn, struct list_head *txs)
			LASSERT(tx->tx_waiting || tx->tx_sending);
		}

		if (cfs_time_aftereq(jiffies, tx->tx_deadline)) {
		if (time_after_eq(jiffies, tx->tx_deadline)) {
			CERROR("Timed out tx: %s, %lu seconds\n",
			       kiblnd_queue2str(conn, txs),
			       cfs_duration_sec(jiffies - tx->tx_deadline));
+16 −16
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ ksocknal_process_transmit(struct ksock_conn *conn, struct ksock_tx *tx)
		LASSERT(conn->ksnc_tx_scheduled);
		list_add_tail(&conn->ksnc_tx_list,
			      &ksocknal_data.ksnd_enomem_conns);
		if (!cfs_time_aftereq(jiffies + SOCKNAL_ENOMEM_RETRY,
		if (!time_after_eq(jiffies + SOCKNAL_ENOMEM_RETRY,
				   ksocknal_data.ksnd_reaper_waketime))
			wake_up(&ksocknal_data.ksnd_reaper_waitq);

@@ -590,7 +590,7 @@ ksocknal_find_conn_locked(struct ksock_peer *peer, struct ksock_tx *tx,
		case SOCKNAL_MATCH_YES: /* typed connection */
			if (!typed || tnob > nob ||
			    (tnob == nob && *ksocknal_tunables.ksnd_round_robin &&
			     cfs_time_after(typed->ksnc_tx_last_post, c->ksnc_tx_last_post))) {
			     time_after(typed->ksnc_tx_last_post, c->ksnc_tx_last_post))) {
				typed = c;
				tnob  = nob;
			}
@@ -599,7 +599,7 @@ ksocknal_find_conn_locked(struct ksock_peer *peer, struct ksock_tx *tx,
		case SOCKNAL_MATCH_MAY: /* fallback connection */
			if (!fallback || fnob > nob ||
			    (fnob == nob && *ksocknal_tunables.ksnd_round_robin &&
			     cfs_time_after(fallback->ksnc_tx_last_post, c->ksnc_tx_last_post))) {
			     time_after(fallback->ksnc_tx_last_post, c->ksnc_tx_last_post))) {
				fallback = c;
				fnob = nob;
			}
@@ -745,7 +745,7 @@ ksocknal_find_connectable_route_locked(struct ksock_peer *peer)
			continue;

		if (!(!route->ksnr_retry_interval || /* first attempt */
		      cfs_time_aftereq(now, route->ksnr_timeout))) {
		      time_after_eq(now, route->ksnr_timeout))) {
			CDEBUG(D_NET,
			       "Too soon to retry route %pI4h (cnted %d, interval %ld, %ld secs later)\n",
			       &route->ksnr_ipaddr,
@@ -1823,7 +1823,7 @@ ksocknal_connect(struct ksock_route *route)

		write_unlock_bh(&ksocknal_data.ksnd_global_lock);

		if (cfs_time_aftereq(jiffies, deadline)) {
		if (time_after_eq(jiffies, deadline)) {
			rc = -ETIMEDOUT;
			lnet_connect_console_error(rc, peer->ksnp_id.nid,
						   route->ksnr_ipaddr,
@@ -2052,7 +2052,7 @@ ksocknal_connd_get_route_locked(signed long *timeout_p)
	list_for_each_entry(route, &ksocknal_data.ksnd_connd_routes,
			    ksnr_connd_list) {
		if (!route->ksnr_retry_interval ||
		    cfs_time_aftereq(now, route->ksnr_timeout))
		    time_after_eq(now, route->ksnr_timeout))
			return route;

		if (*timeout_p == MAX_SCHEDULE_TIMEOUT ||
@@ -2224,7 +2224,7 @@ ksocknal_find_timed_out_conn(struct ksock_peer *peer)
		}

		if (conn->ksnc_rx_started &&
		    cfs_time_aftereq(jiffies,
		    time_after_eq(jiffies,
				  conn->ksnc_rx_deadline)) {
			/* Timed out incomplete incoming message */
			ksocknal_conn_addref(conn);
@@ -2240,7 +2240,7 @@ ksocknal_find_timed_out_conn(struct ksock_peer *peer)

		if ((!list_empty(&conn->ksnc_tx_queue) ||
		     conn->ksnc_sock->sk->sk_wmem_queued) &&
		    cfs_time_aftereq(jiffies,
		    time_after_eq(jiffies,
				  conn->ksnc_tx_deadline)) {
			/*
			 * Timed out messages queued for sending or
@@ -2268,7 +2268,7 @@ ksocknal_flush_stale_txs(struct ksock_peer *peer)
	write_lock_bh(&ksocknal_data.ksnd_global_lock);

	list_for_each_entry_safe(tx, tmp, &peer->ksnp_tx_queue, tx_list) {
		if (!cfs_time_aftereq(jiffies,
		if (!time_after_eq(jiffies,
				   tx->tx_deadline))
			break;

@@ -2395,7 +2395,7 @@ ksocknal_check_peer_timeouts(int idx)
			tx = list_entry(peer->ksnp_tx_queue.next,
					struct ksock_tx, tx_list);

			if (cfs_time_aftereq(jiffies,
			if (time_after_eq(jiffies,
					  tx->tx_deadline)) {
				ksocknal_peer_addref(peer);
				read_unlock(&ksocknal_data.ksnd_global_lock);
@@ -2413,7 +2413,7 @@ ksocknal_check_peer_timeouts(int idx)
		tx_stale = NULL;
		spin_lock(&peer->ksnp_lock);
		list_for_each_entry(tx, &peer->ksnp_zc_req_list, tx_zc_list) {
			if (!cfs_time_aftereq(jiffies,
			if (!time_after_eq(jiffies,
					   tx->tx_deadline))
				break;
			/* ignore the TX if connection is being closed */
Loading