From be48f412fd5f2a51b6bb5260eec6eb72c190500b Mon Sep 17 00:00:00 2001 From: lukem Date: Thu, 24 Jun 2004 22:30:13 +0000 Subject: [PATCH] Define FFS_MAXBSIZE to 65536 and use instead of MAXBSIZE. Deprecate unused MAXINOPB. Should fix PR [toolchain/25603]. --- usr.sbin/makefs/ffs.c | 8 ++++---- usr.sbin/makefs/ffs/mkfs.c | 12 ++++++------ usr.sbin/makefs/ffs/newfs_extern.h | 6 ++---- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c index b6af6db4c7f1..0c442655a5f2 100644 --- a/usr.sbin/makefs/ffs.c +++ b/usr.sbin/makefs/ffs.c @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.29 2004/06/20 22:20:17 jmc Exp $ */ +/* $NetBSD: ffs.c,v 1.30 2004/06/24 22:30:13 lukem Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -71,7 +71,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: ffs.c,v 1.29 2004/06/20 22:20:17 jmc Exp $"); +__RCSID("$NetBSD: ffs.c,v 1.30 2004/06/24 22:30:13 lukem Exp $"); #endif /* !__lint */ #include @@ -315,7 +315,7 @@ ffs_validate(const char *dir, fsnode *root, fsinfo_t *fsopts) fsopts->optimization = DEFAULTOPT; if (fsopts->maxcontig == -1) fsopts->maxcontig = - MAX(1, MIN(MAXPHYS, MAXBSIZE) / fsopts->bsize); + MAX(1, MIN(MAXPHYS, FFS_MAXBSIZE) / fsopts->bsize); /* XXX ondisk32 */ if (fsopts->maxbpg == -1) fsopts->maxbpg = fsopts->bsize / sizeof(int32_t); @@ -991,7 +991,7 @@ ffs_write_inode(union dinode *dp, uint32_t ino, const fsinfo_t *fsopts) struct fs *fs; int cg, cgino, i; daddr_t d; - char sbbuf[MAXBSIZE]; + char sbbuf[FFS_MAXBSIZE]; int32_t initediblk; assert (dp != NULL); diff --git a/usr.sbin/makefs/ffs/mkfs.c b/usr.sbin/makefs/ffs/mkfs.c index 7b8c468ebef5..1a4c06665380 100644 --- a/usr.sbin/makefs/ffs/mkfs.c +++ b/usr.sbin/makefs/ffs/mkfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: mkfs.c,v 1.19 2004/06/20 22:20:18 jmc Exp $ */ +/* $NetBSD: mkfs.c,v 1.20 2004/06/24 22:30:13 lukem Exp $ */ /* * Copyright (c) 2002 Networks Associates Technology, Inc. @@ -48,7 +48,7 @@ static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95"; #else #ifdef __RCSID -__RCSID("$NetBSD: mkfs.c,v 1.19 2004/06/20 22:20:18 jmc Exp $"); +__RCSID("$NetBSD: mkfs.c,v 1.20 2004/06/24 22:30:13 lukem Exp $"); #endif #endif #endif /* not lint */ @@ -93,14 +93,14 @@ struct csum *fscs; union { struct cg cg; - char pad[MAXBSIZE]; + char pad[FFS_MAXBSIZE]; } cgun; #define acg cgun.cg char *iobuf; int iobufsize; -char writebuf[MAXBSIZE]; +char writebuf[FFS_MAXBSIZE]; static int Oflag; /* format as an 4.3BSD file system */ static int64_t fssize; /* file system size */ @@ -204,9 +204,9 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts) sblock.fs_bsize, MINBSIZE); exit(19); } - if (sblock.fs_bsize > MAXBSIZE) { + if (sblock.fs_bsize > FFS_MAXBSIZE) { printf("block size %d is too large, maximum is %d\n", - sblock.fs_bsize, MAXBSIZE); + sblock.fs_bsize, FFS_MAXBSIZE); exit(19); } if (sblock.fs_bsize < sblock.fs_fsize) { diff --git a/usr.sbin/makefs/ffs/newfs_extern.h b/usr.sbin/makefs/ffs/newfs_extern.h index e6527e08c9a8..36c658604378 100644 --- a/usr.sbin/makefs/ffs/newfs_extern.h +++ b/usr.sbin/makefs/ffs/newfs_extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: newfs_extern.h,v 1.1.1.1 2001/10/26 06:22:10 lukem Exp $ */ +/* $NetBSD: newfs_extern.h,v 1.2 2004/06/24 22:30:13 lukem Exp $ */ /* From: NetBSD: extern.h,v 1.3 2000/12/01 12:03:27 simonb Exp $ */ /* @@ -36,6 +36,4 @@ void ffs_write_superblock(struct fs *, const fsinfo_t *); void ffs_rdfs(daddr_t, int, void *, const fsinfo_t *); void ffs_wtfs(daddr_t, int, void *, const fsinfo_t *); -#ifndef MAXINOPB -#define MAXINOPB (MAXBSIZE / DINODE_SIZE) -#endif +#define FFS_MAXBSIZE 65536