Lines Matching defs:node
974 /* Allocate node based on a logical or physical name */
978 rsrc_node_t *node;
982 node = s_calloc(1, sizeof (*node));
983 node->name = s_strdup(name);
984 node->type = type;
986 return (node);
990 * Free node along with its siblings and children
993 rn_free(rsrc_node_t *node)
995 if (node == NULL) {
999 if (node->child) {
1000 rn_free(node->child);
1003 if (node->sibling) {
1004 rn_free(node->sibling);
1007 rsrc_clients_free(node->users);
1008 free(node->name);
1009 free(node);
1016 rn_get_sibling(rsrc_node_t *node)
1018 return (node->sibling);
1025 rn_get_child(rsrc_node_t *node)
1027 return (node->child);
1124 * Find a node in tree based on device, which is the physical pathname
1131 rsrc_node_t *node;
1148 node = rn_find_child(rsrc_root, "SYSTEM", RSRC_NODE_CREATE,
1153 node = rn_find_child(rsrc_root, "ABSTRACT", RSRC_NODE_CREATE,
1170 rsrc_node_t *parent = node;
1171 node = rn_find_child(parent, nodename, flag, type);
1172 if (node == NULL) {
1180 *nodep = node;
1185 * add a usage client to a node
1189 rsrc_node_add_user(rsrc_node_t *node, char *alias, char *modname, pid_t pid,
1196 node->name, alias, modname, pid, flag);
1198 user = rsrc_client_find(modname, pid, &node->users);
1233 rsrc_client_add(user, &node->users);
1236 node->type = RSRC_TYPE_FILESYS;
1242 * remove a usage client of a node
1245 rsrc_node_remove_user(rsrc_node_t *node, char *modname, pid_t pid, uint_t flag)
1250 "rsrc_node_remove_user(%s, %s, %ld, 0x%x)\n", node->name, modname,
1253 user = rsrc_client_find(modname, pid, &node->users);
1257 modname, pid, node->name);
1285 #define TOP_NODE(sp) ((sp)->node[(sp)->depth - 1])
1290 (sp)->node[(sp)->depth] = (rn); \
1296 rsrc_node_t *node[MAX_TREE_DEPTH];
1302 /* walking one node and update node stack */
1310 rsrc_node_t *node = TOP_NODE(sp);
1312 rcm_log_message(RCM_TRACE4, "walk_one_node(%s)\n", node->name);
1314 switch (node_callback(node, arg)) {
1318 node = TOP_NODE(sp);
1339 if (!PRUNE_CHILD(sp) && (child = rn_get_child(node)) != NULL) {
1345 * Pop the stack till a node's sibling can be pushed
1350 (prunesib || (sibling = rn_get_sibling(node)) == NULL)) {
1351 node = TOP_NODE(sp);
1390 * Callback for a command action on a node
1393 node_action(rsrc_node_t *node, void *arg)
1398 rcm_log_message(RCM_TRACE4, "node_action(%s)\n", node->name);
1407 assert(node->type == RSRC_TYPE_FILESYS);
1415 (void) rsrc_client_action_list(node->users, targ->cmd, arg);
1422 if (node->type == RSRC_TYPE_FILESYS)
1439 * If RCM_RETIRE_REQUEST is set, just walk one node and preset
1444 "only root node: %s\n", root->name);
1461 rsrc_node_t *node;
1488 rv = rsrc_node_find(rsrcnames[i], 0, &node);
1489 if ((rv != RCM_SUCCESS) || (node == NULL)) {
1497 * or just the node.
1500 (void) rsrc_tree_action(node, CMD_GETINFO, &arg);
1503 (void) node_action(node, (void *)&arg);
1692 clean_node(rsrc_node_t *node, void *arg)
1694 rcm_log_message(RCM_TRACE4, "clean_node(%s)\n", node->name);
1696 clean_client_list(&node->users);
1763 print_node(rsrc_node_t *node, void *arg)
1767 rcm_log_message(RCM_DEBUG, "rscname: %s, state = 0x%x\n", node->name);
1770 if ((user = node->users) == NULL) {