FreeBSD/sys/fs/tmpfs/tmpfs_subr.c
/*
 * Allocates a new directory entry for the node node with a name of name.
 * The new directory entry is returned in *de.
 *
 * The link count of node is increased by one to reflect the new object
 * referencing it.
 *
 * Returns zero on success or an appropriate error code on failure.
 */
Allocates a new directory entry for the node node with a name of name.
The new directory entry is returned in *de.

The link count of node is increased by one to reflect the new object
referencing it.

Returns zero on success or an appropriate error code on failure.
Allocates a new directory entry for the node node with a name of name . The new directory entry is returned in * de . The link count of node is increased by one to reflect the new object referencing it . Returns zero on success or an appropriate error code on failure .
int
tmpfs_alloc_dirent(struct tmpfs_mount *tmp, struct tmpfs_node *node,
    const char *name, u_int len, struct tmpfs_dirent **de)
{
	struct tmpfs_dirent *nde;
	nde = uma_zalloc(tmp->tm_dirent_pool, M_WAITOK);
	nde->td_node = node;
	if (name != NULL) {
		nde->ud.td_name = malloc(len, M_TMPFSNAME, M_WAITOK);
		tmpfs_dirent_init(nde, name, len);
	} else
		nde->td_namelen = 0;
	if (node != NULL)
		node->tn_links++;
	*de = nde;
	return 0;
}
int tmpfs_alloc_dirent ( struct tmpfs_mount * tmp , struct tmpfs_node * node , const char * name , u_int len , struct tmpfs_dirent * * de ) { struct tmpfs_dirent * nde ; nde = uma_zalloc ( tmp -> tm_dirent_pool , M_WAITOK ) ; nde -> td_node = node ; if ( name != NULL ) { nde -> ud . td_name = malloc ( len , M_TMPFSNAME , M_WAITOK ) ; tmpfs_dirent_init ( nde , name , len ) ; } else nde -> td_namelen = 0 ; if ( node != NULL ) node -> tn_links ++ ; * de = nde ; return 0 ; }
Allocates a new directory entry for the node node with a name of name.
Allocates a new directory entry for the node node with a name of name .