staging: lustre: remove cfs_time_current_sec wrapper
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Jul 2014 07:38:48 +0000 (00:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Jul 2014 07:38:48 +0000 (00:38 -0700)
Just call get_seconds() directly.

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>
43 files changed:
drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
drivers/staging/lustre/lnet/lnet/api-ni.c
drivers/staging/lustre/lnet/lnet/config.c
drivers/staging/lustre/lnet/lnet/lib-move.c
drivers/staging/lustre/lnet/lnet/router.c
drivers/staging/lustre/lnet/lnet/router_proc.c
drivers/staging/lustre/lnet/selftest/conctl.c
drivers/staging/lustre/lnet/selftest/conrpc.c
drivers/staging/lustre/lnet/selftest/console.c
drivers/staging/lustre/lnet/selftest/framework.c
drivers/staging/lustre/lnet/selftest/rpc.c
drivers/staging/lustre/lnet/selftest/timer.c
drivers/staging/lustre/lustre/include/lustre_capa.h
drivers/staging/lustre/lustre/include/lustre_export.h
drivers/staging/lustre/lustre/include/lustre_import.h
drivers/staging/lustre/lustre/include/lustre_net.h
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
drivers/staging/lustre/lustre/ldlm/ldlm_request.c
drivers/staging/lustre/lustre/libcfs/debug.c
drivers/staging/lustre/lustre/libcfs/upcall_cache.c
drivers/staging/lustre/lustre/llite/llite_lib.c
drivers/staging/lustre/lustre/mdc/mdc_locks.c
drivers/staging/lustre/lustre/mdc/mdc_reint.c
drivers/staging/lustre/lustre/mdc/mdc_request.c
drivers/staging/lustre/lustre/obdclass/genops.c
drivers/staging/lustre/lustre/obdclass/llog.c
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
drivers/staging/lustre/lustre/osc/osc_request.c
drivers/staging/lustre/lustre/ptlrpc/client.c
drivers/staging/lustre/lustre/ptlrpc/events.c
drivers/staging/lustre/lustre/ptlrpc/import.c
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
drivers/staging/lustre/lustre/ptlrpc/niobuf.c
drivers/staging/lustre/lustre/ptlrpc/pinger.c
drivers/staging/lustre/lustre/ptlrpc/sec.c
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c
drivers/staging/lustre/lustre/ptlrpc/sec_config.c
drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c
drivers/staging/lustre/lustre/ptlrpc/service.c

index 96a99b1713b33005e56541ef8231d499265c5d87..0768ecb13f88284f2682042f87f19114b12f75af 100644 (file)
@@ -119,11 +119,6 @@ static inline unsigned long cfs_time_current(void)
        return jiffies;
 }
 
-static inline time_t cfs_time_current_sec(void)
-{
-       return get_seconds();
-}
-
 static inline void cfs_fs_time_current(struct timespec *t)
 {
        *t = CURRENT_TIME;
index c23ffbac3b6d304b1f8c9ffdff102b2e58526b7c..443318ed7265ba423d0efebdb9e22156be0ec344 100644 (file)
@@ -2445,7 +2445,7 @@ ksocknal_base_startup(void)
 
        ksocknal_data.ksnd_connd_starting        = 0;
        ksocknal_data.ksnd_connd_failed_stamp     = 0;
-       ksocknal_data.ksnd_connd_starting_stamp   = cfs_time_current_sec();
+       ksocknal_data.ksnd_connd_starting_stamp   = get_seconds();
        /* must have at least 2 connds to remain responsive to accepts while
         * connecting */
        if (*ksocknal_tunables.ksnd_nconnds < SOCKNAL_CONND_RESV + 1)
index 25bd5161aeba988542e377cf8470cb3dae4fade2..b341c630c44a9836d1f7b641ab1e963583f8a39e 100644 (file)
@@ -2059,7 +2059,7 @@ ksocknal_connd_check_start(long sec, long *timeout)
        /* we tried ... */
        LASSERT(ksocknal_data.ksnd_connd_starting > 0);
        ksocknal_data.ksnd_connd_starting--;
-       ksocknal_data.ksnd_connd_failed_stamp = cfs_time_current_sec();
+       ksocknal_data.ksnd_connd_failed_stamp = get_seconds();
 
        return 1;
 }
@@ -2152,7 +2152,7 @@ ksocknal_connd (void *arg)
 
        while (!ksocknal_data.ksnd_shuttingdown) {
                ksock_route_t *route = NULL;
-               long sec = cfs_time_current_sec();
+               long sec = get_seconds();
                long timeout = MAX_SCHEDULE_TIMEOUT;
                int  dropped_lock = 0;
 
index 8aa57c99116dcd964cd2b053dfdd7022ffe393ff..d6236ea83b8e732918e01396f48fe372790c73d3 100644 (file)
@@ -1452,7 +1452,7 @@ LNetCtl(unsigned int cmd, void *arg)
        case IOC_LIBCFS_NOTIFY_ROUTER:
                return lnet_notify(NULL, data->ioc_nid, data->ioc_flags,
                                   cfs_time_current() -
-                                  cfs_time_seconds(cfs_time_current_sec() -
+                                  cfs_time_seconds(get_seconds() -
                                                    (time_t)data->ioc_u64[0]));
 
        case IOC_LIBCFS_PORTALS_COMPATIBILITY:
index d39bc43715960a602f0cc306fddcbed7306825e1..7c8b9476bfbb59238f362e56f48b25394f53f462 100644 (file)
@@ -166,7 +166,7 @@ lnet_ni_alloc(__u32 net, struct cfs_expr_list *el, struct list_head *nilist)
 
        /* LND will fill in the address part of the NID */
        ni->ni_nid = LNET_MKNID(net, 0);
-       ni->ni_last_alive = cfs_time_current_sec();
+       ni->ni_last_alive = get_seconds();
        list_add_tail(&ni->ni_list, nilist);
        return ni;
  failed:
index 4a63516a26ddf3c7a01c9cf08000c38f3f40e635..45412a5444c2682bc83bd4834e13d862c73b46aa 100644 (file)
@@ -1780,11 +1780,11 @@ lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t from_nid,
        }
 
        if (the_lnet.ln_routing &&
-           ni->ni_last_alive != cfs_time_current_sec()) {
+           ni->ni_last_alive != get_seconds()) {
                lnet_ni_lock(ni);
 
                /* NB: so far here is the only place to set NI status to "up */
-               ni->ni_last_alive = cfs_time_current_sec();
+               ni->ni_last_alive = get_seconds();
                if (ni->ni_status != NULL &&
                    ni->ni_status->ns_status == LNET_NI_STATUS_DOWN)
                        ni->ni_status->ns_status = LNET_NI_STATUS_UP;
index 18965b92235d26a9d4814d180272c8fcc848ad8f..6b19f8707c47074d62041a64fe8a0c8c90942afb 100644 (file)
@@ -796,7 +796,7 @@ lnet_update_ni_status_locked(void)
        timeout = router_ping_timeout +
                  MAX(live_router_check_interval, dead_router_check_interval);
 
-       now = cfs_time_current_sec();
+       now = get_seconds();
        list_for_each_entry(ni, &the_lnet.ln_nis, ni_list) {
                if (ni->ni_lnd->lnd_type == LOLND)
                        continue;
@@ -1587,7 +1587,7 @@ lnet_router_checker (void)
        static time_t last = 0;
        static int    running = 0;
 
-       time_t      now = cfs_time_current_sec();
+       time_t      now = get_seconds();
        int            interval = now - last;
        int            rc;
        __u64        version;
index 7e78807c0093ce547c6583ca7683440e939f6019..fcf3b0453386aaa46085feec4710fad3277859dd 100644 (file)
@@ -675,7 +675,7 @@ int LL_PROC_PROTO(proc_lnet_nis)
                if (ni != NULL) {
                        struct lnet_tx_queue    *tq;
                        char    *stat;
-                       long    now = cfs_time_current_sec();
+                       long    now = get_seconds();
                        int     last_alive = -1;
                        int     i;
                        int     j;
index 3df1a0d85443a30be968f3aaa31ae47521cd9cc1..ae7b0fcd818d6ba7b6937ff6ae9e0c5a017add19 100644 (file)
@@ -837,7 +837,7 @@ lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data)
 
        mutex_lock(&console_session.ses_mutex);
 
-       console_session.ses_laststamp = cfs_time_current_sec();
+       console_session.ses_laststamp = get_seconds();
 
        if (console_session.ses_shutdown) {
                rc = -ESHUTDOWN;
index abc9b8c59d5d2abdbf7324a856ddca822da41226..6d9c45acdaa385a735983cb3e636dda22623ed3b 100644 (file)
@@ -1187,7 +1187,7 @@ lstcon_rpc_pinger(void *arg)
        }
 
        if (!console_session.ses_expired &&
-           cfs_time_current_sec() - console_session.ses_laststamp >
+           get_seconds() - console_session.ses_laststamp >
            (time_t)console_session.ses_timeout)
                console_session.ses_expired = 1;
 
@@ -1274,7 +1274,7 @@ lstcon_rpc_pinger(void *arg)
 
        CDEBUG(D_NET, "Ping %d nodes in session\n", count);
 
-       ptimer->stt_expires = (unsigned long)(cfs_time_current_sec() + LST_PING_INTERVAL);
+       ptimer->stt_expires = (unsigned long)(get_seconds() + LST_PING_INTERVAL);
        stt_add_timer(ptimer);
 
        mutex_unlock(&console_session.ses_mutex);
@@ -1297,7 +1297,7 @@ lstcon_rpc_pinger_start(void)
        }
 
        ptimer = &console_session.ses_ping_timer;
-       ptimer->stt_expires = (unsigned long)(cfs_time_current_sec() + LST_PING_INTERVAL);
+       ptimer->stt_expires = (unsigned long)(get_seconds() + LST_PING_INTERVAL);
 
        stt_add_timer(ptimer);
 
index 01670a6fbaeb47422309e5e647c51904162f0ad7..89e1b4bd5a508f60b3a9218a7f49175d884307f7 100644 (file)
@@ -2006,7 +2006,7 @@ lstcon_console_init(void)
        console_session.ses_expired         = 0;
        console_session.ses_feats_updated   = 0;
        console_session.ses_features        = LST_FEATS_MASK;
-       console_session.ses_laststamp       = cfs_time_current_sec();
+       console_session.ses_laststamp       = get_seconds();
 
        mutex_init(&console_session.ses_mutex);
 
index b2b63e93cc505b7439b8d7d92c28d75066b231c3..aef0041973b8a2f532e80fe87c9e9590cf769a7e 100644 (file)
@@ -171,7 +171,7 @@ sfw_add_session_timer (void)
 
        sn->sn_timer_active = 1;
        timer->stt_expires = cfs_time_add(sn->sn_timeout,
-                                         cfs_time_current_sec());
+                                         get_seconds());
        stt_add_timer(timer);
        return;
 }
index 9fc0429e82961b19579d525466aadf20ed4ca537..dbbbf0cab8e3835f986c4eb7885fd0e3db4ed1cf 100644 (file)
@@ -563,7 +563,7 @@ srpc_add_buffer(struct swi_workitem *wi)
        }
 
        if (rc != 0) {
-               scd->scd_buf_err_stamp = cfs_time_current_sec();
+               scd->scd_buf_err_stamp = get_seconds();
                scd->scd_buf_err = rc;
 
                LASSERT(scd->scd_buf_posting > 0);
@@ -1098,7 +1098,7 @@ srpc_add_client_rpc_timer (srpc_client_rpc_t *rpc)
        timer->stt_data    = rpc;
        timer->stt_func    = srpc_client_rpc_expired;
        timer->stt_expires = cfs_time_add(rpc->crpc_timeout,
-                                         cfs_time_current_sec());
+                                         get_seconds());
        stt_add_timer(timer);
        return;
 }
@@ -1481,7 +1481,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
                }
 
                if (scd->scd_buf_err_stamp != 0 &&
-                   scd->scd_buf_err_stamp < cfs_time_current_sec()) {
+                   scd->scd_buf_err_stamp < get_seconds()) {
                        /* re-enable adding buffer */
                        scd->scd_buf_err_stamp = 0;
                        scd->scd_buf_err = 0;
@@ -1587,7 +1587,7 @@ srpc_startup (void)
        /* 1 second pause to avoid timestamp reuse */
        set_current_state(TASK_UNINTERRUPTIBLE);
        schedule_timeout(cfs_time_seconds(1));
-       srpc_data.rpc_matchbits = ((__u64) cfs_time_current_sec()) << 48;
+       srpc_data.rpc_matchbits = ((__u64) get_seconds()) << 48;
 
        srpc_data.rpc_state = SRPC_STATE_NONE;
 
index 61a55b3d9bfcee18aa5685f6b267407242afc1f6..91d4caa4edb0a2ff91505d4e2838122e08184378 100644 (file)
@@ -78,7 +78,7 @@ stt_add_timer(stt_timer_t *timer)
        LASSERT(!stt_data.stt_shuttingdown);
        LASSERT(timer->stt_func != NULL);
        LASSERT(list_empty(&timer->stt_list));
-       LASSERT(cfs_time_after(timer->stt_expires, cfs_time_current_sec()));
+       LASSERT(cfs_time_after(timer->stt_expires, get_seconds()));
 
        /* a simple insertion sort */
        list_for_each_prev(pos, STTIMER_SLOT(timer->stt_expires)) {
@@ -152,7 +152,7 @@ stt_check_timers(unsigned long *last)
        unsigned long now;
        unsigned long this_slot;
 
-       now = cfs_time_current_sec();
+       now = get_seconds();
        this_slot = now & STTIMER_SLOTTIMEMASK;
 
        spin_lock(&stt_data.stt_lock);
@@ -212,7 +212,7 @@ stt_startup(void)
        int i;
 
        stt_data.stt_shuttingdown = 0;
-       stt_data.stt_prev_slot = cfs_time_current_sec() & STTIMER_SLOTTIMEMASK;
+       stt_data.stt_prev_slot = get_seconds() & STTIMER_SLOTTIMEMASK;
 
        spin_lock_init(&stt_data.stt_lock);
        for (i = 0; i < STTIMER_NSLOTS; i++)
index 08f24bdd3071fb0b4ef02513d749b3224a9f1457..3346ee9d43cd38c679522bed6537111da0fad1d9 100644 (file)
@@ -267,14 +267,14 @@ static inline __u64 capa_open_opc(int mode)
 static inline void set_capa_expiry(struct obd_capa *ocapa)
 {
        unsigned long expiry = cfs_time_sub((unsigned long)ocapa->c_capa.lc_expiry,
-                                        cfs_time_current_sec());
+                                        get_seconds());
        ocapa->c_expiry = cfs_time_add(cfs_time_current(),
                                       cfs_time_seconds(expiry));
 }
 
 static inline int capa_is_expired_sec(struct lustre_capa *capa)
 {
-       return (capa->lc_expiry - cfs_time_current_sec() <= 0);
+       return (capa->lc_expiry - get_seconds() <= 0);
 }
 
 static inline int capa_is_expired(struct obd_capa *ocapa)
index a5f420145355d85024d710b190e87d1a4432fcbc..fe2120e3c6d23f3ca838fee1fe74a5cfb974756f 100644 (file)
@@ -298,7 +298,7 @@ static inline int exp_expired(struct obd_export *exp, cfs_duration_t age)
 {
        LASSERT(exp->exp_delayed);
        return cfs_time_before(cfs_time_add(exp->exp_last_request_time, age),
-                              cfs_time_current_sec());
+                              get_seconds());
 }
 
 static inline int exp_connect_cancelset(struct obd_export *exp)
index 037af258351324414aec92afafb151a9d33bb9c4..8304a55b92f9cdaba60be1a6c3907042b52f43a5 100644 (file)
@@ -350,7 +350,7 @@ static inline void at_reset(struct adaptive_timeout *at, int val) {
        spin_lock(&at->at_lock);
        at->at_current = val;
        at->at_worst_ever = val;
-       at->at_worst_time = cfs_time_current_sec();
+       at->at_worst_time = get_seconds();
        spin_unlock(&at->at_lock);
 }
 static inline void at_init(struct adaptive_timeout *at, int val, int flags) {
index 60141545aea2267c29a0e8dd4d4dcbc525128985..689e6249f313bda210a7a045c60042b6be9a1cb4 100644 (file)
@@ -2594,7 +2594,7 @@ static inline int ptlrpc_client_bulk_active(struct ptlrpc_request *req)
        desc = req->rq_bulk;
 
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_BULK_UNLINK) &&
-           req->rq_bulk_deadline > cfs_time_current_sec())
+           req->rq_bulk_deadline > get_seconds())
                return 1;
 
        if (!desc)
@@ -3002,7 +3002,7 @@ static inline int
 ptlrpc_client_early(struct ptlrpc_request *req)
 {
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK) &&
-           req->rq_reply_deadline > cfs_time_current_sec())
+           req->rq_reply_deadline > get_seconds())
                return 0;
        return req->rq_early;
 }
@@ -3014,7 +3014,7 @@ static inline int
 ptlrpc_client_replied(struct ptlrpc_request *req)
 {
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK) &&
-           req->rq_reply_deadline > cfs_time_current_sec())
+           req->rq_reply_deadline > get_seconds())
                return 0;
        return req->rq_replied;
 }
@@ -3024,7 +3024,7 @@ static inline int
 ptlrpc_client_recv(struct ptlrpc_request *req)
 {
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK) &&
-           req->rq_reply_deadline > cfs_time_current_sec())
+           req->rq_reply_deadline > get_seconds())
                return 1;
        return req->rq_receiving_reply;
 }
@@ -3036,7 +3036,7 @@ ptlrpc_client_recv_or_unlink(struct ptlrpc_request *req)
 
        spin_lock(&req->rq_lock);
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK) &&
-           req->rq_reply_deadline > cfs_time_current_sec()) {
+           req->rq_reply_deadline > get_seconds()) {
                spin_unlock(&req->rq_lock);
                return 1;
        }
index cf71deb3f4ce8f07a5658ab85609bd1b0cef7dc3..68f030ba4a61c701465947c94aca0fd74298090b 100644 (file)
@@ -1594,7 +1594,7 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns,
        ldlm_error_t rc = ELDLM_OK;
        struct ldlm_interval *node = NULL;
 
-       lock->l_last_activity = cfs_time_current_sec();
+       lock->l_last_activity = get_seconds();
        /* policies are not executed on the client or during replay */
        if ((*flags & (LDLM_FL_HAS_INTENT|LDLM_FL_REPLAY)) == LDLM_FL_HAS_INTENT
            && !local && ns->ns_policy) {
index d3d1a397489b2e89247b8e84b6ec55d2c95c3478..ec8cd52066e91cae60129414361fb07f6a5e2eab 100644 (file)
@@ -334,12 +334,12 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl)
 {
        time_t recalc_interval_sec;
 
-       recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
+       recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
        if (recalc_interval_sec < pl->pl_recalc_period)
                return 0;
 
        spin_lock(&pl->pl_lock);
-       recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
+       recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
        if (recalc_interval_sec < pl->pl_recalc_period) {
                spin_unlock(&pl->pl_lock);
                return 0;
@@ -360,7 +360,7 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl)
         */
        ldlm_pool_recalc_grant_plan(pl);
 
-       pl->pl_recalc_time = cfs_time_current_sec();
+       pl->pl_recalc_time = get_seconds();
        lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT,
                            recalc_interval_sec);
        spin_unlock(&pl->pl_lock);
@@ -471,7 +471,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
 {
        time_t recalc_interval_sec;
 
-       recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
+       recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
        if (recalc_interval_sec < pl->pl_recalc_period)
                return 0;
 
@@ -479,7 +479,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
        /*
         * Check if we need to recalc lists now.
         */
-       recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
+       recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
        if (recalc_interval_sec < pl->pl_recalc_period) {
                spin_unlock(&pl->pl_lock);
                return 0;
@@ -490,7 +490,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
         */
        ldlm_cli_pool_pop_slv(pl);
 
-       pl->pl_recalc_time = cfs_time_current_sec();
+       pl->pl_recalc_time = get_seconds();
        lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT,
                            recalc_interval_sec);
        spin_unlock(&pl->pl_lock);
@@ -564,7 +564,7 @@ int ldlm_pool_recalc(struct ldlm_pool *pl)
        time_t recalc_interval_sec;
        int count;
 
-       recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
+       recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
        if (recalc_interval_sec <= 0)
                goto recalc;
 
@@ -589,7 +589,7 @@ int ldlm_pool_recalc(struct ldlm_pool *pl)
                lprocfs_counter_add(pl->pl_stats, LDLM_POOL_RECALC_STAT,
                                    count);
        }
-       recalc_interval_sec = pl->pl_recalc_time - cfs_time_current_sec() +
+       recalc_interval_sec = pl->pl_recalc_time - get_seconds() +
                              pl->pl_recalc_period;
 
        return recalc_interval_sec;
@@ -837,7 +837,7 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,
 
        spin_lock_init(&pl->pl_lock);
        atomic_set(&pl->pl_granted, 0);
-       pl->pl_recalc_time = cfs_time_current_sec();
+       pl->pl_recalc_time = get_seconds();
        atomic_set(&pl->pl_lock_volume_factor, 1);
 
        atomic_set(&pl->pl_grant_rate, 0);
index 5871fe4eb389cf428239bcb7de89094dd6e0b145..14b80a8d1cd56e6c80f7343a25d852ba709ae063 100644 (file)
@@ -100,13 +100,13 @@ int ldlm_expired_completion_wait(void *data)
                LCONSOLE_WARN("lock timed out (enqueued at "CFS_TIME_T", "
                              CFS_DURATION_T"s ago)\n",
                              lock->l_last_activity,
-                             cfs_time_sub(cfs_time_current_sec(),
+                             cfs_time_sub(get_seconds(),
                                           lock->l_last_activity));
                LDLM_DEBUG(lock, "lock timed out (enqueued at "CFS_TIME_T", "
                           CFS_DURATION_T"s ago); not entering recovery in "
                           "server code, just going back to sleep",
                           lock->l_last_activity,
-                          cfs_time_sub(cfs_time_current_sec(),
+                          cfs_time_sub(get_seconds(),
                                        lock->l_last_activity));
                if (cfs_time_after(cfs_time_current(), next_dump)) {
                        last_dump = next_dump;
@@ -125,7 +125,7 @@ int ldlm_expired_completion_wait(void *data)
        LDLM_ERROR(lock, "lock timed out (enqueued at "CFS_TIME_T", "
                  CFS_DURATION_T"s ago), entering recovery for %s@%s",
                  lock->l_last_activity,
-                 cfs_time_sub(cfs_time_current_sec(), lock->l_last_activity),
+                 cfs_time_sub(get_seconds(), lock->l_last_activity),
                  obd2cli_tgt(obd), imp->imp_connection->c_remote_uuid.uuid);
 
        return 0;
@@ -160,7 +160,7 @@ static int ldlm_completion_tail(struct ldlm_lock *lock)
                LDLM_DEBUG(lock, "client-side enqueue: destroyed");
                result = -EIO;
        } else {
-               delay = cfs_time_sub(cfs_time_current_sec(),
+               delay = cfs_time_sub(get_seconds(),
                                     lock->l_last_activity);
                LDLM_DEBUG(lock, "client-side enqueue: granted after "
                           CFS_DURATION_T"s", delay);
index 2373ccdba9b385bd50931d66ddef7eb4e9bf3c79..5765cbb185e076ed4371e7b200409d47d23562c0 100644 (file)
@@ -343,7 +343,7 @@ void libcfs_debug_dumplog_internal(void *arg)
        if (strncmp(libcfs_debug_file_path_arr, "NONE", 4) != 0) {
                snprintf(debug_file_name, sizeof(debug_file_name) - 1,
                         "%s.%ld." LPLD, libcfs_debug_file_path_arr,
-                        cfs_time_current_sec(), (long_ptr_t)arg);
+                        get_seconds(), (long_ptr_t)arg);
                printk(KERN_ALERT "LustreError: dumping log to %s\n",
                       debug_file_name);
                cfs_tracefile_dump_all_pages(debug_file_name);
index ab5c763aed948e49ab123e2636797a82ec189837..ab3a1b4c3d30279084734ae03932c7cc03aa7543 100644 (file)
@@ -406,7 +406,7 @@ void upcall_cache_flush_one(struct upcall_cache *cache, __u64 key, void *args)
                      "cur %lu, ex %ld/%ld\n",
                      cache->uc_name, entry, entry->ue_key,
                      atomic_read(&entry->ue_refcount), entry->ue_flags,
-                     cfs_time_current_sec(), entry->ue_acquire_expire,
+                     get_seconds(), entry->ue_acquire_expire,
                      entry->ue_expire);
                UC_CACHE_SET_EXPIRED(entry);
                if (!atomic_read(&entry->ue_refcount))
index 5e96e4239a03c2c0964efe4e3039a402169f4107..1f58a054569d32e27df8b4b47c4f9acf71a26a7a 100644 (file)
@@ -1412,7 +1412,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
        if (attr->ia_valid & (ATTR_MTIME | ATTR_CTIME))
                CDEBUG(D_INODE, "setting mtime %lu, ctime %lu, now = %lu\n",
                       LTIME_S(attr->ia_mtime), LTIME_S(attr->ia_ctime),
-                      cfs_time_current_sec());
+                      get_seconds());
 
        /* If we are changing file size, file content is modified, flag it. */
        if (attr->ia_valid & ATTR_SIZE) {
@@ -2247,7 +2247,7 @@ struct md_op_data * ll_prep_md_op_data(struct md_op_data *op_data,
        op_data->op_name = name;
        op_data->op_namelen = namelen;
        op_data->op_mode = mode;
-       op_data->op_mod_time = cfs_time_current_sec();
+       op_data->op_mod_time = get_seconds();
        op_data->op_fsuid = from_kuid(&init_user_ns, current_fsuid());
        op_data->op_fsgid = from_kgid(&init_user_ns, current_fsgid());
        op_data->op_cap = cfs_curproc_cap_pack();
index 35663705b097bfb48cc25093e761173720ff8053..71219b90e22bba919644f0524ba130b237d73184 100644 (file)
@@ -860,7 +860,7 @@ resend:
        if (resends) {
                req->rq_generation_set = 1;
                req->rq_import_generation = generation;
-               req->rq_sent = cfs_time_current_sec() + resends;
+               req->rq_sent = get_seconds() + resends;
        }
 
        /* It is important to obtain rpc_lock first (if applicable), so that
index 1a909ac84332575bc48ff582557cd067f73d931d..c5420a42bc33932c7cd9602841f87743a79e0d79 100644 (file)
@@ -273,7 +273,7 @@ rebuild:
        if (resends) {
                req->rq_generation_set = 1;
                req->rq_import_generation = generation;
-               req->rq_sent = cfs_time_current_sec() + resends;
+               req->rq_sent = get_seconds() + resends;
        }
        level = LUSTRE_IMP_FULL;
  resend:
index 6ffcd32d58e457e0c85b58c77ceacb000fcd3361..fb9d30eddaba9ce71c3ebb203231dfe33a22ce31 100644 (file)
@@ -397,7 +397,7 @@ static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
                rec->sx_suppgid2 = -1;
                rec->sx_fid    = *fid;
                rec->sx_valid  = valid | OBD_MD_FLCTIME;
-               rec->sx_time   = cfs_time_current_sec();
+               rec->sx_time   = get_seconds();
                rec->sx_size   = output_size;
                rec->sx_flags  = flags;
 
index c5e847abb28eadda02bb33ad361e0ae1ecc16417..b32578604c1c57c25bf94c1123cb4cd04ae62c95 100644 (file)
@@ -842,7 +842,7 @@ struct obd_export *class_new_export(struct obd_device *obd,
        INIT_LIST_HEAD(&export->exp_handle.h_link);
        INIT_LIST_HEAD(&export->exp_hp_rpcs);
        class_handle_hash(&export->exp_handle, &export_handle_ops);
-       export->exp_last_request_time = cfs_time_current_sec();
+       export->exp_last_request_time = get_seconds();
        spin_lock_init(&export->exp_lock);
        spin_lock_init(&export->exp_rpc_lock);
        INIT_HLIST_NODE(&export->exp_uuid_hash);
index bb4a9998a9d622b496c53215d664be6af60d7e3a..cce86890c563e5341a2e310f2ed67ffe955228c6 100644 (file)
@@ -188,7 +188,7 @@ static int llog_read_header(const struct lu_env *env,
                llh->llh_hdr.lrh_type = LLOG_HDR_MAGIC;
                llh->llh_hdr.lrh_len = llh->llh_tail.lrt_len = LLOG_CHUNK_SIZE;
                llh->llh_hdr.lrh_index = llh->llh_tail.lrt_index = 0;
-               llh->llh_timestamp = cfs_time_current_sec();
+               llh->llh_timestamp = get_seconds();
                if (uuid)
                        memcpy(&llh->llh_tgtuuid, uuid,
                               sizeof(llh->llh_tgtuuid));
index 925af9f5ec557f1c353cfaa126176e0ea2b4cbe7..842c06e4426187c646629cc32d516b490e391888 100644 (file)
@@ -868,7 +868,7 @@ int lprocfs_rd_timeouts(struct seq_file *m, void *data)
        LPROCFS_CLIMP_CHECK(obd);
        imp = obd->u.cli.cl_import;
 
-       now = cfs_time_current_sec();
+       now = get_seconds();
 
        /* Some network health info for kicks */
        s2dhms(&ts, now - imp->imp_last_reply_time);
index ed89533794186862bc28e86fe68c24ee2cafb2ab..6fe43c164ea262134011ac5f3264b2406d168144 100644 (file)
@@ -1639,7 +1639,7 @@ restart_bulk:
        if (resends) {
                req->rq_generation_set = 1;
                req->rq_import_generation = generation;
-               req->rq_sent = cfs_time_current_sec() + resends;
+               req->rq_sent = get_seconds() + resends;
        }
 
        rc = ptlrpc_queue_wait(req);
@@ -1722,9 +1722,9 @@ static int osc_brw_redo_request(struct ptlrpc_request *request,
        /* cap resend delay to the current request timeout, this is similar to
         * what ptlrpc does (see after_reply()) */
        if (aa->aa_resends > new_req->rq_timeout)
-               new_req->rq_sent = cfs_time_current_sec() + new_req->rq_timeout;
+               new_req->rq_sent = get_seconds() + new_req->rq_timeout;
        else
-               new_req->rq_sent = cfs_time_current_sec() + aa->aa_resends;
+               new_req->rq_sent = get_seconds() + aa->aa_resends;
        new_req->rq_generation_set = 1;
        new_req->rq_import_generation = request->rq_import_generation;
 
index 612e9fe6ce0b430af112a9cc2c27448b960c076c..1a1f87e7502a672b31c21161520495d6483619c7 100644 (file)
@@ -283,7 +283,7 @@ static void ptlrpc_at_adj_net_latency(struct ptlrpc_request *req,
 {
        unsigned int nl, oldnl;
        struct imp_at *at;
-       time_t now = cfs_time_current_sec();
+       time_t now = get_seconds();
 
        LASSERT(req->rq_import);
        at = &req->rq_import->imp_at;
@@ -367,13 +367,13 @@ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req)
        olddl = req->rq_deadline;
        /* server assumes it now has rq_timeout from when it sent the
         * early reply, so client should give it at least that long. */
-       req->rq_deadline = cfs_time_current_sec() + req->rq_timeout +
+       req->rq_deadline = get_seconds() + req->rq_timeout +
                           ptlrpc_at_get_net_latency(req);
 
        DEBUG_REQ(D_ADAPTTO, req,
                  "Early reply #%d, new deadline in "CFS_DURATION_T"s "
                  "("CFS_DURATION_T"s)", req->rq_early_count,
-                 cfs_time_sub(req->rq_deadline, cfs_time_current_sec()),
+                 cfs_time_sub(req->rq_deadline, get_seconds()),
                  cfs_time_sub(req->rq_deadline, olddl));
 
        return rc;
@@ -1248,7 +1248,7 @@ static int after_reply(struct ptlrpc_request *req)
        /* retry indefinitely on EINPROGRESS */
        if (lustre_msg_get_status(req->rq_repmsg) == -EINPROGRESS &&
            ptlrpc_no_resend(req) == 0 && !req->rq_no_retry_einprogress) {
-               time_t  now = cfs_time_current_sec();
+               time_t  now = get_seconds();
 
                DEBUG_REQ(D_RPCTRACE, req, "Resending request on EINPROGRESS");
                req->rq_resend = 1;
@@ -1395,7 +1395,7 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req)
        int rc;
 
        LASSERT(req->rq_phase == RQ_PHASE_NEW);
-       if (req->rq_sent && (req->rq_sent > cfs_time_current_sec()) &&
+       if (req->rq_sent && (req->rq_sent > get_seconds()) &&
            (!req->rq_generation_set ||
             req->rq_import_generation == imp->imp_generation))
                return 0;
@@ -1534,7 +1534,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
 
                /* delayed resend - skip */
                if (req->rq_phase == RQ_PHASE_RPC && req->rq_resend &&
-                   req->rq_sent > cfs_time_current_sec())
+                   req->rq_sent > get_seconds())
                        continue;
 
                if (!(req->rq_phase == RQ_PHASE_RPC ||
@@ -1955,7 +1955,7 @@ int ptlrpc_expired_set(void *data)
 {
        struct ptlrpc_request_set *set = data;
        struct list_head                *tmp;
-       time_t               now = cfs_time_current_sec();
+       time_t               now = get_seconds();
 
        LASSERT(set != NULL);
 
@@ -2038,7 +2038,7 @@ EXPORT_SYMBOL(ptlrpc_interrupted_set);
 int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set)
 {
        struct list_head            *tmp;
-       time_t           now = cfs_time_current_sec();
+       time_t           now = get_seconds();
        int                 timeout = 0;
        struct ptlrpc_request *req;
        int                 deadline;
@@ -2356,7 +2356,7 @@ int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
         */
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK) &&
            async && request->rq_reply_deadline == 0)
-               request->rq_reply_deadline = cfs_time_current_sec()+LONG_UNLINK;
+               request->rq_reply_deadline = get_seconds()+LONG_UNLINK;
 
        /*
         * Nothing left to do.
@@ -2927,7 +2927,7 @@ static spinlock_t ptlrpc_last_xid_lock;
 #define YEAR_2004 (1ULL << 30)
 void ptlrpc_init_xid(void)
 {
-       time_t now = cfs_time_current_sec();
+       time_t now = get_seconds();
 
        spin_lock_init(&ptlrpc_last_xid_lock);
        if (now < YEAR_2004) {
@@ -3016,7 +3016,7 @@ static void ptlrpcd_add_work_req(struct ptlrpc_request *req)
 {
        /* re-initialize the req */
        req->rq_timeout         = obd_timeout;
-       req->rq_sent            = cfs_time_current_sec();
+       req->rq_sent            = get_seconds();
        req->rq_deadline        = req->rq_sent + req->rq_timeout;
        req->rq_reply_deadline  = req->rq_deadline;
        req->rq_phase           = RQ_PHASE_INTERPRET;
index 5a2984e063d790abc84c4e6bbac38d0334e88e59..0c9907887a62bfb5f84cad25287a2bddbd8f77a8 100644 (file)
@@ -64,7 +64,7 @@ void request_out_callback(lnet_event_t *ev)
 
        sptlrpc_request_out_callback(req);
        spin_lock(&req->rq_lock);
-       req->rq_real_sent = cfs_time_current_sec();
+       req->rq_real_sent = get_seconds();
        if (ev->unlinked)
                req->rq_req_unlink = 0;
 
@@ -158,7 +158,7 @@ void reply_in_callback(lnet_event_t *ev)
                          ev->mlength, ev->offset, req->rq_replen);
        }
 
-       req->rq_import->imp_last_reply_time = cfs_time_current_sec();
+       req->rq_import->imp_last_reply_time = get_seconds();
 
 out_wake:
        /* NB don't unlock till after wakeup; req can disappear under us
index 931e052ede1a5e4620737f190a68c9f240b3cb65..6eb28e6227ecb69258d98d00b57002e155077b19 100644 (file)
@@ -66,7 +66,7 @@ static void __import_set_state(struct obd_import *imp,
        imp->imp_state = state;
        imp->imp_state_hist[imp->imp_state_hist_idx].ish_state = state;
        imp->imp_state_hist[imp->imp_state_hist_idx].ish_time =
-               cfs_time_current_sec();
+               get_seconds();
        imp->imp_state_hist_idx = (imp->imp_state_hist_idx + 1) %
                IMP_STATE_HIST_LEN;
 }
@@ -242,7 +242,7 @@ ptlrpc_inflight_deadline(struct ptlrpc_request *req, time_t now)
 
 static unsigned int ptlrpc_inflight_timeout(struct obd_import *imp)
 {
-       time_t now = cfs_time_current_sec();
+       time_t now = get_seconds();
        struct list_head *tmp, *n;
        struct ptlrpc_request *req;
        unsigned int timeout = 0;
@@ -1537,7 +1537,7 @@ extern unsigned int at_min, at_max, at_history;
 int at_measured(struct adaptive_timeout *at, unsigned int val)
 {
        unsigned int old = at->at_current;
-       time_t now = cfs_time_current_sec();
+       time_t now = get_seconds();
        time_t binlimit = max_t(time_t, at_history / AT_BINS, 1);
 
        LASSERT(at);
index de98694e6fd5a422fe4ca7fcb6df1946b9ce360d..9df1921ebbbab897a6d2cdc497c0d173b38f9121 100644 (file)
@@ -991,7 +991,7 @@ static int ptlrpc_lprocfs_timeouts_seq_show(struct seq_file *m, void *n)
                cur     = at_get(&svcpt->scp_at_estimate);
                worst   = svcpt->scp_at_estimate.at_worst_ever;
                worstt  = svcpt->scp_at_estimate.at_worst_time;
-               s2dhms(&ts, cfs_time_current_sec() - worstt);
+               s2dhms(&ts, get_seconds() - worstt);
 
                seq_printf(m, "%10s : cur %3u  worst %3u (at %ld, "
                              DHMS_FMT" ago) ", "service",
index cf7758a3aedd922edab24b83d7ed60e8816d9bd3..e890ed91a88633c36fb71f92ef1da792ea6299db 100644 (file)
@@ -252,7 +252,7 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
        /* Let's setup deadline for reply unlink. */
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_BULK_UNLINK) &&
            async && req->rq_bulk_deadline == 0)
-               req->rq_bulk_deadline = cfs_time_current_sec() + LONG_UNLINK;
+               req->rq_bulk_deadline = get_seconds() + LONG_UNLINK;
 
        if (ptlrpc_client_bulk_active(req) == 0)        /* completed or */
                return 1;                               /* never registered */
@@ -303,7 +303,7 @@ static void ptlrpc_at_set_reply(struct ptlrpc_request *req, int flags)
 {
        struct ptlrpc_service_part      *svcpt = req->rq_rqbd->rqbd_svcpt;
        struct ptlrpc_service           *svc = svcpt->scp_service;
-       int service_time = max_t(int, cfs_time_current_sec() -
+       int service_time = max_t(int, get_seconds() -
                                 req->rq_arrival_time.tv_sec, 1);
 
        if (!(flags & PTLRPC_REPLY_EARLY) &&
@@ -422,7 +422,7 @@ int ptlrpc_send_reply(struct ptlrpc_request *req, int flags)
        if (unlikely(rc))
                goto out;
 
-       req->rq_sent = cfs_time_current_sec();
+       req->rq_sent = get_seconds();
 
        rc = ptl_send_buf(&rs->rs_md_h, rs->rs_repbuf, rs->rs_repdata_len,
                          (rs->rs_difficult && !rs->rs_no_ack) ?
@@ -634,7 +634,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
        OBD_FAIL_TIMEOUT(OBD_FAIL_PTLRPC_DELAY_SEND, request->rq_timeout + 5);
 
        do_gettimeofday(&request->rq_arrival_time);
-       request->rq_sent = cfs_time_current_sec();
+       request->rq_sent = get_seconds();
        /* We give the server rq_timeout secs to process the req, and
           add the network latency for our local timeout. */
        request->rq_deadline = request->rq_sent + request->rq_timeout +
index 2ea8c5211f7c69f9eba7dfc175a77583a2c1a036..a13399c75095e77d181d3da2bfa01cf21044e2ca 100644 (file)
@@ -606,7 +606,7 @@ static int ping_evictor_main(void *arg)
                                     obd_evict_list);
                spin_unlock(&pet_lock);
 
-               expire_time = cfs_time_current_sec() - PING_EVICT_TIMEOUT;
+               expire_time = get_seconds() - PING_EVICT_TIMEOUT;
 
                CDEBUG(D_HA, "evicting all exports of obd %s older than %ld\n",
                       obd->obd_name, expire_time);
@@ -631,9 +631,9 @@ static int ping_evictor_main(void *arg)
                                              obd->obd_name,
                                              obd_uuid2str(&exp->exp_client_uuid),
                                              obd_export_nid2str(exp),
-                                             (long)(cfs_time_current_sec() -
+                                             (long)(get_seconds() -
                                                     exp->exp_last_request_time),
-                                             exp, (long)cfs_time_current_sec(),
+                                             exp, (long)get_seconds(),
                                              (long)expire_time,
                                              (long)exp->exp_last_request_time);
                                CDEBUG(D_HA, "Last request was at %ld\n",
index 61b56633d3c66bd45358258754d455a2141bc3c1..ed131b7803c1c123a3d2ce340edd3a30357ef2a1 100644 (file)
@@ -344,7 +344,7 @@ static int import_sec_check_expire(struct obd_import *imp)
 
        spin_lock(&imp->imp_lock);
        if (imp->imp_sec_expire &&
-           imp->imp_sec_expire < cfs_time_current_sec()) {
+           imp->imp_sec_expire < get_seconds()) {
                adapt = 1;
                imp->imp_sec_expire = 0;
        }
@@ -1774,7 +1774,7 @@ int sptlrpc_target_export_check(struct obd_export *exp,
                exp->exp_flvr_old[1] = exp->exp_flvr_old[0];
                exp->exp_flvr_expire[1] = exp->exp_flvr_expire[0];
                exp->exp_flvr_old[0] = exp->exp_flvr;
-               exp->exp_flvr_expire[0] = cfs_time_current_sec() +
+               exp->exp_flvr_expire[0] = get_seconds() +
                                          EXP_FLVR_UPDATE_EXPIRE;
                exp->exp_flvr = flavor;
 
@@ -1848,7 +1848,7 @@ int sptlrpc_target_export_check(struct obd_export *exp,
        }
 
        if (exp->exp_flvr_expire[0]) {
-               if (exp->exp_flvr_expire[0] >= cfs_time_current_sec()) {
+               if (exp->exp_flvr_expire[0] >= get_seconds()) {
                        if (flavor_allowed(&exp->exp_flvr_old[0], req)) {
                                CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the "
                                       "middle one ("CFS_DURATION_T")\n", exp,
@@ -1856,7 +1856,7 @@ int sptlrpc_target_export_check(struct obd_export *exp,
                                       exp->exp_flvr_old[0].sf_rpc,
                                       exp->exp_flvr_old[1].sf_rpc,
                                       exp->exp_flvr_expire[0] -
-                                               cfs_time_current_sec());
+                                               get_seconds());
                                spin_unlock(&exp->exp_lock);
                                return 0;
                        }
@@ -1873,7 +1873,7 @@ int sptlrpc_target_export_check(struct obd_export *exp,
        /* now it doesn't match the current flavor, the only chance we can
         * accept it is match the old flavors which is not expired. */
        if (exp->exp_flvr_changed == 0 && exp->exp_flvr_expire[1]) {
-               if (exp->exp_flvr_expire[1] >= cfs_time_current_sec()) {
+               if (exp->exp_flvr_expire[1] >= get_seconds()) {
                        if (flavor_allowed(&exp->exp_flvr_old[1], req)) {
                                CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the "
                                       "oldest one ("CFS_DURATION_T")\n", exp,
@@ -1881,7 +1881,7 @@ int sptlrpc_target_export_check(struct obd_export *exp,
                                       exp->exp_flvr_old[0].sf_rpc,
                                       exp->exp_flvr_old[1].sf_rpc,
                                       exp->exp_flvr_expire[1] -
-                                               cfs_time_current_sec());
+                                               get_seconds());
                                spin_unlock(&exp->exp_lock);
                                return 0;
                        }
@@ -1911,11 +1911,11 @@ int sptlrpc_target_export_check(struct obd_export *exp,
              exp->exp_flvr_old[0].sf_rpc,
              exp->exp_flvr_expire[0] ?
              (unsigned long) (exp->exp_flvr_expire[0] -
-                              cfs_time_current_sec()) : 0,
+                              get_seconds()) : 0,
              exp->exp_flvr_old[1].sf_rpc,
              exp->exp_flvr_expire[1] ?
              (unsigned long) (exp->exp_flvr_expire[1] -
-                              cfs_time_current_sec()) : 0);
+                              get_seconds()) : 0);
        return -EACCES;
 }
 EXPORT_SYMBOL(sptlrpc_target_export_check);
index 58ba2457fcf694a0bd4181d3da03129338a68bcb..874789b200a3eb612f10bdc9a719848a4c294166 100644 (file)
@@ -156,8 +156,8 @@ int sptlrpc_proc_enc_pool_seq_show(struct seq_file *m, void *v)
                      page_pools.epp_total_pages,
                      page_pools.epp_free_pages,
                      page_pools.epp_idle_idx,
-                     cfs_time_current_sec() - page_pools.epp_last_shrink,
-                     cfs_time_current_sec() - page_pools.epp_last_access,
+                     get_seconds() - page_pools.epp_last_shrink,
+                     get_seconds() - page_pools.epp_last_access,
                      page_pools.epp_st_max_pages,
                      page_pools.epp_st_grows,
                      page_pools.epp_st_grow_fails,
@@ -228,7 +228,7 @@ static unsigned long enc_pools_shrink_count(struct shrinker *s,
         * if no pool access for a long time, we consider it's fully idle.
         * a little race here is fine.
         */
-       if (unlikely(cfs_time_current_sec() - page_pools.epp_last_access >
+       if (unlikely(get_seconds() - page_pools.epp_last_access >
                     CACHE_QUIESCENT_PERIOD)) {
                spin_lock(&page_pools.epp_lock);
                page_pools.epp_idle_idx = IDLE_IDX_MAX;
@@ -255,7 +255,7 @@ static unsigned long enc_pools_shrink_scan(struct shrinker *s,
                       (long)sc->nr_to_scan, page_pools.epp_free_pages);
 
                page_pools.epp_st_shrinks++;
-               page_pools.epp_last_shrink = cfs_time_current_sec();
+               page_pools.epp_last_shrink = get_seconds();
        }
        spin_unlock(&page_pools.epp_lock);
 
@@ -263,7 +263,7 @@ static unsigned long enc_pools_shrink_scan(struct shrinker *s,
         * if no pool access for a long time, we consider it's fully idle.
         * a little race here is fine.
         */
-       if (unlikely(cfs_time_current_sec() - page_pools.epp_last_access >
+       if (unlikely(get_seconds() - page_pools.epp_last_access >
                     CACHE_QUIESCENT_PERIOD)) {
                spin_lock(&page_pools.epp_lock);
                page_pools.epp_idle_idx = IDLE_IDX_MAX;
@@ -523,7 +523,7 @@ again:
                if (tick == 0)
                        tick = cfs_time_current();
 
-               now = cfs_time_current_sec();
+               now = get_seconds();
 
                page_pools.epp_st_missings++;
                page_pools.epp_pages_short += desc->bd_iov_count;
@@ -602,7 +602,7 @@ again:
                                   this_idle) /
                                  (IDLE_IDX_WEIGHT + 1);
 
-       page_pools.epp_last_access = cfs_time_current_sec();
+       page_pools.epp_last_access = get_seconds();
 
        spin_unlock(&page_pools.epp_lock);
        return 0;
@@ -729,8 +729,8 @@ int sptlrpc_enc_pool_init(void)
        page_pools.epp_growing = 0;
 
        page_pools.epp_idle_idx = 0;
-       page_pools.epp_last_shrink = cfs_time_current_sec();
-       page_pools.epp_last_access = cfs_time_current_sec();
+       page_pools.epp_last_shrink = get_seconds();
+       page_pools.epp_last_access = get_seconds();
 
        spin_lock_init(&page_pools.epp_lock);
        page_pools.epp_total_pages = 0;
index 3cda2bba6fdefb07b9e644a16b2ebedc328f5355..01f8b0d6660e1078d319c3b90aaeef376445fc62 100644 (file)
@@ -918,7 +918,7 @@ void sptlrpc_conf_client_adapt(struct obd_device *obd)
        if (imp) {
                spin_lock(&imp->imp_lock);
                if (imp->imp_sec)
-                       imp->imp_sec_expire = cfs_time_current_sec() +
+                       imp->imp_sec_expire = get_seconds() +
                                SEC_ADAPT_DELAY;
                spin_unlock(&imp->imp_lock);
        }
index dab92f14c8b726ee3138bbac45d451a69aa52d3f..c500aff6619374c34ff0d7d49fbfc07e7491a21c 100644 (file)
@@ -67,7 +67,7 @@ void sptlrpc_gc_add_sec(struct ptlrpc_sec *sec)
        LASSERT(sec->ps_gc_interval > 0);
        LASSERT(list_empty(&sec->ps_gc_list));
 
-       sec->ps_gc_next = cfs_time_current_sec() + sec->ps_gc_interval;
+       sec->ps_gc_next = get_seconds() + sec->ps_gc_interval;
 
        spin_lock(&sec_gc_list_lock);
        list_add_tail(&sec_gc_list, &sec->ps_gc_list);
@@ -152,11 +152,11 @@ static void sec_do_gc(struct ptlrpc_sec *sec)
 
        CDEBUG(D_SEC, "check on sec %p(%s)\n", sec, sec->ps_policy->sp_name);
 
-       if (cfs_time_after(sec->ps_gc_next, cfs_time_current_sec()))
+       if (cfs_time_after(sec->ps_gc_next, get_seconds()))
                return;
 
        sec->ps_policy->sp_cops->gc_ctx(sec);
-       sec->ps_gc_next = cfs_time_current_sec() + sec->ps_gc_interval;
+       sec->ps_gc_next = get_seconds() + sec->ps_gc_interval;
 }
 
 static int sec_gc_main(void *arg)
index fa76f4fb2d4436b23b36316564815500e45e6a4e..0d08145a6c7e3ca23abcd4c1b7cac0c2912d95d4 100644 (file)
@@ -104,7 +104,7 @@ static int sptlrpc_info_lprocfs_seq_show(struct seq_file *seq, void *v)
        seq_printf(seq, "gc internal    %ld\n", sec->ps_gc_interval);
        seq_printf(seq, "gc next        %ld\n",
                   sec->ps_gc_interval ?
-                  sec->ps_gc_next - cfs_time_current_sec() : 0);
+                  sec->ps_gc_next - get_seconds() : 0);
 
        sptlrpc_sec_put(sec);
 out:
index 1b90f63abfadc34a705f514d3af8702433a69fbb..143c626942a546b36b3108e9a243dd2af9f8b117 100644 (file)
@@ -1037,7 +1037,7 @@ static void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay)
           will make it to the top of the list. */
 
        /* Do not pay attention on 1sec or smaller renewals. */
-       new_time = cfs_time_current_sec() + extra_delay;
+       new_time = get_seconds() + extra_delay;
        if (exp->exp_last_request_time + 1 /*second */ >= new_time)
                return;
 
@@ -1070,20 +1070,20 @@ static void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay)
        /* Note - racing to start/reset the obd_eviction timer is safe */
        if (exp->exp_obd->obd_eviction_timer == 0) {
                /* Check if the oldest entry is expired. */
-               if (cfs_time_current_sec() > (oldest_time + PING_EVICT_TIMEOUT +
+               if (get_seconds() > (oldest_time + PING_EVICT_TIMEOUT +
                                              extra_delay)) {
                        /* We need a second timer, in case the net was down and
                         * it just came back. Since the pinger may skip every
                         * other PING_INTERVAL (see note in ptlrpc_pinger_main),
                         * we better wait for 3. */
                        exp->exp_obd->obd_eviction_timer =
-                               cfs_time_current_sec() + 3 * PING_INTERVAL;
+                               get_seconds() + 3 * PING_INTERVAL;
                        CDEBUG(D_HA, "%s: Think about evicting %s from "CFS_TIME_T"\n",
                               exp->exp_obd->obd_name,
                               obd_export_nid2str(oldest_exp), oldest_time);
                }
        } else {
-               if (cfs_time_current_sec() >
+               if (get_seconds() >
                    (exp->exp_obd->obd_eviction_timer + extra_delay)) {
                        /* The evictor won't evict anyone who we've heard from
                         * recently, so we don't have to check before we start
@@ -1153,7 +1153,7 @@ static void ptlrpc_at_set_timer(struct ptlrpc_service_part *svcpt)
        }
 
        /* Set timer for closest deadline */
-       next = (__s32)(array->paa_deadline - cfs_time_current_sec() -
+       next = (__s32)(array->paa_deadline - get_seconds() -
                       at_early_margin);
        if (next <= 0) {
                ptlrpc_at_timer((unsigned long)svcpt);
@@ -1243,7 +1243,7 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req)
        struct ptlrpc_service_part *svcpt = req->rq_rqbd->rqbd_svcpt;
        struct ptlrpc_request *reqcopy;
        struct lustre_msg *reqmsg;
-       cfs_duration_t olddl = req->rq_deadline - cfs_time_current_sec();
+       cfs_duration_t olddl = req->rq_deadline - get_seconds();
        time_t newdl;
        int rc;
 
@@ -1288,7 +1288,7 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req)
                /* Fake our processing time into the future to ask the clients
                 * for some extra amount of time */
                at_measured(&svcpt->scp_at_estimate, at_extra +
-                           cfs_time_current_sec() -
+                           get_seconds() -
                            req->rq_arrival_time.tv_sec);
 
                /* Check to see if we've actually increased the deadline -
@@ -1299,11 +1299,11 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req)
                                  "(%ld/%ld), not sending early reply\n",
                                  olddl, req->rq_arrival_time.tv_sec +
                                  at_get(&svcpt->scp_at_estimate) -
-                                 cfs_time_current_sec());
+                                 get_seconds());
                        return -ETIMEDOUT;
                }
        }
-       newdl = cfs_time_current_sec() + at_get(&svcpt->scp_at_estimate);
+       newdl = get_seconds() + at_get(&svcpt->scp_at_estimate);
 
        reqcopy = ptlrpc_request_cache_alloc(GFP_NOFS);
        if (reqcopy == NULL)
@@ -1381,7 +1381,7 @@ static int ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
        struct list_head work_list;
        __u32  index, count;
        time_t deadline;
-       time_t now = cfs_time_current_sec();
+       time_t now = get_seconds();
        cfs_duration_t delay;
        int first, counter = 0;
 
@@ -1827,9 +1827,9 @@ ptlrpc_server_handle_req_in(struct ptlrpc_service_part *svcpt,
        }
 
        /* req_in handling should/must be fast */
-       if (cfs_time_current_sec() - req->rq_arrival_time.tv_sec > 5)
+       if (get_seconds() - req->rq_arrival_time.tv_sec > 5)
                DEBUG_REQ(D_WARNING, req, "Slow req_in handling "CFS_DURATION_T"s",
-                         cfs_time_sub(cfs_time_current_sec(),
+                         cfs_time_sub(get_seconds(),
                                       req->rq_arrival_time.tv_sec));
 
        /* Set rpc server deadline and add it to the timed list */
@@ -1932,13 +1932,13 @@ ptlrpc_server_handle_request(struct ptlrpc_service_part *svcpt,
 
        /* Discard requests queued for longer than the deadline.
           The deadline is increased if we send an early reply. */
-       if (cfs_time_current_sec() > request->rq_deadline) {
+       if (get_seconds() > request->rq_deadline) {
                DEBUG_REQ(D_ERROR, request, "Dropping timed-out request from %s"
                          ": deadline "CFS_DURATION_T":"CFS_DURATION_T"s ago\n",
                          libcfs_id2str(request->rq_peer),
                          cfs_time_sub(request->rq_deadline,
                          request->rq_arrival_time.tv_sec),
-                         cfs_time_sub(cfs_time_current_sec(),
+                         cfs_time_sub(get_seconds(),
                          request->rq_deadline));
                goto put_conn;
        }
@@ -1964,14 +1964,14 @@ put_conn:
        lu_context_exit(&request->rq_session);
        lu_context_fini(&request->rq_session);
 
-       if (unlikely(cfs_time_current_sec() > request->rq_deadline)) {
+       if (unlikely(get_seconds() > request->rq_deadline)) {
                DEBUG_REQ(D_WARNING, request,
                          "Request took longer than estimated ("
                                CFS_DURATION_T":"CFS_DURATION_T
                                "s); client may timeout.",
                          cfs_time_sub(request->rq_deadline,
                                       request->rq_arrival_time.tv_sec),
-                         cfs_time_sub(cfs_time_current_sec(),
+                         cfs_time_sub(get_seconds(),
                                       request->rq_deadline));
        }