include/linux/union_find.h

Source file repositories/reference/linux-study-clean/include/linux/union_find.h

File Facts

System
Linux kernel
Corpus path
include/linux/union_find.h
Extension
.h
Size
1167 bytes
Lines
42
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct uf_node {
	struct uf_node *parent;
	unsigned int rank;
};

/* This macro is used for static initialization of a union-find node. */
#define UF_INIT_NODE(node)	{.parent = &node, .rank = 0}

/**
 * uf_node_init - Initialize a union-find node
 * @node: pointer to the union-find node to be initialized
 *
 * This function sets the parent of the node to itself and
 * initializes its rank to 0.
 */
static inline void uf_node_init(struct uf_node *node)
{
	node->parent = node;
	node->rank = 0;
}

/* find the root of a node */
struct uf_node *uf_find(struct uf_node *node);

/* Merge two intersecting nodes */
void uf_union(struct uf_node *node1, struct uf_node *node2);

#endif /* __LINUX_UNION_FIND_H */

Annotation

Implementation Notes