MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mqfs_add_node

Function mqfs_add_node

freebsd/kern/uipc_mqueue.c:425–442  ·  view source on GitHub ↗

* Add a node to a directory */

Source from the content-addressed store, hash-verified

423 * Add a node to a directory
424 */
425static int
426mqfs_add_node(struct mqfs_node *parent, struct mqfs_node *node)
427{
428 KASSERT(parent != NULL, ("%s(): parent is NULL", __func__));
429 KASSERT(parent->mn_info != NULL,
430 ("%s(): parent has no mn_info", __func__));
431 KASSERT(parent->mn_type == mqfstype_dir ||
432 parent->mn_type == mqfstype_root,
433 ("%s(): parent is not a directory", __func__));
434
435 node->mn_info = parent->mn_info;
436 node->mn_parent = parent;
437 LIST_INIT(&node->mn_children);
438 LIST_INIT(&node->mn_vnodes);
439 LIST_INSERT_HEAD(&parent->mn_children, node, mn_sibling);
440 mqnode_addref(parent);
441 return (0);
442}
443
444static struct mqfs_node *
445mqfs_create_node(const char *name, int namelen, struct ucred *cred, int mode,

Callers 4

mqfs_create_fileFunction · 0.85
mqfs_fixup_dirFunction · 0.85
mqfs_create_dirFunction · 0.85
mqfs_create_linkFunction · 0.85

Calls 1

mqnode_addrefFunction · 0.85

Tested by

no test coverage detected