linux/net/smc/smc_pnet.c
/* Remove a pnet entry mentioning a given ib device from the pnet table.
 */
Remove a pnet entry mentioning a given ib device from the pnet table.
Remove a pnet entry mentioning a given ib device from the pnet table .
int smc_pnet_remove_by_ibdev(struct smc_ib_device *ibdev)
{
	struct smc_pnetentry *pnetelem, *tmp_pe;
	int rc = -ENOENT;
	write_lock(&smc_pnettable.lock);
	list_for_each_entry_safe(pnetelem, tmp_pe, &smc_pnettable.pnetlist,
				 list) {
		if (pnetelem->smcibdev == ibdev) {
			list_del(&pnetelem->list);
			dev_put(pnetelem->ndev);
			kfree(pnetelem);
			rc = 0;
			break;
		}
	}
	write_unlock(&smc_pnettable.lock);
	return rc;
}
int smc_pnet_remove_by_ibdev ( struct smc_ib_device * ibdev ) { struct smc_pnetentry * pnetelem , * tmp_pe ; int rc = - ENOENT ; write_lock ( & smc_pnettable . lock ) ; list_for_each_entry_safe ( pnetelem , tmp_pe , & smc_pnettable . pnetlist , list ) { if ( pnetelem -> smcibdev == ibdev ) { list_del ( & pnetelem -> list ) ; dev_put ( pnetelem -> ndev ) ; kfree ( pnetelem ) ; rc = 0 ; break ; } } write_unlock ( & smc_pnettable . lock ) ; return rc ; }
Remove a pnet entry mentioning a given ib device from the pnet table.
Remove a pnet entry mentioning a given ib device from the pnet table .