xfs
[Top] [All Lists]

Re: XSF on Xscale

To: "Ranslam, Robert E" <robert.e.ranslam@xxxxxxxxx>, Vinesh Christopher <vineshc@xxxxxxx>
Subject: Re: XSF on Xscale
From: Nathan Scott <nathans@xxxxxxx>
Date: Wed, 17 Mar 2004 16:22:35 +1100
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <4050B686.1040908@xxxxxxx>
References: <802FECEADA78854F8DD69950B138D8C9025ABC19@xxxxxxxxxxxxxxxxxxxxxx> <4050B686.1040908@xxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.3i
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 */
        }


<Prev in Thread] Current Thread [Next in Thread>