Received: with ECARTIS (v1.0.0; list linux-xfs); Tue, 16 Mar 2004 21:23:23 -0800 (PST) Received: from zok.sgi.com (mtvcafw.SGI.COM [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i2H5NJKO027951 for ; Tue, 16 Mar 2004 21:23:20 -0800 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by zok.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with SMTP id i2H6NgiQ023951 for ; Tue, 16 Mar 2004 22:23:43 -0800 Received: from wobbly.melbourne.sgi.com (wobbly.melbourne.sgi.com [134.14.55.135]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA02895; Wed, 17 Mar 2004 16:23:11 +1100 Received: from frodo.melbourne.sgi.com (root@frodo.melbourne.sgi.com [134.14.55.153]) by wobbly.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id i2H5N7Fx413119; Wed, 17 Mar 2004 16:23:08 +1100 (EST) Received: from frodo.melbourne.sgi.com (nathans@localhost [127.0.0.1]) by frodo.melbourne.sgi.com (8.12.9/8.12.9/Debian-3) with ESMTP id i2H5MaYk003636; Wed, 17 Mar 2004 16:22:37 +1100 Received: (from nathans@localhost) by frodo.melbourne.sgi.com (8.12.9/8.12.9/Debian-3) id i2H5MZIW003634; Wed, 17 Mar 2004 16:22:35 +1100 Date: Wed, 17 Mar 2004 16:22:35 +1100 From: Nathan Scott To: "Ranslam, Robert E" , Vinesh Christopher Cc: linux-xfs@oss.sgi.com Subject: Re: XSF on Xscale Message-ID: <20040317052235.GA3595@frodo> References: <802FECEADA78854F8DD69950B138D8C9025ABC19@orsmsx405.jf.intel.com> <4050B686.1040908@xfs.org> Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4050B686.1040908@xfs.org> User-Agent: Mutt/1.5.3i Content-Transfer-Encoding: 8bit X-archive-position: 2481 X-ecartis-version: Ecartis v1.0.0 Sender: linux-xfs-bounce@oss.sgi.com Errors-to: linux-xfs-bounce@oss.sgi.com X-original-sender: nathans@sgi.com Precedence: bulk X-list: linux-xfs Content-Length: 1913 Lines: 60 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 */ }