提交 699503bc 编写于 作者: G Greg Kroah-Hartman

staging: lustre: remove cfs_time_before()

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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 88c03eae
......@@ -55,7 +55,7 @@ static inline unsigned long cfs_time_sub(unsigned long t1, unsigned long t2)
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)
......
......@@ -45,31 +45,6 @@
#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
......@@ -97,11 +72,6 @@ static inline void cfs_fs_time_usec(struct timespec *t, struct timeval *v)
* 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;
......
......@@ -1606,7 +1606,7 @@ kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, __u64 *pages, int npages,
}
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;
......@@ -1808,7 +1808,7 @@ kiblnd_pool_alloc_node(kib_poolset_t *ps)
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;
......
......@@ -3465,8 +3465,8 @@ kiblnd_failover_thread(void *arg)
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;
......
......@@ -2368,13 +2368,12 @@ ksocknal_send_keepalive_locked(ksock_peer_t *peer)
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
......
......@@ -751,7 +751,7 @@ lnet_peer_alive_locked(lnet_peer_t *lp)
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",
......
......@@ -109,7 +109,7 @@ lnet_peers_start_down(void)
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;
}
......
......@@ -90,12 +90,12 @@ static inline char *fsfilt_get_label(struct obd_device *obd,
#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 \
......
......@@ -297,8 +297,8 @@ static inline int exp_connect_multibulk(struct obd_export *exp)
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)
......
......@@ -3100,9 +3100,9 @@ static inline int ptlrpc_req_get_repsize(struct ptlrpc_request *req)
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;
......
......@@ -1508,9 +1508,8 @@ static ldlm_policy_res_t ldlm_cancel_aged_policy(struct ldlm_namespace *ns,
{
/* 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;
}
......
......@@ -1369,7 +1369,7 @@ void ldlm_namespace_dump(int level, struct ldlm_namespace *ns)
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,
......
......@@ -117,13 +117,12 @@ static int check_unlink_entry(struct upcall_cache *cache,
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);
......
......@@ -72,7 +72,7 @@ static int ll_update_capa(struct obd_capa *ocapa, struct lustre_capa *capa);
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,
......
......@@ -587,7 +587,7 @@ static void ll_agl_trigger(struct inode *inode, struct ll_statahead_info *sai)
* 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);
......
......@@ -143,9 +143,9 @@ static inline int capa_hashfn(struct lu_fid *fid)
* 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,
......
......@@ -1894,7 +1894,7 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req, int async_unlink)
"/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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册