LASSERT (id.nid != LNET_NID_ANY);
- list_for_each_entry(ndl, &console_session.ses_ndl_hash[idx], ndl_hlink) {
+ cfs_list_for_each_entry_typed(ndl, &console_session.ses_ndl_hash[idx],
+ lstcon_ndlink_t, ndl_hlink) {
if (ndl->ndl_node->nd_id.nid != id.nid ||
ndl->ndl_node->nd_id.pid != id.pid)
continue;
return -EINVAL;
/* search in hash */
- list_for_each_entry(ndl, &hash[idx], ndl_hlink) {
+ cfs_list_for_each_entry_typed(ndl, &hash[idx],
+ lstcon_ndlink_t, ndl_hlink) {
if (ndl->ndl_node->nd_id.nid != id.nid ||
ndl->ndl_node->nd_id.pid != id.pid)
continue;
lstcon_ndlink_t *ndl;
lstcon_ndlink_t *tmp;
- list_for_each_entry_safe(ndl, tmp, &grp->grp_ndl_list, ndl_link) {
+ cfs_list_for_each_entry_safe_typed(ndl, tmp, &grp->grp_ndl_list,
+ lstcon_ndlink_t, ndl_link) {
if ((ndl->ndl_node->nd_state & keep) == 0)
lstcon_group_ndlink_release(grp, ndl);
}
{
lstcon_group_t *grp;
- list_for_each_entry(grp, &console_session.ses_grp_list, grp_link) {
+ cfs_list_for_each_entry_typed(grp, &console_session.ses_grp_list,
+ lstcon_group_t, grp_link) {
if (strncmp(grp->grp_name, name, LST_NAME_SIZE) != 0)
continue;
LASSERT (index >= 0);
LASSERT (name_up != NULL);
- list_for_each_entry(grp, &console_session.ses_grp_list, grp_link) {
+ cfs_list_for_each_entry_typed(grp, &console_session.ses_grp_list,
+ lstcon_group_t, grp_link) {
if (index-- == 0) {
return copy_to_user(name_up, grp->grp_name, len) ?
-EFAULT : 0;
LASSERT (*index_p >= 0);
LASSERT (*count_p > 0);
- list_for_each_entry(ndl, head, ndl_link) {
+ cfs_list_for_each_entry_typed(ndl, head, lstcon_ndlink_t, ndl_link) {
if (index++ < *index_p)
continue;
memset(gentp, 0, sizeof(lstcon_ndlist_ent_t));
- 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)
LST_NODE_STATE_COUNTER(ndl->ndl_node, gentp);
rc = copy_to_user(gents_p, gentp,
{
lstcon_batch_t *bat;
- list_for_each_entry(bat, &console_session.ses_bat_list, bat_link) {
+ cfs_list_for_each_entry_typed(bat, &console_session.ses_bat_list,
+ lstcon_batch_t, bat_link) {
if (strncmp(bat->bat_name, name, LST_NAME_SIZE) == 0) {
*batpp = bat;
return 0;
LASSERT (name_up != NULL);
LASSERT (index >= 0);
- list_for_each_entry(bat, &console_session.ses_bat_list, bat_link) {
+ cfs_list_for_each_entry_typed(bat, &console_session.ses_bat_list,
+ lstcon_batch_t, bat_link) {
if (index-- == 0) {
return copy_to_user(name_up,bat->bat_name, len) ?
-EFAULT: 0;
if (testidx > 0) {
/* query test, test index start from 1 */
- list_for_each_entry(test, &bat->bat_test_list, tes_link) {
+ cfs_list_for_each_entry_typed(test, &bat->bat_test_list,
+ lstcon_test_t, tes_link) {
if (testidx-- == 1)
break;
}
entp->u.tbe_test.tse_concur = test->tes_concur;
}
- list_for_each_entry(ndl, clilst, ndl_link)
+ cfs_list_for_each_entry_typed(ndl, clilst, lstcon_ndlink_t, ndl_link)
LST_NODE_STATE_COUNTER(ndl->ndl_node, &entp->tbe_cli_nle);
- list_for_each_entry(ndl, srvlst, ndl_link)
+ cfs_list_for_each_entry_typed(ndl, srvlst, lstcon_ndlink_t, ndl_link)
LST_NODE_STATE_COUNTER(ndl->ndl_node, &entp->tbe_srv_nle);
rc = copy_to_user(ent_up, entp,
{
lstcon_test_t *test;
- list_for_each_entry(test, &batch->bat_test_list, tes_link) {
+ cfs_list_for_each_entry_typed(test, &batch->bat_test_list,
+ lstcon_test_t, tes_link) {
if (idx == test->tes_hdr.tsb_index) {
*testpp = test;
return 0;
memset(entp, 0, sizeof(*entp));
- 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)
LST_NODE_STATE_COUNTER(ndl->ndl_node, entp);
if (copy_to_user(sid_up, &console_session.ses_id, sizeof(lst_sid_t)) ||
return rc;
}
-srpc_service_t lstcon_acceptor_service =
+srpc_service_t lstcon_acceptor_service;
+void lstcon_init_acceptor_service(void)
{
- .sv_name = "join session",
- .sv_handler = lstcon_acceptor_handle,
- .sv_bulk_ready = NULL,
- .sv_id = SRPC_SERVICE_JOIN,
- .sv_concur = SFW_SERVICE_CONCURRENCY,
-};
+ /* initialize selftest console acceptor service table */
+ lstcon_acceptor_service.sv_name = "join session";
+ lstcon_acceptor_service.sv_handler = lstcon_acceptor_handle;
+ lstcon_acceptor_service.sv_id = SRPC_SERVICE_JOIN;
+ lstcon_acceptor_service.sv_concur = SFW_SERVICE_CONCURRENCY;
+}
extern int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data);
for (i = 0; i < LST_GLOBAL_HASHSIZE; i++)
CFS_INIT_LIST_HEAD(&console_session.ses_ndl_hash[i]);
+
+ /* initialize acceptor service table */
+ lstcon_init_acceptor_service();
+
rc = srpc_add_service(&lstcon_acceptor_service);
LASSERT (rc != -EBUSY);
if (rc != 0) {