54 for (i = 0, hash = 0; i < name->
len; i++)
63 const unsigned char *
name,
73 for (i = 0; i <
len; i++) {
74 if (args->
name[i] == name[i])
93 ASSERT(xfs_sb_version_hasdirv2(&mp->m_sb));
94 ASSERT((1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) <=
96 mp->m_dirblksize = 1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog);
97 mp->m_dirblkfsbs = 1 << mp->m_sb.sb_dirblklog;
101 mp->m_attr_node_ents =
104 mp->m_dir_node_ents =
107 mp->m_dir_magicpct = (mp->m_dirblksize * 37) / 100;
108 if (xfs_sb_version_hasasciici(&mp->m_sb))
109 mp->m_dirnameops = &xfs_ascii_ci_nameops;
124 if (dp->i_d.di_size == 0)
151 agno < mp->m_sb.sb_agcount &&
152 agblkno < mp->m_sb.sb_agblocks &&
154 ioff < (1 << mp->m_sb.sb_inopblog) &&
158 xfs_warn(mp,
"Invalid inode number 0x%Lx",
159 (
unsigned long long) ino);
178 memset((
char *)&args, 0,
sizeof(args));
212 args.
hashval = dp->i_mount->m_dirnameops->hashname(name);
244 const unsigned char *
name,
286 args.
hashval = dp->i_mount->m_dirnameops->hashname(name);
341 args.
hashval = dp->i_mount->m_dirnameops->hashname(name);
379 trace_xfs_readdir(dp);
381 if (XFS_FORCED_SHUTDOWN(dp->i_mount))
424 args.
hashval = dp->i_mount->m_dirnameops->hashname(name);
471 args.
hashval = dp->i_mount->m_dirnameops->hashname(name);
509 struct xfs_inode *
dp = args->
dp;
510 struct xfs_mount *
mp = dp->i_mount;
515 trace_xfs_dir2_grow_inode(args, space);
521 count = mp->m_dirblkfsbs;
536 if (size > dp->i_d.di_size) {
537 dp->i_d.di_size =
size;
561 ASSERT(rval == 0 || dp->i_d.di_size == mp->m_dirblksize);
582 *vp = last == mp->m_dirleafblk + (1 << mp->m_sb.sb_dirblklog);
605 trace_xfs_dir2_shrink_inode(args, db);
610 da = xfs_dir2_db_to_da(mp, db);
614 if ((error =
xfs_bunmapi(tp, dp, da, mp->m_dirblkfsbs,
646 if (dp->i_d.di_size > xfs_dir2_db_off_to_byte(mp, db + 1, 0))
655 if (db == mp->m_dirdatablk)