staging: lustre: remove cfs_time_before()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Jul 2014 08:03:41 +0000 (01:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Jul 2014 08:03:41 +0000 (01:03 -0700)
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>
17 files changed:
drivers/staging/lustre/include/linux/libcfs/libcfs_time.h
drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
drivers/staging/lustre/lnet/lnet/lib-move.c
drivers/staging/lustre/lnet/lnet/router.c
drivers/staging/lustre/lustre/include/linux/lustre_fsfilt.h
drivers/staging/lustre/lustre/include/lustre_export.h
drivers/staging/lustre/lustre/include/lustre_net.h
drivers/staging/lustre/lustre/ldlm/ldlm_request.c
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
drivers/staging/lustre/lustre/libcfs/upcall_cache.c
drivers/staging/lustre/lustre/llite/llite_capa.c
drivers/staging/lustre/lustre/llite/statahead.c
drivers/staging/lustre/lustre/obdclass/capa.c
drivers/staging/lustre/lustre/ptlrpc/client.c

index 3371e9e0bb4375484b45d775957e0a53644a196f..1344139c46c3e19af1ec28b6fdd0f52e266ea064 100644 (file)
@@ -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)
index b64dfc51287ff8e69214256d25d7354000c0e835..1158a3112bcc71529365bab4d86df67cd8687c54 100644 (file)
 #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;
index 0cdcd5a0521cdbdfa84926bbb908b2a2462213a5..7a47144787d65a47fae67de530be582019a81518 100644 (file)
@@ -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;
index 14f3decb77f12e309b715953d4340f0b75d2e26e..21cd02c369dd76bc0e8859c7477b41329a053bce 100644 (file)
@@ -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;
index 804a6345f2bd903567d9a9cbad0beec2b60a48c3..873c5e72a2b58608b73c33649a825604a4f13bc8 100644 (file)
@@ -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
index 45412a5444c2682bc83bd4834e13d862c73b46aa..4ceec131d1a48c66257f8ae50b3594c007f1e337 100644 (file)
@@ -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",
index 6b19f8707c47074d62041a64fe8a0c8c90942afb..ac38ad271071813f04246b2f335786d0aeac617f 100644 (file)
@@ -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;
        }
index 75cc32c02eb56f5eecef2150cdb31d2ee9d44992..d5c97beb66f54aaa45909f6c4b0345bc98bdef9b 100644 (file)
@@ -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                                                          \
index 4482d61ff7abbe4970b0995f7a5e8186714a6764..e5f8e86cd88718695a5ad40dd09a3f4fa27b6ea9 100644 (file)
@@ -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)
index 92b88f5d9c3dd82d86fdf14da0c9fe36c4b837ed..229fdac5ebd4154a6b3fa7e5fa4729ad77f58d2b 100644 (file)
@@ -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;
index 14b80a8d1cd56e6c80f7343a25d852ba709ae063..589ebaf30cce1ffc8693bbad8374b7e4f8b7b9cd 100644 (file)
@@ -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;
 }
 
index eb166a708be7a9530ca1ab16cec331d598b46785..344b63e7bf5ba1f79405285222eb3d2af0a0da32 100644 (file)
@@ -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,
index ab3a1b4c3d30279084734ae03932c7cc03aa7543..452227da2cb3a8c20e9a8d4b174052c4a798be4b 100644 (file)
@@ -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);
index 2ec55bb4c8d156f7611ab5b09fa0393338471a75..ade58e8a41e37ea9406c2a602d7135724edabaab 100644 (file)
@@ -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,
index 31d92cbe520bce2480532f59e31969a43a47a2b2..bad8a84f8c2f47417446c68a225f5f0292cb502c 100644 (file)
@@ -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);
index 8465fde05140200b1385ebe72cf8648aeeaad273..de9347f9363455e66d84993bc4de4b0893fc3c76 100644 (file)
@@ -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,
index 1a1f87e7502a672b31c21161520495d6483619c7..07cd3edc4345b9fed9424a3a970200082b69cc23 100644 (file)
@@ -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);