Exemplo n.º 1
0
void
xfs_dir_mount(
	xfs_mount_t	*mp)
{
	int	nodehdr_size;


	ASSERT(xfs_sb_version_hasdirv2(&mp->m_sb));
	ASSERT((1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) <=
	       XFS_MAX_BLOCKSIZE);
	mp->m_dirblksize = 1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog);
	mp->m_dirblkfsbs = 1 << mp->m_sb.sb_dirblklog;
	mp->m_dirdatablk = xfs_dir2_db_to_da(mp, XFS_DIR2_DATA_FIRSTDB(mp));
	mp->m_dirleafblk = xfs_dir2_db_to_da(mp, XFS_DIR2_LEAF_FIRSTDB(mp));
	mp->m_dirfreeblk = xfs_dir2_db_to_da(mp, XFS_DIR2_FREE_FIRSTDB(mp));

	nodehdr_size = __xfs_da3_node_hdr_size(xfs_sb_version_hascrc(&mp->m_sb));
	mp->m_attr_node_ents = (mp->m_sb.sb_blocksize - nodehdr_size) /
				(uint)sizeof(xfs_da_node_entry_t);
	mp->m_dir_node_ents = (mp->m_dirblksize - nodehdr_size) /
				(uint)sizeof(xfs_da_node_entry_t);

	mp->m_dir_magicpct = (mp->m_dirblksize * 37) / 100;
	if (xfs_sb_version_hasasciici(&mp->m_sb))
		mp->m_dirnameops = &xfs_ascii_ci_nameops;
	else
		mp->m_dirnameops = &xfs_default_nameops;
}
Exemplo n.º 2
0
void
xfs_dir_mount(
	xfs_mount_t	*mp)
{
	ASSERT(XFS_SB_VERSION_HASDIRV2(&mp->m_sb));
	ASSERT((1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) <=
	       XFS_MAX_BLOCKSIZE);
	mp->m_dirblksize = 1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog);
	mp->m_dirblkfsbs = 1 << mp->m_sb.sb_dirblklog;
	mp->m_dirdatablk = XFS_DIR2_DB_TO_DA(mp, XFS_DIR2_DATA_FIRSTDB(mp));
	mp->m_dirleafblk = XFS_DIR2_DB_TO_DA(mp, XFS_DIR2_LEAF_FIRSTDB(mp));
	mp->m_dirfreeblk = XFS_DIR2_DB_TO_DA(mp, XFS_DIR2_FREE_FIRSTDB(mp));
	mp->m_attr_node_ents =
		(mp->m_sb.sb_blocksize - (uint)sizeof(xfs_da_node_hdr_t)) /
		(uint)sizeof(xfs_da_node_entry_t);
	mp->m_dir_node_ents =
		(mp->m_dirblksize - (uint)sizeof(xfs_da_node_hdr_t)) /
		(uint)sizeof(xfs_da_node_entry_t);
	mp->m_dir_magicpct = (mp->m_dirblksize * 37) / 100;
}
Exemplo n.º 3
0
void
xfs_dir_mount(
    xfs_mount_t    *mp)
{
    ASSERT(xfs_sb_version_hasdirv2(&mp->m_sb));
    ASSERT((1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) <=
           XFS_MAX_BLOCKSIZE);
    mp->m_dirblksize = 1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog);
    mp->m_dirblkfsbs = 1 << mp->m_sb.sb_dirblklog;
    mp->m_dirdatablk = xfs_dir2_db_to_da(mp, XFS_DIR2_DATA_FIRSTDB(mp));
    mp->m_dirleafblk = xfs_dir2_db_to_da(mp, XFS_DIR2_LEAF_FIRSTDB(mp));
    mp->m_dirfreeblk = xfs_dir2_db_to_da(mp, XFS_DIR2_FREE_FIRSTDB(mp));
    mp->m_attr_node_ents =
        (mp->m_sb.sb_blocksize - (uint)sizeof(xfs_da_node_hdr_t)) /
        (uint)sizeof(xfs_da_node_entry_t);
    mp->m_dir_node_ents =
        (mp->m_dirblksize - (uint)sizeof(xfs_da_node_hdr_t)) /
        (uint)sizeof(xfs_da_node_entry_t);
    mp->m_dir_magicpct = (mp->m_dirblksize * 37) / 100;
}