/* * Write a directory entry after a call to namei, using the parameters * that ulfs_lookup left in nameidata and in the ulfs_lookup_results. * * DVP is the directory to be updated. It must be locked. * ULR is the ulfs_lookup_results structure from the final lookup step. * TVP is not used. (XXX: why is it here? remove it) * CNP is the componentname from the final lookup step. * INUM is the inode number to insert into the new directory entry. * DTYPE is the type code (LFS_DT_*) to insert into the new directory entry. * NEWDIRBP is not used and (XXX) should be removed. The previous * comment here said it was used by the now-removed softupdates code. * * The link count of the target inode is *not* incremented; the * caller does that. * * If ulr->ulr_count is 0, ulfs_lookup did not find space to insert the * directory entry. ulr_offset, which is the place to put the entry, * should be on a block boundary (and should be at the end of the * directory AFAIK) and a fresh block is allocated to put the new * directory entry in. * * If ulr->ulr_count is not zero, ulfs_lookup found a slot to insert * the entry into. This slot ranges from ulr_offset to ulr_offset + * ulr_count. However, this slot may already be partially populated * requiring compaction. See notes below. * * Furthermore, if ulr_count is not zero and ulr_endoff is not the * same as i_size, the directory is truncated to size ulr_endoff. */