MCPcopy Create free account
hub / github.com/apache/nuttx / tmpfs_alloc_directory

Function tmpfs_alloc_directory

fs/tmpfs/fs_tmpfs.c:714–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

712 ****************************************************************************/
713
714static FAR struct tmpfs_directory_s *
715tmpfs_alloc_directory(FAR struct tmpfs_directory_s *parent)
716{
717 FAR struct tmpfs_directory_s *tdo;
718
719 /* Create a new zero length directory object */
720
721 tdo = fs_heap_zalloc(sizeof(*tdo));
722 if (tdo == NULL)
723 {
724 return NULL;
725 }
726
727 /* Initialize the new directory object */
728
729 tdo->tdo_alloc = 0;
730 tdo->tdo_type = TMPFS_DIRECTORY;
731 tdo->tdo_refs = 0;
732 tdo->tdo_parent = parent;
733 tdo->tdo_nentries = 0;
734 tdo->tdo_entry = NULL;
735
736 nxrmutex_init(&tdo->tdo_lock);
737
738 return tdo;
739}
740
741/****************************************************************************
742 * Name: tmpfs_create_directory

Callers 2

tmpfs_create_directoryFunction · 0.85
tmpfs_bindFunction · 0.85

Calls 2

fs_heap_zallocFunction · 0.85
nxrmutex_initFunction · 0.85

Tested by

no test coverage detected