Lines Matching refs:nsw
305 static int o2net_prep_nsw(struct o2net_node *nn, struct o2net_status_wait *nsw) in o2net_prep_nsw() argument
315 ret = idr_get_new(&nn->nn_status_idr, nsw, &nsw->ns_id); in o2net_prep_nsw()
317 list_add_tail(&nsw->ns_node_item, in o2net_prep_nsw()
323 init_waitqueue_head(&nsw->ns_wq); in o2net_prep_nsw()
324 nsw->ns_sys_status = O2NET_ERR_NONE; in o2net_prep_nsw()
325 nsw->ns_status = 0; in o2net_prep_nsw()
332 struct o2net_status_wait *nsw, in o2net_complete_nsw_locked() argument
338 if (!list_empty(&nsw->ns_node_item)) { in o2net_complete_nsw_locked()
339 list_del_init(&nsw->ns_node_item); in o2net_complete_nsw_locked()
340 nsw->ns_sys_status = sys_status; in o2net_complete_nsw_locked()
341 nsw->ns_status = status; in o2net_complete_nsw_locked()
342 idr_remove(&nn->nn_status_idr, nsw->ns_id); in o2net_complete_nsw_locked()
343 wake_up(&nsw->ns_wq); in o2net_complete_nsw_locked()
348 struct o2net_status_wait *nsw, in o2net_complete_nsw() argument
353 if (nsw == NULL) { in o2net_complete_nsw()
357 nsw = idr_find(&nn->nn_status_idr, id); in o2net_complete_nsw()
358 if (nsw == NULL) in o2net_complete_nsw()
362 o2net_complete_nsw_locked(nn, nsw, sys_status, status); in o2net_complete_nsw()
371 struct o2net_status_wait *nsw, *tmp; in o2net_complete_nodes_nsw() local
376 list_for_each_entry_safe(nsw, tmp, &nn->nn_status_list, ns_node_item) { in o2net_complete_nodes_nsw()
377 o2net_complete_nsw_locked(nn, nsw, O2NET_ERR_DIED, 0); in o2net_complete_nodes_nsw()
386 struct o2net_status_wait *nsw) in o2net_nsw_completed() argument
390 completed = list_empty(&nsw->ns_node_item); in o2net_nsw_completed()
1066 struct o2net_status_wait nsw = { in o2net_send_message_vec() local
1067 .ns_node_item = LIST_HEAD_INIT(nsw.ns_node_item), in o2net_send_message_vec()
1128 ret = o2net_prep_nsw(nn, &nsw); in o2net_send_message_vec()
1132 msg->msg_num = cpu_to_be32(nsw.ns_id); in o2net_send_message_vec()
1133 o2net_set_nst_msg_id(&nst, nsw.ns_id); in o2net_send_message_vec()
1151 wait_event(nsw.ns_wq, o2net_nsw_completed(nn, &nsw)); in o2net_send_message_vec()
1158 ret = o2net_sys_err_to_errno(nsw.ns_sys_status); in o2net_send_message_vec()
1160 *status = nsw.ns_status; in o2net_send_message_vec()
1163 ret, nsw.ns_status); in o2net_send_message_vec()
1172 o2net_complete_nsw(nn, &nsw, 0, 0, 0); in o2net_send_message_vec()