On Thu, Mar 11, 2004 at 12:57:10PM -0600, Steve Lord wrote:
>
> You could probably restructure this into something a little less complex:
>
> XFS_DIR2_SF_HDR_SIZE(i8count) +
> namelen +
> count * (sizeof(xfs_dir2_sf_off_t) + 1 +
> (i8count ? sizeof(xfs_dir2_ino8_t) :
> sizeof(xfs_dir2_ino4_t)))
>
> I would actually break the conditional expression out of there and see if
> that
> makes a difference.
>
> inode_size = i8count ? sizeof(xfs_dir2_ino8_t) :
> sizeof(xfs_dir2_ino4_t);
>
> size = XFS_DIR2_SF_HDR_SIZE(i8count) +
> count * (sizeof(xfs_dir2_sf_off_t) + 1 + inode_size);
>
Based on Steves suggestions, can you guys try this patch
to see if it helps at all? It seems to always be coming
up with the same values as before on i386 anyway.
thanks.
--
Nathan
--- /usr/tmp/TmpDir.1448-0/xfs_dir2_sf.c_1.37 2004-03-17 16:14:30.000000000
+1100
+++ xfs_dir2_sf.c 2004-03-17 16:14:08.000000000 +1100
@@ -107,6 +107,7 @@
int isdotdot; /* entry is ".." */
xfs_mount_t *mp; /* mount structure pointer */
int namelen; /* total name bytes */
+ int inode_size; /* inode number bytes */
xfs_ino_t parent; /* parent inode number */
int size=0; /* total computed size */
@@ -148,13 +149,10 @@
/*
* Calculate the new size, see if we should give up yet.
*/
- size = XFS_DIR2_SF_HDR_SIZE(i8count) + /* header */
- count + /* namelen */
- count * (uint)sizeof(xfs_dir2_sf_off_t) + /* offset */
- namelen + /* name */
- (i8count ? /* inumber */
- (uint)sizeof(xfs_dir2_ino8_t) * count :
- (uint)sizeof(xfs_dir2_ino4_t) * count);
+ inode_size = i8count ? sizeof(xfs_dir2_ino8_t) :
+ sizeof(xfs_dir2_ino4_t);
+ size = XFS_DIR2_SF_HDR_SIZE(i8count) + namelen +
+ count * (sizeof(xfs_dir2_sf_off_t) + 1 + inode_size);
if (size > XFS_IFORK_DSIZE(dp))
return size; /* size value is a failure */
}
|