Hi
I have a few questions.
Is xfs using less 64bit arithmetics when compiled without
XFS_BIG_FILESYSTEMS and/or XFS_BIG_FILES? I think this will save some cpu
cyles on x86.
What happends with old files larger than 2GB, when a kernel without
XFS_BIG_FILES is used?
utz
Andi Kleen [ak@xxxxxxx] wrote:
> On Tue, Jan 29, 2002 at 07:40:01PM +0100, Andi Kleen wrote:
> > This patch does it. It's very simple and clean.
> > Saves another 18K on a xfs with BIG_FILESYSTEMS and BIG_FILES disabled.
>
> Oops. The patch had a silly mistake. The dep_mbools were missing the third
> parameter. It wasn't noticed by make oldconfig, but the more advanced
> configurators notice.
>
> Here is an update. Should probably also write some help text.
>
> -Andi
>
> --- linux/fs/xfs/xfs_types.h-V1 Wed Aug 8 16:08:34 2001
> +++ linux/fs/xfs/xfs_types.h Tue Jan 29 18:57:17 2002
> @@ -43,8 +43,17 @@
> * defs files for the normal case.
> */
>
> +#ifdef CONFIG_XFS_BIG_FILES
> #define XFS_BIG_FILES 1
> +#else
> +#define XFS_BIG_FILES 0
> +#endif
> +
> +#ifdef CONFIG_XFS_BIG_FILESYSTEMS
> #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/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 20:22:16 2002
> @@ -89,7 +89,10 @@
>
> 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
> +dep_mbool ' Enable XFS filesystems greater than 2TB'
> CONFIG_XFS_BIG_FILESYSTEMS $CONFIG_XFS_FS
> +dep_mbool ' Enable XFS files greater than 2GB' CONFIG_XFS_BIG_FILES
> $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
|