static void
lstcon_rpc_pinger(void *arg)
{
- stt_timer_t *ptimer = (stt_timer_t *)arg;
+ struct stt_timer *ptimer = (struct stt_timer *)arg;
lstcon_rpc_trans_t *trans;
lstcon_rpc_t *crpc;
srpc_msg_t *rep;
int
lstcon_rpc_pinger_start(void)
{
- stt_timer_t *ptimer;
+ struct stt_timer *ptimer;
int rc;
LASSERT(list_empty(&console_session.ses_rpc_freelist));
__u64 ses_id_cookie; /* batch id cookie */
char ses_name[LST_NAME_SIZE];/* session name */
lstcon_rpc_trans_t *ses_ping; /* session pinger */
- stt_timer_t ses_ping_timer; /* timer for pinger */
+ struct stt_timer ses_ping_timer; /* timer for pinger */
lstcon_trans_stat_t ses_trans_stat; /* transaction stats */
struct list_head ses_trans_list; /* global list of transaction */
sfw_add_session_timer(void)
{
sfw_session_t *sn = sfw_data.fw_session;
- stt_timer_t *timer = &sn->sn_timer;
+ struct stt_timer *timer = &sn->sn_timer;
LASSERT(!sfw_data.fw_shuttingdown);
sfw_init_session(sfw_session_t *sn, lst_sid_t sid,
unsigned features, const char *name)
{
- stt_timer_t *timer = &sn->sn_timer;
+ struct stt_timer *timer = &sn->sn_timer;
memset(sn, 0, sizeof(sfw_session_t));
INIT_LIST_HEAD(&sn->sn_list);
module_param(ping_srv_workitems, int, 0644);
MODULE_PARM_DESC(ping_srv_workitems, "# PING server workitems");
-typedef struct {
+struct lst_ping_data {
spinlock_t pnd_lock; /* serialize */
int pnd_counter; /* sequence counter */
-} lst_ping_data_t;
+};
-static lst_ping_data_t lst_ping_data;
+static struct lst_ping_data lst_ping_data;
static int
ping_client_init(sfw_test_instance_t *tsi)
static void
srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
{
- stt_timer_t *timer = &rpc->crpc_timer;
+ struct stt_timer *timer = &rpc->crpc_timer;
if (!rpc->crpc_timeout)
return;
int crpc_service;
atomic_t crpc_refcount;
int crpc_timeout; /* # seconds to wait for reply */
- stt_timer_t crpc_timer;
+ struct stt_timer crpc_timer;
swi_workitem_t crpc_wi;
lnet_process_id_t crpc_dest;
unsigned int sn_timeout; /* # seconds' inactivity to expire */
int sn_timer_active;
unsigned int sn_features;
- stt_timer_t sn_timer;
+ struct stt_timer sn_timer;
struct list_head sn_batches; /* list of batches */
char sn_name[LST_NAME_SIZE];
atomic_t sn_refcount;
} stt_data;
void
-stt_add_timer(stt_timer_t *timer)
+stt_add_timer(struct stt_timer *timer)
{
struct list_head *pos;
/* a simple insertion sort */
list_for_each_prev(pos, STTIMER_SLOT(timer->stt_expires)) {
- stt_timer_t *old = list_entry(pos, stt_timer_t, stt_list);
+ struct stt_timer *old = list_entry(pos, struct stt_timer,
+ stt_list);
if (timer->stt_expires >= old->stt_expires)
break;
* another CPU.
*/
int
-stt_del_timer(stt_timer_t *timer)
+stt_del_timer(struct stt_timer *timer)
{
int ret = 0;
stt_expire_list(struct list_head *slot, time64_t now)
{
int expired = 0;
- stt_timer_t *timer;
+ struct stt_timer *timer;
while (!list_empty(slot)) {
- timer = list_entry(slot->next, stt_timer_t, stt_list);
+ timer = list_entry(slot->next, struct stt_timer, stt_list);
if (timer->stt_expires > now)
break;
#ifndef __SELFTEST_TIMER_H__
#define __SELFTEST_TIMER_H__
-typedef struct {
+struct stt_timer {
struct list_head stt_list;
time64_t stt_expires;
void (*stt_func) (void *);
void *stt_data;
-} stt_timer_t;
+};
-void stt_add_timer(stt_timer_t *timer);
-int stt_del_timer(stt_timer_t *timer);
+void stt_add_timer(struct stt_timer *timer);
+int stt_del_timer(struct stt_timer *timer);
int stt_startup(void);
void stt_shutdown(void);