Commit b2d201bd authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: lustre: remove cfs_duration_t typedef

Just use 'long' as that is what it was defined as.

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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7264b8a5
...@@ -43,12 +43,12 @@ ...@@ -43,12 +43,12 @@
* generic time manipulation functions. * generic time manipulation functions.
*/ */
static inline unsigned long cfs_time_add(unsigned long t, cfs_duration_t d) static inline unsigned long cfs_time_add(unsigned long t, long d)
{ {
return (unsigned long)(t + d); return (unsigned long)(t + d);
} }
static inline cfs_duration_t cfs_time_sub(unsigned long t1, unsigned long t2) static inline long cfs_time_sub(unsigned long t1, unsigned long t2)
{ {
return (unsigned long)(t1 - t2); return (unsigned long)(t1 - t2);
} }
...@@ -121,7 +121,7 @@ static inline void cfs_fs_timeval(struct timeval *tv) ...@@ -121,7 +121,7 @@ static inline void cfs_fs_timeval(struct timeval *tv)
* return valid time-out based on user supplied one. Currently we only check * return valid time-out based on user supplied one. Currently we only check
* that time-out is not shorted than allowed. * that time-out is not shorted than allowed.
*/ */
static inline cfs_duration_t cfs_timeout_cap(cfs_duration_t timeout) static inline long cfs_timeout_cap(long timeout)
{ {
if (timeout < CFS_TICK) if (timeout < CFS_TICK)
timeout = CFS_TICK; timeout = CFS_TICK;
......
...@@ -50,26 +50,16 @@ ...@@ -50,26 +50,16 @@
/* /*
* Platform provides three opaque data-types: * Platform provides three opaque data-types:
* *
* unsigned long represents point in time. This is internal kernel
* time rather than "wall clock". This time bears no
* relation to gettimeofday().
*
* cfs_duration_t represents time interval with resolution of internal
* platform clock
*
* struct timespec represents instance in world-visible time. This is
* used in file-system time-stamps
*
* unsigned long cfs_time_current(void); * unsigned long cfs_time_current(void);
* unsigned long cfs_time_add (unsigned long, cfs_duration_t); * unsigned long cfs_time_add (unsigned long, long);
* cfs_duration_t cfs_time_sub (unsigned long, unsigned long); * long cfs_time_sub (unsigned long, unsigned long);
* int cfs_impl_time_before (unsigned long, unsigned long); * int cfs_impl_time_before (unsigned long, unsigned long);
* int cfs_impl_time_before_eq(unsigned long, unsigned long); * int cfs_impl_time_before_eq(unsigned long, unsigned long);
* *
* cfs_duration_t cfs_duration_build(int64_t); * long cfs_duration_build(int64_t);
* *
* time_t cfs_duration_sec (cfs_duration_t); * time_t cfs_duration_sec (long);
* void cfs_duration_usec(cfs_duration_t, struct timeval *); * void cfs_duration_usec(long, struct timeval *);
* *
* void cfs_fs_time_current(struct timespec *); * void cfs_fs_time_current(struct timespec *);
* time_t cfs_fs_time_sec (struct timespec *); * time_t cfs_fs_time_sec (struct timespec *);
...@@ -107,8 +97,6 @@ static inline void cfs_fs_time_usec(struct timespec *t, struct timeval *v) ...@@ -107,8 +97,6 @@ static inline void cfs_fs_time_usec(struct timespec *t, struct timeval *v)
* Generic kernel stuff * Generic kernel stuff
*/ */
typedef long cfs_duration_t;
static inline int cfs_time_before(unsigned long t1, unsigned long t2) static inline int cfs_time_before(unsigned long t1, unsigned long t2)
{ {
return time_before(t1, t2); return time_before(t1, t2);
...@@ -129,28 +117,28 @@ static inline time_t cfs_fs_time_sec(struct timespec *t) ...@@ -129,28 +117,28 @@ static inline time_t cfs_fs_time_sec(struct timespec *t)
return t->tv_sec; return t->tv_sec;
} }
static inline cfs_duration_t cfs_time_seconds(int seconds) static inline long cfs_time_seconds(int seconds)
{ {
return ((cfs_duration_t)seconds) * HZ; return ((long)seconds) * HZ;
} }
static inline time_t cfs_duration_sec(cfs_duration_t d) static inline time_t cfs_duration_sec(long d)
{ {
return d / HZ; return d / HZ;
} }
static inline void cfs_duration_usec(cfs_duration_t d, struct timeval *s) static inline void cfs_duration_usec(long d, struct timeval *s)
{ {
#if (BITS_PER_LONG == 32) && (HZ > 4096) #if (BITS_PER_LONG == 32) && (HZ > 4096)
__u64 t; __u64 t;
s->tv_sec = d / HZ; s->tv_sec = d / HZ;
t = (d - (cfs_duration_t)s->tv_sec * HZ) * ONE_MILLION; t = (d - (long)s->tv_sec * HZ) * ONE_MILLION;
do_div(t, HZ); do_div(t, HZ);
s->tv_usec = t; s->tv_usec = t;
#else #else
s->tv_sec = d / HZ; s->tv_sec = d / HZ;
s->tv_usec = ((d - (cfs_duration_t)s->tv_sec * HZ) * \ s->tv_usec = ((d - (long)s->tv_sec * HZ) * \
ONE_MILLION) / HZ; ONE_MILLION) / HZ;
#endif #endif
} }
......
...@@ -320,7 +320,7 @@ typedef struct ksock_route ...@@ -320,7 +320,7 @@ typedef struct ksock_route
struct ksock_peer *ksnr_peer; /* owning peer */ struct ksock_peer *ksnr_peer; /* owning peer */
atomic_t ksnr_refcount; /* # users */ atomic_t ksnr_refcount; /* # users */
unsigned long ksnr_timeout; /* when (in jiffies) reconnection can happen next */ unsigned long ksnr_timeout; /* when (in jiffies) reconnection can happen next */
cfs_duration_t ksnr_retry_interval; /* how long between retries */ long ksnr_retry_interval; /* how long between retries */
__u32 ksnr_myipaddr; /* my IP */ __u32 ksnr_myipaddr; /* my IP */
__u32 ksnr_ipaddr; /* IP address to connect to */ __u32 ksnr_ipaddr; /* IP address to connect to */
int ksnr_port; /* port to connect to */ int ksnr_port; /* port to connect to */
......
...@@ -2526,7 +2526,7 @@ ksocknal_reaper (void *arg) ...@@ -2526,7 +2526,7 @@ ksocknal_reaper (void *arg)
ksock_sched_t *sched; ksock_sched_t *sched;
struct list_head enomem_conns; struct list_head enomem_conns;
int nenomem_conns; int nenomem_conns;
cfs_duration_t timeout; long timeout;
int i; int i;
int peer_index = 0; int peer_index = 0;
unsigned long deadline = cfs_time_current(); unsigned long deadline = cfs_time_current();
......
...@@ -512,7 +512,7 @@ int LL_PROC_PROTO(proc_lnet_peers) ...@@ -512,7 +512,7 @@ int LL_PROC_PROTO(proc_lnet_peers)
if (lnet_peer_aliveness_enabled(peer)) { if (lnet_peer_aliveness_enabled(peer)) {
unsigned long now = cfs_time_current(); unsigned long now = cfs_time_current();
cfs_duration_t delta; long delta;
delta = cfs_time_sub(now, peer->lp_last_alive); delta = cfs_time_sub(now, peer->lp_last_alive);
lastalive = cfs_duration_sec(delta); lastalive = cfs_duration_sec(delta);
......
...@@ -477,7 +477,7 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans, ...@@ -477,7 +477,7 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans,
lstcon_rpc_t *crpc; lstcon_rpc_t *crpc;
srpc_msg_t *msg; srpc_msg_t *msg;
lstcon_node_t *nd; lstcon_node_t *nd;
cfs_duration_t dur; long dur;
struct timeval tv; struct timeval tv;
int error; int error;
...@@ -503,7 +503,7 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans, ...@@ -503,7 +503,7 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans,
nd = crpc->crp_node; nd = crpc->crp_node;
dur = (cfs_duration_t)cfs_time_sub(crpc->crp_stamp, dur = (long)cfs_time_sub(crpc->crp_stamp,
(unsigned long)console_session.ses_id.ses_stamp); (unsigned long)console_session.ses_id.ses_stamp);
cfs_duration_usec(dur, &tv); cfs_duration_usec(dur, &tv);
......
...@@ -294,7 +294,7 @@ static inline int exp_connect_multibulk(struct obd_export *exp) ...@@ -294,7 +294,7 @@ static inline int exp_connect_multibulk(struct obd_export *exp)
return exp_max_brw_size(exp) > ONE_MB_BRW_SIZE; return exp_max_brw_size(exp) > ONE_MB_BRW_SIZE;
} }
static inline int exp_expired(struct obd_export *exp, cfs_duration_t age) static inline int exp_expired(struct obd_export *exp, long age)
{ {
LASSERT(exp->exp_delayed); LASSERT(exp->exp_delayed);
return cfs_time_before(cfs_time_add(exp->exp_last_request_time, age), return cfs_time_before(cfs_time_add(exp->exp_last_request_time, age),
......
...@@ -459,8 +459,8 @@ static inline int back_to_sleep(void *arg) ...@@ -459,8 +459,8 @@ static inline int back_to_sleep(void *arg)
#define LWI_ON_SIGNAL_NOOP ((void (*)(void *))(-1)) #define LWI_ON_SIGNAL_NOOP ((void (*)(void *))(-1))
struct l_wait_info { struct l_wait_info {
cfs_duration_t lwi_timeout; long lwi_timeout;
cfs_duration_t lwi_interval; long lwi_interval;
int lwi_allow_intr; int lwi_allow_intr;
int (*lwi_on_timeout)(void *); int (*lwi_on_timeout)(void *);
void (*lwi_on_signal)(void *); void (*lwi_on_signal)(void *);
...@@ -516,7 +516,7 @@ struct l_wait_info { ...@@ -516,7 +516,7 @@ struct l_wait_info {
#define __l_wait_event(wq, condition, info, ret, l_add_wait) \ #define __l_wait_event(wq, condition, info, ret, l_add_wait) \
do { \ do { \
wait_queue_t __wait; \ wait_queue_t __wait; \
cfs_duration_t __timeout = info->lwi_timeout; \ long __timeout = info->lwi_timeout; \
sigset_t __blocked; \ sigset_t __blocked; \
int __allow_intr = info->lwi_allow_intr; \ int __allow_intr = info->lwi_allow_intr; \
\ \
...@@ -548,11 +548,11 @@ do { \ ...@@ -548,11 +548,11 @@ do { \
if (__timeout == 0) { \ if (__timeout == 0) { \
schedule(); \ schedule(); \
} else { \ } else { \
cfs_duration_t interval = info->lwi_interval? \ long interval = info->lwi_interval? \
min_t(cfs_duration_t, \ min_t(long, \
info->lwi_interval,__timeout):\ info->lwi_interval,__timeout):\
__timeout; \ __timeout; \
cfs_duration_t remaining = schedule_timeout(interval);\ long remaining = schedule_timeout(interval);\
__timeout = cfs_time_sub(__timeout, \ __timeout = cfs_time_sub(__timeout, \
cfs_time_sub(interval, remaining));\ cfs_time_sub(interval, remaining));\
if (__timeout == 0) { \ if (__timeout == 0) { \
......
...@@ -1713,7 +1713,7 @@ struct ptlrpc_request { ...@@ -1713,7 +1713,7 @@ struct ptlrpc_request {
lnet_handle_md_t rq_req_md_h; lnet_handle_md_t rq_req_md_h;
struct ptlrpc_cb_id rq_req_cbid; struct ptlrpc_cb_id rq_req_cbid;
/** optional time limit for send attempts */ /** optional time limit for send attempts */
cfs_duration_t rq_delay_limit; long rq_delay_limit;
/** time request was first queued */ /** time request was first queued */
unsigned long rq_queued_time; unsigned long rq_queued_time;
...@@ -2356,7 +2356,7 @@ struct ptlrpc_service_part { ...@@ -2356,7 +2356,7 @@ struct ptlrpc_service_part {
/** incoming reqs */ /** incoming reqs */
struct list_head scp_req_incoming; struct list_head scp_req_incoming;
/** timeout before re-posting reqs, in tick */ /** timeout before re-posting reqs, in tick */
cfs_duration_t scp_rqbd_timeout; long scp_rqbd_timeout;
/** /**
* all threads sleep on this. This wait-queue is signalled when new * all threads sleep on this. This wait-queue is signalled when new
* incoming request arrives and when difficult reply has to be handled. * incoming request arrives and when difficult reply has to be handled.
......
...@@ -218,7 +218,7 @@ int LL_PROC_PROTO(proc_console_max_delay_cs) ...@@ -218,7 +218,7 @@ int LL_PROC_PROTO(proc_console_max_delay_cs)
{ {
int rc, max_delay_cs; int rc, max_delay_cs;
struct ctl_table dummy = *table; struct ctl_table dummy = *table;
cfs_duration_t d; long d;
dummy.data = &max_delay_cs; dummy.data = &max_delay_cs;
dummy.proc_handler = &proc_dointvec; dummy.proc_handler = &proc_dointvec;
...@@ -249,7 +249,7 @@ int LL_PROC_PROTO(proc_console_min_delay_cs) ...@@ -249,7 +249,7 @@ int LL_PROC_PROTO(proc_console_min_delay_cs)
{ {
int rc, min_delay_cs; int rc, min_delay_cs;
struct ctl_table dummy = *table; struct ctl_table dummy = *table;
cfs_duration_t d; long d;
dummy.data = &min_delay_cs; dummy.data = &min_delay_cs;
dummy.proc_handler = &proc_dointvec; dummy.proc_handler = &proc_dointvec;
......
...@@ -1454,7 +1454,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose) ...@@ -1454,7 +1454,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose)
if (ptlrpc_import_in_recovery(imp)) { if (ptlrpc_import_in_recovery(imp)) {
struct l_wait_info lwi; struct l_wait_info lwi;
cfs_duration_t timeout; long timeout;
if (AT_OFF) { if (AT_OFF) {
if (imp->imp_server_timeout) if (imp->imp_server_timeout)
......
...@@ -141,7 +141,7 @@ static inline int ptlrpc_next_reconnect(struct obd_import *imp) ...@@ -141,7 +141,7 @@ static inline int ptlrpc_next_reconnect(struct obd_import *imp)
return cfs_time_shift(obd_timeout); return cfs_time_shift(obd_timeout);
} }
cfs_duration_t pinger_check_timeout(unsigned long time) long pinger_check_timeout(unsigned long time)
{ {
struct timeout_item *item; struct timeout_item *item;
unsigned long timeout = PING_INTERVAL; unsigned long timeout = PING_INTERVAL;
...@@ -246,7 +246,7 @@ static int ptlrpc_pinger_main(void *arg) ...@@ -246,7 +246,7 @@ static int ptlrpc_pinger_main(void *arg)
while (1) { while (1) {
unsigned long this_ping = cfs_time_current(); unsigned long this_ping = cfs_time_current();
struct l_wait_info lwi; struct l_wait_info lwi;
cfs_duration_t time_to_next_wake; long time_to_next_wake;
struct timeout_item *item; struct timeout_item *item;
struct list_head *iter; struct list_head *iter;
...@@ -283,8 +283,7 @@ static int ptlrpc_pinger_main(void *arg) ...@@ -283,8 +283,7 @@ static int ptlrpc_pinger_main(void *arg)
CFS_TIME_T")\n", time_to_next_wake, CFS_TIME_T")\n", time_to_next_wake,
cfs_time_add(this_ping,cfs_time_seconds(PING_INTERVAL))); cfs_time_add(this_ping,cfs_time_seconds(PING_INTERVAL)));
if (time_to_next_wake > 0) { if (time_to_next_wake > 0) {
lwi = LWI_TIMEOUT(max_t(cfs_duration_t, lwi = LWI_TIMEOUT(max_t(long, time_to_next_wake,
time_to_next_wake,
cfs_time_seconds(1)), cfs_time_seconds(1)),
NULL, NULL); NULL, NULL);
l_wait_event(thread->t_ctl_waitq, l_wait_event(thread->t_ctl_waitq,
......
...@@ -1243,7 +1243,7 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req) ...@@ -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_service_part *svcpt = req->rq_rqbd->rqbd_svcpt;
struct ptlrpc_request *reqcopy; struct ptlrpc_request *reqcopy;
struct lustre_msg *reqmsg; struct lustre_msg *reqmsg;
cfs_duration_t olddl = req->rq_deadline - get_seconds(); long olddl = req->rq_deadline - get_seconds();
time_t newdl; time_t newdl;
int rc; int rc;
...@@ -1382,7 +1382,7 @@ static int ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt) ...@@ -1382,7 +1382,7 @@ static int ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
__u32 index, count; __u32 index, count;
time_t deadline; time_t deadline;
time_t now = get_seconds(); time_t now = get_seconds();
cfs_duration_t delay; long delay;
int first, counter = 0; int first, counter = 0;
spin_lock(&svcpt->scp_at_lock); spin_lock(&svcpt->scp_at_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment