dirtemplate
struct dirtemplate emptydir = {
struct dirtemplate dirhead = {
struct dirtemplate *dirp;
dirp = (struct dirtemplate *)&odirhead;
memmove(bp->b_un.b_buf, dirp, sizeof(struct dirtemplate));
#define MINDIRSIZE (sizeof (struct dirtemplate))
struct ext2fs_dirtemplate dirtemplate;
memset(&dirtemplate, 0, sizeof(dirtemplate));
dirtemplate.dot_ino = h2fs32(ip->i_number);
dirtemplate.dot_reclen = h2fs16(12);
dirtemplate.dot_namlen = 1;
dirtemplate.dot_type = EXT2_FT_DIR;
dirtemplate.dot_name[0] = '.';
dirtemplate.dotdot_ino = h2fs32(dp->i_number);
dirtemplate.dotdot_reclen = h2fs16(VTOI(dvp)->i_e2fs->e2fs_bsize - 12);
dirtemplate.dotdot_namlen = 2;
dirtemplate.dotdot_type = EXT2_FT_DIR;
dirtemplate.dotdot_name[0] = dirtemplate.dotdot_name[1] = '.';
error = ufs_bufio(UIO_WRITE, tvp, (void *)&dirtemplate,
sizeof (dirtemplate), (off_t)0, IO_NODELOCKED|IO_SYNC,
#define MINDIRSIZ (sizeof (struct dirtemplate) / 2)
static const struct dirtemplate mastertemplate = {
static int ufs_dirbuf_dotdot_namlen(const struct dirtemplate *,
struct dirtemplate dirbuf;
ufs_dirbuf_dotdot_namlen(const struct dirtemplate *dirbuf,
struct dirtemplate dirtemplate;
dirtemplate = mastertemplate;
dirtemplate.dotdot_reclen = dirblksiz - dirtemplate.dot_reclen;
dirtemplate.dot_ino = ufs_rw32(ip->i_number, UFS_MPNEEDSWAP(ump));
dirtemplate.dotdot_ino = ufs_rw32(dp->i_number, UFS_MPNEEDSWAP(ump));
dirtemplate.dot_reclen = ufs_rw16(dirtemplate.dot_reclen,
dirtemplate.dotdot_reclen = ufs_rw16(dirtemplate.dotdot_reclen,
dirtemplate.dot_type = dirtemplate.dot_namlen;
dirtemplate.dotdot_type = dirtemplate.dotdot_namlen;
dirtemplate.dot_namlen = dirtemplate.dotdot_namlen = 0;
dirtemplate.dot_type = dirtemplate.dotdot_type = 0;
memcpy((void *)bp->b_data, (void *)&dirtemplate, sizeof dirtemplate);
static const struct dirtemplate mastertemplate = {