FreeBSD/sys/ofed/drivers/infiniband/core/peer_mem.c
/* access to that peer client is under its lock - no extra lock is needed */
access to that peer client is under its lock - no extra lock is needed
access to that peer client is under its lock - no extra lock is needed
unsigned long ib_peer_insert_context(struct ib_peer_memory_client *ib_peer_client,
				void *context)
{
	struct core_ticket *core_ticket = kzalloc(sizeof(*core_ticket), GFP_KERNEL);
	ib_peer_client->last_ticket++;
	core_ticket->context = context;
	core_ticket->key = ib_peer_client->last_ticket;
	list_add_tail(&core_ticket->ticket_list,
			&ib_peer_client->core_ticket_list);
	return core_ticket->key;
}
unsigned long ib_peer_insert_context ( struct ib_peer_memory_client * ib_peer_client , void * context ) { struct core_ticket * core_ticket = kzalloc ( sizeof ( * core_ticket ) , GFP_KERNEL ) ; ib_peer_client -> last_ticket ++ ; core_ticket -> context = context ; core_ticket -> key = ib_peer_client -> last_ticket ; list_add_tail ( & core_ticket -> ticket_list , & ib_peer_client -> core_ticket_list ) ; return core_ticket -> key ; }
access to that peer client is under its lock - no extra lock is needed
access to that peer client is under its lock - no extra lock is needed