lstcon_rpc_trans_t *trans;
if (translist != NULL) {
- list_for_each_entry(trans, translist, tas_link) {
+ cfs_list_for_each_entry_typed(trans, translist,
+ lstcon_rpc_trans_t, tas_link) {
/* Can't enqueue two private transaction on
* the same object */
if ((trans->tas_opc & transop) == LST_TRANS_PRIVATE)
lstcon_rpc_t *crpc;
lstcon_node_t *nd;
- list_for_each_entry (crpc, &trans->tas_rpcs_list, crp_link) {
+ cfs_list_for_each_entry_typed (crpc, &trans->tas_rpcs_list,
+ lstcon_rpc_t, crp_link) {
rpc = crpc->crp_rpc;
spin_lock(&rpc->crpc_lock);
lstcon_rpc_trans_name(trans->tas_opc));
/* post all requests */
- list_for_each_entry (crpc, &trans->tas_rpcs_list, crp_link) {
+ cfs_list_for_each_entry_typed (crpc, &trans->tas_rpcs_list,
+ lstcon_rpc_t, crp_link) {
LASSERT (!crpc->crp_posted);
lstcon_rpc_post(crpc);
mutex_up(&console_session.ses_mutex);
- rc = cfs_waitq_wait_event_interruptible_timeout(trans->tas_waitq,
+ cfs_waitq_wait_event_interruptible_timeout(trans->tas_waitq,
lstcon_rpc_trans_check(trans),
- timeout * HZ);
+ cfs_time_seconds(timeout), rc);
rc = (rc > 0)? 0: ((rc < 0)? -EINTR: -ETIMEDOUT);
memset(stat, 0, sizeof(*stat));
- list_for_each_entry(crpc, &trans->tas_rpcs_list, crp_link) {
+ cfs_list_for_each_entry_typed(crpc, &trans->tas_rpcs_list,
+ lstcon_rpc_t, crp_link) {
lstcon_rpc_stat_total(stat, 1);
rpc = crpc->crp_rpc;
next = head_up;
- list_for_each_entry(crpc, &trans->tas_rpcs_list, crp_link) {
+ cfs_list_for_each_entry_typed(crpc, &trans->tas_rpcs_list,
+ lstcon_rpc_t, crp_link) {
if (copy_from_user(&tmp, next, sizeof(struct list_head)))
return -EFAULT;
nd = crpc->crp_node;
- dur = cfs_time_sub(crpc->crp_stamp,
- console_session.ses_id.ses_stamp);
+ dur = (cfs_duration_t)cfs_time_sub(crpc->crp_stamp,
+ (cfs_time_t)console_session.ses_id.ses_stamp);
cfs_duration_usec(dur, &tv);
if (copy_to_user(&ent->rpe_peer,
lstcon_rpc_t *tmp;
int count = 0;
- list_for_each_entry_safe(crpc, tmp,
- &trans->tas_rpcs_list, crp_link) {
+ cfs_list_for_each_entry_safe_typed(crpc, tmp,
+ &trans->tas_rpcs_list,
+ lstcon_rpc_t, crp_link) {
rpc = crpc->crp_rpc;
spin_lock(&rpc->crpc_lock);
start = ((idx / dist) * span) % grp->grp_nnode;
end = ((idx / dist) * span + span - 1) % grp->grp_nnode;
- list_for_each_entry(ndl, &grp->grp_ndl_list, ndl_link) {
+ cfs_list_for_each_entry_typed(ndl, &grp->grp_ndl_list,
+ lstcon_ndlink_t, ndl_link) {
nd = ndl->ndl_node;
if (i < start) {
i ++;
if (start <= end) /* done */
return 0;
- list_for_each_entry(ndl, &grp->grp_ndl_list, ndl_link) {
+ cfs_list_for_each_entry_typed(ndl, &grp->grp_ndl_list,
+ lstcon_ndlink_t, ndl_link) {
if (i > grp->grp_nnode + end)
break;
trq->tsr_bid = test->tes_hdr.tsb_id;
trq->tsr_concur = test->tes_concur;
trq->tsr_is_client = (transop == LST_TRANS_TSBCLIADD) ? 1 : 0;
- trq->tsr_stop_onerr = test->tes_stop_onerr;
+ trq->tsr_stop_onerr = !!test->tes_stop_onerr;
switch (test->tes_type) {
case LST_TEST_PING:
srpc_batch_reply_t *bat_rep;
srpc_test_reply_t *test_rep;
srpc_stat_reply_t *stat_rep;
- int errno = 0;
+ int rc = 0;
switch (transop) {
case LST_TRANS_SESNEW:
mksn_rep->mksn_status == EINVAL);
lstcon_sesop_stat_failure(stat, 1);
- errno = mksn_rep->mksn_status;
+ rc = mksn_rep->mksn_status;
break;
case LST_TRANS_SESEND:
rmsn_rep->rmsn_status == EINVAL);
lstcon_sesop_stat_failure(stat, 1);
- errno = rmsn_rep->rmsn_status;
+ rc = rmsn_rep->rmsn_status;
break;
case LST_TRANS_SESQRY:
}
lstcon_tsbop_stat_failure(stat, 1);
- errno = bat_rep->bar_status;
+ rc = bat_rep->bar_status;
break;
case LST_TRANS_TSBCLIQRY:
return;
lstcon_tsbqry_stat_failure(stat, 1);
- errno = bat_rep->bar_status;
+ rc = bat_rep->bar_status;
break;
case LST_TRANS_TSBCLIADD:
}
lstcon_tsbop_stat_failure(stat, 1);
- errno = test_rep->tsr_status;
+ rc = test_rep->tsr_status;
break;
case LST_TRANS_STATQRY:
}
lstcon_statqry_stat_failure(stat, 1);
- errno = stat_rep->str_status;
+ rc = stat_rep->str_status;
break;
default:
}
if (stat->trs_fwk_errno == 0)
- stat->trs_fwk_errno = errno;
+ stat->trs_fwk_errno = rc;
return;
}
return rc;
}
- list_for_each_entry(ndl, ndlist, ndl_link) {
+ cfs_list_for_each_entry_typed(ndl, ndlist, lstcon_ndlink_t, ndl_link) {
rc = condition == NULL ? 1 :
condition(transop, ndl->ndl_node, arg);
if (!console_session.ses_expired &&
cfs_time_current_sec() - console_session.ses_laststamp >
- console_session.ses_timeout)
+ (time_t)console_session.ses_timeout)
console_session.ses_expired = 1;
trans = console_session.ses_ping;
LASSERT (trans != NULL);
- list_for_each_entry(ndl, &console_session.ses_ndl_list, ndl_link) {
+ cfs_list_for_each_entry_typed(ndl, &console_session.ses_ndl_list,
+ lstcon_ndlink_t, ndl_link) {
nd = ndl->ndl_node;
if (console_session.ses_expired) {
intv = cfs_duration_sec(cfs_time_sub(cfs_time_current(),
nd->nd_stamp));
- if (intv < nd->nd_timeout / 2)
+ if (intv < (time_t)nd->nd_timeout / 2)
continue;
rc = lstcon_rpc_init(nd, SRPC_SERVICE_DEBUG, 0, 0, crpc);
CDEBUG(D_NET, "Ping %d nodes in session\n", count);
- ptimer->stt_expires = cfs_time_current_sec() + LST_PING_INTERVAL;
+ ptimer->stt_expires = (cfs_time_t)(cfs_time_current_sec() + LST_PING_INTERVAL);
stt_add_timer(ptimer);
mutex_up(&console_session.ses_mutex);
}
ptimer = &console_session.ses_ping_timer;
- ptimer->stt_expires = cfs_time_current_sec() + LST_PING_INTERVAL;
+ ptimer->stt_expires = (cfs_time_t)(cfs_time_current_sec() + LST_PING_INTERVAL);
stt_add_timer(ptimer);