FreeBSD/sys/dev/cxgb/ulp/tom/cxgb_listen.c
/*
 * Removes the listen_ctx structure for inp from the hash and returns it.
 */
Removes the listen_ctx structure for inp from the hash and returns it.
Removes the listen_ctx structure for inp from the hash and returns it .
static struct listen_ctx *
listen_hash_del(struct tom_data *td, struct inpcb *inp)
{
	int bucket = listen_hashfn(inp, td->listen_mask);
	struct listen_ctx *lctx, *l;
	mtx_lock(&td->lctx_hash_lock);
	LIST_FOREACH_SAFE(lctx, &td->listen_hash[bucket], link, l) {
		if (lctx->inp == inp) {
			LIST_REMOVE(lctx, link);
			td->lctx_count--;
			break;
		}
	}
	mtx_unlock(&td->lctx_hash_lock);
	return (lctx);
}
static struct listen_ctx * listen_hash_del ( struct tom_data * td , struct inpcb * inp ) { int bucket = listen_hashfn ( inp , td -> listen_mask ) ; struct listen_ctx * lctx , * l ; mtx_lock ( & td -> lctx_hash_lock ) ; LIST_FOREACH_SAFE ( lctx , & td -> listen_hash [ bucket ] , link , l ) { if ( lctx -> inp == inp ) { LIST_REMOVE ( lctx , link ) ; td -> lctx_count -- ; break ; } } mtx_unlock ( & td -> lctx_hash_lock ) ; return ( lctx ) ; }
Removes the listen_ctx structure for inp from the hash and returns it.
Removes the listen_ctx structure for inp from the hash and returns it .