Lines Matching refs:nsw

304 static int o2net_prep_nsw(struct o2net_node *nn, struct o2net_status_wait *nsw)  in o2net_prep_nsw()  argument
314 ret = idr_get_new(&nn->nn_status_idr, nsw, &nsw->ns_id); in o2net_prep_nsw()
316 list_add_tail(&nsw->ns_node_item, in o2net_prep_nsw()
322 init_waitqueue_head(&nsw->ns_wq); in o2net_prep_nsw()
323 nsw->ns_sys_status = O2NET_ERR_NONE; in o2net_prep_nsw()
324 nsw->ns_status = 0; in o2net_prep_nsw()
331 struct o2net_status_wait *nsw, in o2net_complete_nsw_locked() argument
337 if (!list_empty(&nsw->ns_node_item)) { in o2net_complete_nsw_locked()
338 list_del_init(&nsw->ns_node_item); in o2net_complete_nsw_locked()
339 nsw->ns_sys_status = sys_status; in o2net_complete_nsw_locked()
340 nsw->ns_status = status; in o2net_complete_nsw_locked()
341 idr_remove(&nn->nn_status_idr, nsw->ns_id); in o2net_complete_nsw_locked()
342 wake_up(&nsw->ns_wq); in o2net_complete_nsw_locked()
347 struct o2net_status_wait *nsw, in o2net_complete_nsw() argument
352 if (nsw == NULL) { in o2net_complete_nsw()
356 nsw = idr_find(&nn->nn_status_idr, id); in o2net_complete_nsw()
357 if (nsw == NULL) in o2net_complete_nsw()
361 o2net_complete_nsw_locked(nn, nsw, sys_status, status); in o2net_complete_nsw()
370 struct o2net_status_wait *nsw, *tmp; in o2net_complete_nodes_nsw() local
375 list_for_each_entry_safe(nsw, tmp, &nn->nn_status_list, ns_node_item) { in o2net_complete_nodes_nsw()
376 o2net_complete_nsw_locked(nn, nsw, O2NET_ERR_DIED, 0); in o2net_complete_nodes_nsw()
385 struct o2net_status_wait *nsw) in o2net_nsw_completed() argument
389 completed = list_empty(&nsw->ns_node_item); in o2net_nsw_completed()
1046 struct o2net_status_wait nsw = { in o2net_send_message_vec() local
1047 .ns_node_item = LIST_HEAD_INIT(nsw.ns_node_item), in o2net_send_message_vec()
1108 ret = o2net_prep_nsw(nn, &nsw); in o2net_send_message_vec()
1112 msg->msg_num = cpu_to_be32(nsw.ns_id); in o2net_send_message_vec()
1113 o2net_set_nst_msg_id(&nst, nsw.ns_id); in o2net_send_message_vec()
1131 wait_event(nsw.ns_wq, o2net_nsw_completed(nn, &nsw)); in o2net_send_message_vec()
1138 ret = o2net_sys_err_to_errno(nsw.ns_sys_status); in o2net_send_message_vec()
1140 *status = nsw.ns_status; in o2net_send_message_vec()
1143 ret, nsw.ns_status); in o2net_send_message_vec()
1152 o2net_complete_nsw(nn, &nsw, 0, 0, 0); in o2net_send_message_vec()