Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id g0U19Q804707 for linux-xfs-outgoing; Tue, 29 Jan 2002 17:09:26 -0800 Received: from Cantor.suse.de (ns.suse.de [213.95.15.193]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id g0U196d04685 for ; Tue, 29 Jan 2002 17:09:06 -0800 Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id 4E1AB1EABF; Wed, 30 Jan 2002 01:08:58 +0100 (MET) Date: Wed, 30 Jan 2002 01:08:58 +0100 From: Andi Kleen To: Eric Sandeen Cc: "Ralf G. R. Bergs" , "linux-xfs@oss.sgi.com" , Steve Lord Subject: Re: [PATCH] Re: Reduce XFS footprint (was Re: TAKE - remove a function xfs added to filemap.c Message-ID: <20020130010858.A9046@wotan.suse.de> References: <1012337171.30169.38.camel@stout.americas.sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1012337171.30169.38.camel@stout.americas.sgi.com> User-Agent: Mutt/1.3.22.1i Sender: owner-linux-xfs@oss.sgi.com Precedence: bulk Status: O Content-Length: 5341 Lines: 184 On Tue, Jan 29, 2002 at 02:46:11PM -0600, Eric Sandeen wrote: > On Tue, 2002-01-29 at 14:28, Ralf G. R. Bergs wrote: > > > So with Andi's patch one should NOT enable V1 directories, or otherwise the XFS > > code can't read existing V2 filesystems anymore? Is that right? > > No, with Andi's patch, you can turn V1 on and off, but V2 is always > there. > > Oh, also, I don't think Andi's patch quite works. There are dir2 > functions that call code in xfs_dir.c - which is not linked in w/ Andi's > patch. Andi, did you load your module? :) I loaded a module, but it looks it was the old module. I see I missed xfs_dir_startup. Oops. Here is the updated patch. I think it's not my day today, too many mistakes. Please double check it that I didn't do another one.. -Andi --- linux/fs/xfs/xfs_dir.c-V1 Thu Aug 23 11:58:14 2001 +++ linux/fs/xfs/xfs_dir.c Wed Jan 30 00:58:47 2002 @@ -147,18 +147,6 @@ * Overall external interface routines. *========================================================================*/ -xfs_dahash_t xfs_dir_hash_dot, xfs_dir_hash_dotdot; - -/* - * One-time startup routine called from xfs_init(). - */ -void -xfs_dir_startup(void) -{ - xfs_dir_hash_dot = xfs_da_hashname(".", 1); - xfs_dir_hash_dotdot = xfs_da_hashname("..", 2); -} - /* * Initialize directory-related fields in the mount structure. */ --- linux/fs/xfs/xfs_types.h-V1 Wed Aug 8 16:08:34 2001 +++ linux/fs/xfs/xfs_types.h Tue Jan 29 21:15:22 2002 @@ -43,8 +43,17 @@ * defs files for the normal case. */ +#if BITS_PER_LONG==64 #define XFS_BIG_FILES 1 +#else +#define XFS_BIG_FILES 0 +#endif + +#if BITS_PER_LONG==64 || defined(BLK_64BIT_SECTOR) #define XFS_BIG_FILESYSTEMS 1 +#else +#define XFS_BIG_FILESYSTEMS 0 +#endif typedef __uint32_t xfs_agblock_t; /* blockno in alloc. group */ typedef __uint32_t xfs_extlen_t; /* extent length in blocks */ --- linux/fs/xfs/xfs_dir2.c-V1 Mon Apr 23 21:52:01 2001 +++ linux/fs/xfs/xfs_dir2.c Wed Jan 30 00:58:44 2002 @@ -90,6 +90,20 @@ xd_shortform_to_single: xfs_dir2_sf_to_block, }; + +xfs_dahash_t xfs_dir_hash_dot, xfs_dir_hash_dotdot; + +/* + * One-time startup routine called from xfs_init(). + */ +void +xfs_dir_startup(void) +{ + xfs_dir_hash_dot = xfs_da_hashname(".", 1); + xfs_dir_hash_dotdot = xfs_da_hashname("..", 2); +} + + /* * Interface routines. */ --- linux/fs/xfs/xfsidbg.c-V1 Sun Jan 27 15:42:22 2002 +++ linux/fs/xfs/xfsidbg.c Tue Jan 29 19:23:47 2002 @@ -2475,7 +2475,7 @@ #else kdb_printf(" blk %d bp 0x%p blkno 0x%Lx", #endif - i, p->blk[i].bp, p->blk[i].blkno); + i, p->blk[i].bp, (unsigned long long)p->blk[i].blkno); kdb_printf(" index %d hashval 0x%x ", p->blk[i].index, (uint_t)p->blk[i].hashval); switch(p->blk[i].magic) { @@ -2579,7 +2579,7 @@ if (bno == NULLFSBLOCK) sprintf(rval, "NULLFSBLOCK"); else if (ISNULLSTARTBLOCK(bno)) - sprintf(rval, "NULLSTARTBLOCK(%Ld)", STARTBLOCKVAL(bno)); + sprintf(rval, "NULLSTARTBLOCK(%Ld)", (unsigned long long)STARTBLOCKVAL(bno)); else if (mp) sprintf(rval, "%Ld[%x:%x]", (xfs_dfsbno_t)bno, XFS_FSB_TO_AGNO(mp, bno), XFS_FSB_TO_AGBNO(mp, bno)); @@ -3545,7 +3545,7 @@ #if XFS_BIG_FILES kdb_printf(" bp 0x%p blkno 0x%x ", eblk->bp, eblk->blkno); #else - kdb_printf(" bp 0x%x blkno 0x%x ", eblk->bp, eblk->blkno); + kdb_printf(" bp 0x%p blkno 0x%x ", eblk->bp, eblk->blkno); #endif kdb_printf("index %d hashval 0x%x\n", eblk->index, (uint_t)eblk->hashval); } --- linux/fs/xfs/xfs_mount.c-V1 Sun Jan 27 15:42:22 2002 +++ linux/fs/xfs/xfs_mount.c Tue Jan 29 18:46:06 2002 @@ -846,10 +846,18 @@ /* * Select the right directory manager. */ - mp->m_dirops = - XFS_SB_VERSION_HASDIRV2(&mp->m_sb) ? - xfsv2_dirops : - xfsv1_dirops; + + if (!XFS_SB_VERSION_HASDIRV2(&mp->m_sb)) { +#ifdef CONFIG_XFS_V1_DIR + mp->m_dirops = xfsv1_dirops; +#else + cmn_err(CE_WARN, "XFS: v1 directories not compiled in"); + goto error1; +#endif + } else { + mp->m_dirops = xfsv2_dirops; + } + /* * Initialize directory manager's entries. --- linux/fs/xfs/Makefile-V1 Tue Jan 29 18:47:03 2002 +++ linux/fs/xfs/Makefile Tue Jan 29 19:33:41 2002 @@ -73,6 +73,10 @@ obj-y += xfs_grio.o endif +ifneq ($(CONFIG_XFS_V1_DIR),) + obj-y += xfs_dir.o xfs_dir_leaf.o +endif + ifeq ($(CONFIG_HAVE_XFS_DMAPI),) obj-y += xfsdmapistubs.o else @@ -100,7 +104,6 @@ xfs_btree.o \ xfs_buf_item.o \ xfs_da_btree.o \ - xfs_dir.o \ xfs_dir2.o \ xfs_dir2_block.o \ xfs_dir2_data.o \ @@ -108,7 +111,6 @@ xfs_dir2_node.o \ xfs_dir2_sf.o \ xfs_dir2_trace.o \ - xfs_dir_leaf.o \ xfs_error.o \ xfs_extfree_item.o \ xfs_fsops.o \ --- linux/fs/Config.in-V1 Sun Jan 27 15:42:16 2002 +++ linux/fs/Config.in Tue Jan 29 21:13:02 2002 @@ -89,7 +89,8 @@ tristate 'SGI XFS filesystem support' CONFIG_XFS_FS dep_mbool ' Enable XFS Realtime support' CONFIG_XFS_RT $CONFIG_XFS_FS -dep_mbool ' Enable XFS Quota' CONFIG_XFS_QUOTA $CONFIG_XFS_FS +dep_mbool ' Enable XFS Quota' CONFIG_XFS_QUOTA $CONFIG_XFS_FS +dep_mbool ' Enable XFSv1 directories' CONFIG_XFS_V1_DIR $CONFIG_XFS_FS if [ "$CONFIG_XFS_FS" != "n" ]; then define_bool CONFIG_HAVE_ATTRCTL y dep_tristate ' Enable XFS DMAPI' CONFIG_XFS_DMAPI $CONFIG_XFS_FS