* Add a node to a directory */
| 423 | * Add a node to a directory |
| 424 | */ |
| 425 | static int |
| 426 | mqfs_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 | |
| 444 | static struct mqfs_node * |
| 445 | mqfs_create_node(const char *name, int namelen, struct ucred *cred, int mode, |
no test coverage detected