Just call time_before() instead.
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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(unsigned long t1, unsigned long t2)
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
-/* Portable time API */
-
-/*
- * Platform provides three opaque data-types:
- *
- * unsigned long cfs_time_current(void);
- * 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);
- *
- * long cfs_duration_build(int64_t);
- *
- * 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 *);
- * void cfs_fs_time_usec (struct timespec *, struct timeval *);
- *
- * CFS_TIME_FORMAT
- * CFS_DURATION_FORMAT
- *
- */
-
#define ONE_BILLION ((u_int64_t)1000000000)
#define ONE_MILLION 1000000
* Generic kernel stuff
*/
-static inline int cfs_time_before(unsigned long t1, unsigned long t2)
-{
- return time_before(t1, t2);
-}
-
static inline unsigned long cfs_time_current(void)
{
return jiffies;
}
- if (cfs_time_before(cfs_time_current(), fps->fps_next_retry)) {
+ if (time_before(cfs_time_current(), fps->fps_next_retry)) {
/* someone failed recently */
spin_unlock(&fps->fps_lock);
return -EAGAIN;
goto again;
}
- if (cfs_time_before(cfs_time_current(), ps->ps_next_retry)) {
+ if (time_before(cfs_time_current(), ps->ps_next_retry)) {
/* someone failed recently */
spin_unlock(&ps->ps_lock);
return NULL;
list_for_each_entry(dev, &kiblnd_data.kib_failed_devs,
ibd_fail_list) {
- if (cfs_time_before(cfs_time_current(),
- dev->ibd_next_failover))
+ if (time_before(cfs_time_current(),
+ dev->ibd_next_failover))
continue;
do_failover = 1;
break;
return 0;
if (*ksocknal_tunables.ksnd_keepalive <= 0 ||
- cfs_time_before(cfs_time_current(),
- cfs_time_add(peer->ksnp_last_alive,
- cfs_time_seconds(*ksocknal_tunables.ksnd_keepalive))))
+ time_before(cfs_time_current(),
+ cfs_time_add(peer->ksnp_last_alive,
+ cfs_time_seconds(*ksocknal_tunables.ksnd_keepalive))))
return 0;
- if (cfs_time_before(cfs_time_current(),
- peer->ksnp_send_keepalive))
+ if (time_before(cfs_time_current(), peer->ksnp_send_keepalive))
return 0;
/* retry 10 secs later, so we wouldn't put pressure
cfs_time_add(lp->lp_last_query,
cfs_time_seconds(lnet_queryinterval));
- if (cfs_time_before(now, next_query)) {
+ if (time_before(now, next_query)) {
if (lp->lp_alive)
CWARN("Unexpected aliveness of peer %s: "
"%d < %d (%d/%d)\n",
void
lnet_notify_locked(lnet_peer_t *lp, int notifylnd, int alive, unsigned long when)
{
- if (cfs_time_before(when, lp->lp_timestamp)) { /* out of date information */
+ if (time_before(when, lp->lp_timestamp)) { /* out of date information */
CDEBUG(D_NET, "Out of date\n");
return;
}
#define __fsfilt_check_slow(obd, start, msg) \
do { \
- if (cfs_time_before(jiffies, start + 15 * HZ)) \
+ if (time_before(jiffies, start + 15 * HZ)) \
break; \
- else if (cfs_time_before(jiffies, start + 30 * HZ)) \
+ else if (time_before(jiffies, start + 30 * HZ)) \
CDEBUG(D_VFSTRACE, "%s: slow %s %lus\n", obd->obd_name, \
msg, (jiffies-start) / HZ); \
- else if (cfs_time_before(jiffies, start + DISK_TIMEOUT * HZ)) \
+ else if (time_before(jiffies, start + DISK_TIMEOUT * HZ)) \
CWARN("%s: slow %s %lus\n", obd->obd_name, msg, \
(jiffies - start) / HZ); \
else \
static inline int exp_expired(struct obd_export *exp, long age)
{
LASSERT(exp->exp_delayed);
- return cfs_time_before(cfs_time_add(exp->exp_last_request_time, age),
- get_seconds());
+ return time_before(cfs_time_add(exp->exp_last_request_time, age),
+ get_seconds());
}
static inline int exp_connect_cancelset(struct obd_export *exp)
static inline int ptlrpc_send_limit_expired(struct ptlrpc_request *req)
{
if (req->rq_delay_limit != 0 &&
- cfs_time_before(cfs_time_add(req->rq_queued_time,
- cfs_time_seconds(req->rq_delay_limit)),
- cfs_time_current())) {
+ time_before(cfs_time_add(req->rq_queued_time,
+ cfs_time_seconds(req->rq_delay_limit)),
+ cfs_time_current())) {
return 1;
}
return 0;
{
/* Stop LRU processing if young lock is found and we reach past count */
return ((added >= count) &&
- cfs_time_before(cfs_time_current(),
- cfs_time_add(lock->l_last_used,
- ns->ns_max_age))) ?
+ time_before(cfs_time_current(),
+ cfs_time_add(lock->l_last_used, ns->ns_max_age))) ?
LDLM_POLICY_KEEP_LOCK : LDLM_POLICY_CANCEL_LOCK;
}
ldlm_ns_name(ns), atomic_read(&ns->ns_bref),
ns_is_client(ns) ? "client" : "server");
- if (cfs_time_before(cfs_time_current(), ns->ns_next_dump))
+ if (time_before(cfs_time_current(), ns->ns_next_dump))
return;
cfs_hash_for_each_nolock(ns->ns_rs_hash,
struct upcall_cache_entry *entry)
{
if (UC_CACHE_IS_VALID(entry) &&
- cfs_time_before(cfs_time_current(), entry->ue_expire))
+ time_before(cfs_time_current(), entry->ue_expire))
return 0;
if (UC_CACHE_IS_ACQUIRING(entry)) {
if (entry->ue_acquire_expire == 0 ||
- cfs_time_before(cfs_time_current(),
- entry->ue_acquire_expire))
+ time_before(cfs_time_current(), entry->ue_acquire_expire))
return 0;
UC_CACHE_SET_EXPIRED(entry);
static inline void update_capa_timer(struct obd_capa *ocapa, unsigned long expiry)
{
- if (cfs_time_before(expiry, ll_capa_timer.expires) ||
+ if (time_before(expiry, ll_capa_timer.expires) ||
!timer_pending(&ll_capa_timer)) {
mod_timer(&ll_capa_timer, expiry);
DEBUG_CAPA(D_SEC, &ocapa->c_capa,
* affect the performance.
*/
if (lli->lli_glimpse_time != 0 &&
- cfs_time_before(cfs_time_shift(-1), lli->lli_glimpse_time)) {
+ time_before(cfs_time_shift(-1), lli->lli_glimpse_time)) {
up_write(&lli->lli_glimpse_sem);
lli->lli_agl_index = 0;
iput(inode);
* client renew right after obtaining it. */
static inline int capa_is_to_expire(struct obd_capa *oc)
{
- return cfs_time_before(cfs_time_sub(oc->c_expiry,
- cfs_time_seconds(oc->c_capa.lc_timeout)*2/3),
- cfs_time_current());
+ return time_before(cfs_time_sub(oc->c_expiry,
+ cfs_time_seconds(oc->c_capa.lc_timeout)*2/3),
+ cfs_time_current());
}
static struct obd_capa *find_capa(struct lustre_capa *capa,
"/real "CFS_DURATION_T"]",
req->rq_net_err ? "failed due to network error" :
((req->rq_real_sent == 0 ||
- cfs_time_before(req->rq_real_sent, req->rq_sent) ||
+ time_before((unsigned long)req->rq_real_sent, (unsigned long)req->rq_sent) ||
cfs_time_aftereq(req->rq_real_sent, req->rq_deadline)) ?
"timed out for sent delay" : "timed out for slow reply"),
req->rq_sent, req->rq_real_sent);