Lines Matching refs:nport
220 struct fcloop_nport *nport; member
230 struct fcloop_nport *nport; member
992 struct fcloop_nport *nport = in fcloop_nport_free() local
997 list_del(&nport->nport_list); in fcloop_nport_free()
1000 kfree(nport); in fcloop_nport_free()
1004 fcloop_nport_put(struct fcloop_nport *nport) in fcloop_nport_put() argument
1006 kref_put(&nport->ref, fcloop_nport_free); in fcloop_nport_put()
1010 fcloop_nport_get(struct fcloop_nport *nport) in fcloop_nport_get() argument
1012 return kref_get_unless_zero(&nport->ref); in fcloop_nport_get()
1031 fcloop_nport_put(rport->nport); in fcloop_remoteport_delete()
1040 fcloop_nport_put(tport->nport); in fcloop_targetport_delete()
1209 struct fcloop_nport *newnport, *nport = NULL; in fcloop_alloc_nport() local
1261 list_for_each_entry(nport, &fcloop_nports, nport_list) { in fcloop_alloc_nport()
1262 if (nport->node_name == opts->wwnn && in fcloop_alloc_nport()
1263 nport->port_name == opts->wwpn) { in fcloop_alloc_nport()
1264 if ((remoteport && nport->rport) || in fcloop_alloc_nport()
1265 (!remoteport && nport->tport)) { in fcloop_alloc_nport()
1266 nport = NULL; in fcloop_alloc_nport()
1270 fcloop_nport_get(nport); in fcloop_alloc_nport()
1275 nport->lport = lport; in fcloop_alloc_nport()
1277 nport->port_role = opts->roles; in fcloop_alloc_nport()
1279 nport->port_id = opts->fcaddr; in fcloop_alloc_nport()
1297 return nport; in fcloop_alloc_nport()
1305 struct fcloop_nport *nport; in fcloop_create_remote_port() local
1310 nport = fcloop_alloc_nport(buf, count, true); in fcloop_create_remote_port()
1311 if (!nport) in fcloop_create_remote_port()
1315 pinfo.node_name = nport->node_name; in fcloop_create_remote_port()
1316 pinfo.port_name = nport->port_name; in fcloop_create_remote_port()
1317 pinfo.port_role = nport->port_role; in fcloop_create_remote_port()
1318 pinfo.port_id = nport->port_id; in fcloop_create_remote_port()
1320 ret = nvme_fc_register_remoteport(nport->lport->localport, in fcloop_create_remote_port()
1323 fcloop_nport_put(nport); in fcloop_create_remote_port()
1330 rport->targetport = (nport->tport) ? nport->tport->targetport : NULL; in fcloop_create_remote_port()
1331 if (nport->tport) { in fcloop_create_remote_port()
1332 nport->tport->remoteport = remoteport; in fcloop_create_remote_port()
1333 nport->tport->lport = nport->lport; in fcloop_create_remote_port()
1335 rport->nport = nport; in fcloop_create_remote_port()
1336 rport->lport = nport->lport; in fcloop_create_remote_port()
1337 nport->rport = rport; in fcloop_create_remote_port()
1347 __unlink_remote_port(struct fcloop_nport *nport) in __unlink_remote_port() argument
1349 struct fcloop_rport *rport = nport->rport; in __unlink_remote_port()
1351 if (rport && nport->tport) in __unlink_remote_port()
1352 nport->tport->remoteport = NULL; in __unlink_remote_port()
1353 nport->rport = NULL; in __unlink_remote_port()
1359 __remoteport_unreg(struct fcloop_nport *nport, struct fcloop_rport *rport) in __remoteport_unreg() argument
1371 struct fcloop_nport *nport = NULL, *tmpport; in fcloop_delete_remote_port() local
1386 nport = tmpport; in fcloop_delete_remote_port()
1387 rport = __unlink_remote_port(nport); in fcloop_delete_remote_port()
1394 if (!nport) in fcloop_delete_remote_port()
1397 ret = __remoteport_unreg(nport, rport); in fcloop_delete_remote_port()
1407 struct fcloop_nport *nport; in fcloop_create_target_port() local
1412 nport = fcloop_alloc_nport(buf, count, false); in fcloop_create_target_port()
1413 if (!nport) in fcloop_create_target_port()
1416 tinfo.node_name = nport->node_name; in fcloop_create_target_port()
1417 tinfo.port_name = nport->port_name; in fcloop_create_target_port()
1418 tinfo.port_id = nport->port_id; in fcloop_create_target_port()
1423 fcloop_nport_put(nport); in fcloop_create_target_port()
1430 tport->remoteport = (nport->rport) ? nport->rport->remoteport : NULL; in fcloop_create_target_port()
1431 if (nport->rport) in fcloop_create_target_port()
1432 nport->rport->targetport = targetport; in fcloop_create_target_port()
1433 tport->nport = nport; in fcloop_create_target_port()
1434 tport->lport = nport->lport; in fcloop_create_target_port()
1435 nport->tport = tport; in fcloop_create_target_port()
1445 __unlink_target_port(struct fcloop_nport *nport) in __unlink_target_port() argument
1447 struct fcloop_tport *tport = nport->tport; in __unlink_target_port()
1449 if (tport && nport->rport) in __unlink_target_port()
1450 nport->rport->targetport = NULL; in __unlink_target_port()
1451 nport->tport = NULL; in __unlink_target_port()
1457 __targetport_unreg(struct fcloop_nport *nport, struct fcloop_tport *tport) in __targetport_unreg() argument
1469 struct fcloop_nport *nport = NULL, *tmpport; in fcloop_delete_target_port() local
1484 nport = tmpport; in fcloop_delete_target_port()
1485 tport = __unlink_target_port(nport); in fcloop_delete_target_port()
1492 if (!nport) in fcloop_delete_target_port()
1495 ret = __targetport_unreg(nport, tport); in fcloop_delete_target_port()
1593 struct fcloop_nport *nport = NULL; in fcloop_exit() local
1602 nport = list_first_entry_or_null(&fcloop_nports, in fcloop_exit()
1603 typeof(*nport), nport_list); in fcloop_exit()
1604 if (!nport) in fcloop_exit()
1607 tport = __unlink_target_port(nport); in fcloop_exit()
1608 rport = __unlink_remote_port(nport); in fcloop_exit()
1612 ret = __targetport_unreg(nport, tport); in fcloop_exit()
1616 ret = __remoteport_unreg(nport, rport); in fcloop_exit()