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

Function mqfs_fixup_dir

freebsd/kern/uipc_mqueue.c:484–509  ·  view source on GitHub ↗

* Add . and .. to a directory */

Source from the content-addressed store, hash-verified

482 * Add . and .. to a directory
483 */
484static int
485mqfs_fixup_dir(struct mqfs_node *parent)
486{
487 struct mqfs_node *dir;
488
489 dir = mqnode_alloc();
490 dir->mn_name[0] = '.';
491 dir->mn_type = mqfstype_this;
492 dir->mn_refcount = 1;
493 if (mqfs_add_node(parent, dir) != 0) {
494 mqnode_free(dir);
495 return (-1);
496 }
497
498 dir = mqnode_alloc();
499 dir->mn_name[0] = dir->mn_name[1] = '.';
500 dir->mn_type = mqfstype_parent;
501 dir->mn_refcount = 1;
502
503 if (mqfs_add_node(parent, dir) != 0) {
504 mqnode_free(dir);
505 return (-1);
506 }
507
508 return (0);
509}
510
511#ifdef notyet
512

Callers 2

mqfs_create_dirFunction · 0.85
mqfs_initFunction · 0.85

Calls 3

mqnode_allocFunction · 0.85
mqfs_add_nodeFunction · 0.85
mqnode_freeFunction · 0.85

Tested by

no test coverage detected