Lines Matching defs:node
209 * rcm_register_interest() for each node before we free it, the
258 link_cache_t *node;
264 node = cache_head.vc_next;
265 while (node != &cache_tail) {
266 if (rcm_unregister_interest(hd, node->vc_resource, 0)
270 node->vc_resource);
274 cache_remove(node);
275 node_free(node);
276 node = cache_head.vc_next;
301 * vnic_offline() - Offline VNICs on a specific node.
307 link_cache_t *node;
313 node = cache_lookup(hd, rsrc, CACHE_REFRESH);
314 if (node == NULL) {
325 if (vnic_consumer_offline(hd, node, errorp, flags, info) ==
330 vnic_log_err(node->vc_linkid, errorp,
344 if (vnic_offline_vnic(node, VNIC_OFFLINED, CACHE_NODE_OFFLINED) !=
346 vnic_online_vnic(node);
347 vnic_log_err(node->vc_linkid, errorp, "offline failed");
358 * vnic_undo_offline() - Undo offline of a previously offlined node.
365 link_cache_t *node;
370 node = cache_lookup(hd, rsrc, CACHE_NO_REFRESH);
371 if (node == NULL) {
379 if (!(node->vc_state & CACHE_NODE_OFFLINED)) {
380 vnic_log_err(node->vc_linkid, errorp, "link not offlined");
386 vnic_online_vnic(node);
391 vnic_consumer_online(hd, node, errorp, flags, info);
393 node->vc_state &= ~CACHE_NODE_OFFLINED;
400 vnic_online_vnic(link_cache_t *node)
409 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) {
430 vnic_offline_vnic(link_cache_t *node, uint32_t flags, cache_node_state_t state)
437 node->vc_resource, flags, state);
442 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) {
459 node->vc_state |= state;
471 link_cache_t *node;
476 node = cache_lookup(hd, rsrc, CACHE_REFRESH);
477 if (node == NULL) {
485 *usagep = vnic_usage(node);
534 vnic_consumer_remove(rcm_handle_t *hd, link_cache_t *node, uint_t flags,
542 node->vc_resource);
544 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) {
576 link_cache_t *node;
582 node = cache_lookup(hd, rsrc, CACHE_NO_REFRESH);
583 if (node == NULL) {
592 cache_remove(node);
595 rv = vnic_consumer_remove(hd, node, flags, info);
596 node_free(node);
674 vnic_usage(link_cache_t *node)
686 rcm_log_message(RCM_TRACE2, "VNIC: usage(%s)\n", node->vc_resource);
689 if ((status = dladm_datalink_id2info(dld_handle, node->vc_linkid, NULL,
693 node->vc_resource, dladm_status2str(status, errmsg));
697 if (node->vc_state & CACHE_NODE_OFFLINED)
706 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next)
715 node->vc_resource, strerror(errno));
720 if (node->vc_state & CACHE_NODE_OFFLINED) {
723 node->vc_resource, buf);
727 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) {
735 node->vc_resource, vnic->dlv_vnic_id,
747 node->vc_resource, buf);
758 * cache_lookup() - Get a cache node for a resource.
767 link_cache_t *node;
779 node = cache_head.vc_next;
780 for (; node != &cache_tail; node = node->vc_next) {
781 if (strcmp(rsrc, node->vc_resource) == 0) {
784 return (node);
791 * node_free - Free a node from the cache
794 node_free(link_cache_t *node)
798 if (node != NULL) {
799 free(node->vc_resource);
802 for (vnic = node->vc_vnic; vnic != NULL; vnic = next) {
806 free(node);
811 * cache_insert - Insert a resource node in cache
814 cache_insert(link_cache_t *node)
819 node->vc_next = cache_head.vc_next;
820 node->vc_prev = &cache_head;
822 node->vc_next->vc_prev = node;
823 node->vc_prev->vc_next = node;
827 * cache_remove() - Remove a resource node from cache.
830 cache_remove(link_cache_t *node)
833 node->vc_next->vc_prev = node->vc_prev;
834 node->vc_prev->vc_next = node->vc_next;
835 node->vc_next = NULL;
836 node->vc_prev = NULL;
852 link_cache_t *node;
891 node = cache_lookup(hd, rsrc, CACHE_NO_REFRESH);
892 if (node != NULL) {
901 if ((node = calloc(1, sizeof (link_cache_t))) == NULL) {
908 node->vc_resource = rsrc;
909 node->vc_vnic = NULL;
910 node->vc_linkid = vnic_attr.va_link_id;
911 node->vc_state |= CACHE_NODE_NEW;
915 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) {
928 free(node);
933 vnic->dlv_next = node->vc_vnic;
935 if (node->vc_vnic != NULL)
936 node->vc_vnic->dlv_prev = vnic;
937 node->vc_vnic = vnic;
940 node->vc_state &= ~CACHE_NODE_STALE;
943 cache_insert(node);
976 link_cache_t *node, *nnode;
985 node = cache_head.vc_next;
986 for (; node != &cache_tail; node = node->vc_next) {
987 node->vc_state |= CACHE_NODE_STALE;
988 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next)
999 for (node = cache_head.vc_next; node != &cache_tail; node = nnode) {
1002 for (vnic = node->vc_vnic; vnic != NULL; vnic = next) {
1010 node->vc_vnic = next;
1018 nnode = node->vc_next;
1019 if (node->vc_state & CACHE_NODE_STALE) {
1020 (void) rcm_unregister_interest(hd, node->vc_resource,
1023 node->vc_resource);
1024 assert(node->vc_vnic == NULL);
1025 cache_remove(node);
1026 node_free(node);
1030 if (!(node->vc_state & CACHE_NODE_NEW))
1033 if (rcm_register_interest(hd, node->vc_resource, 0, NULL) !=
1037 node->vc_resource);
1041 node->vc_resource);
1042 node->vc_state &= ~CACHE_NODE_NEW;
1056 link_cache_t *node;
1061 node = cache_head.vc_next;
1062 while (node != &cache_tail) {
1063 cache_remove(node);
1064 node_free(node);
1065 node = cache_head.vc_next;
1121 vnic_consumer_online(rcm_handle_t *hd, link_cache_t *node, char **errorp,
1128 node->vc_resource);
1130 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) {
1150 vnic_consumer_offline(rcm_handle_t *hd, link_cache_t *node, char **errorp,
1158 node->vc_resource);
1160 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) {
1172 vnic_consumer_online(hd, node, errorp, flags, info);
1185 link_cache_t *node;
1194 if ((node = cache_lookup(hd, rsrc, CACHE_REFRESH)) == NULL) {
1206 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) {
1224 RCM_RESOURCE_LINK_NEW, node->vc_resource);
1242 link_cache_t *node;
1255 if ((node = cache_lookup(hd, rsrc, CACHE_NO_REFRESH)) != NULL) {
1256 (void) vnic_offline_vnic(node, VNIC_STALE,
1315 link_cache_t *node;
1325 if (((node = cache_lookup(hd, rsrc, CACHE_REFRESH)) != NULL) &&
1326 (!(node->vc_state & CACHE_NODE_OFFLINED))) {