Lines Matching refs:member

200 static void deref_member(struct mcast_member *member)  in deref_member()  argument
202 if (refcount_dec_and_test(&member->refcount)) in deref_member()
203 complete(&member->comp); in deref_member()
206 static void queue_join(struct mcast_member *member) in queue_join() argument
208 struct mcast_group *group = member->group; in queue_join()
212 list_add_tail(&member->list, &group->pending_list); in queue_join()
330 static int send_join(struct mcast_group *group, struct mcast_member *member) in send_join() argument
335 group->last_join = member; in send_join()
338 &member->multicast.rec, in send_join()
339 member->multicast.comp_mask, in send_join()
365 static void join_group(struct mcast_group *group, struct mcast_member *member, in join_group() argument
368 member->state = MCAST_MEMBER; in join_group()
371 member->multicast.rec = group->rec; in join_group()
372 member->multicast.rec.join_state = join_state; in join_group()
373 list_move(&member->list, &group->active_list); in join_group()
376 static int fail_join(struct mcast_group *group, struct mcast_member *member, in fail_join() argument
380 list_del_init(&member->list); in fail_join()
382 return member->multicast.callback(status, &member->multicast); in fail_join()
387 struct mcast_member *member; in process_group_error() local
402 member = list_entry(group->active_list.next, in process_group_error()
404 refcount_inc(&member->refcount); in process_group_error()
405 list_del_init(&member->list); in process_group_error()
406 adjust_membership(group, member->multicast.rec.join_state, -1); in process_group_error()
407 member->state = MCAST_ERROR; in process_group_error()
410 ret = member->multicast.callback(-ENETRESET, in process_group_error()
411 &member->multicast); in process_group_error()
412 deref_member(member); in process_group_error()
414 ib_sa_free_multicast(&member->multicast); in process_group_error()
427 struct mcast_member *member; in mcast_work_handler() local
444 member = list_entry(group->pending_list.next, in mcast_work_handler()
446 multicast = &member->multicast; in mcast_work_handler()
448 refcount_inc(&member->refcount); in mcast_work_handler()
454 join_group(group, member, join_state); in mcast_work_handler()
456 list_del_init(&member->list); in mcast_work_handler()
461 status = send_join(group, member); in mcast_work_handler()
463 deref_member(member); in mcast_work_handler()
466 ret = fail_join(group, member, status); in mcast_work_handler()
469 deref_member(member); in mcast_work_handler()
471 ib_sa_free_multicast(&member->multicast); in mcast_work_handler()
493 struct mcast_member *member; in process_join_error() local
497 member = list_entry(group->pending_list.next, in process_join_error()
499 if (group->last_join == member) { in process_join_error()
500 refcount_inc(&member->refcount); in process_join_error()
501 list_del_init(&member->list); in process_join_error()
503 ret = member->multicast.callback(status, &member->multicast); in process_join_error()
504 deref_member(member); in process_join_error()
506 ib_sa_free_multicast(&member->multicast); in process_join_error()
616 struct mcast_member *member; in ib_sa_join_multicast() local
624 member = kmalloc(sizeof *member, gfp_mask); in ib_sa_join_multicast()
625 if (!member) in ib_sa_join_multicast()
629 member->client = client; in ib_sa_join_multicast()
630 member->multicast.rec = *rec; in ib_sa_join_multicast()
631 member->multicast.comp_mask = comp_mask; in ib_sa_join_multicast()
632 member->multicast.callback = callback; in ib_sa_join_multicast()
633 member->multicast.context = context; in ib_sa_join_multicast()
634 init_completion(&member->comp); in ib_sa_join_multicast()
635 refcount_set(&member->refcount, 1); in ib_sa_join_multicast()
636 member->state = MCAST_JOINING; in ib_sa_join_multicast()
638 member->group = acquire_group(&dev->port[port_num - dev->start_port], in ib_sa_join_multicast()
640 if (!member->group) { in ib_sa_join_multicast()
651 multicast = &member->multicast; in ib_sa_join_multicast()
652 queue_join(member); in ib_sa_join_multicast()
657 kfree(member); in ib_sa_join_multicast()
664 struct mcast_member *member; in ib_sa_free_multicast() local
667 member = container_of(multicast, struct mcast_member, multicast); in ib_sa_free_multicast()
668 group = member->group; in ib_sa_free_multicast()
671 if (member->state == MCAST_MEMBER) in ib_sa_free_multicast()
674 list_del_init(&member->list); in ib_sa_free_multicast()
686 deref_member(member); in ib_sa_free_multicast()
687 wait_for_completion(&member->comp); in ib_sa_free_multicast()
688 ib_sa_client_put(member->client); in ib_sa_free_multicast()
689 kfree(member); in ib_sa_free_multicast()