Use the buffer cache improvements from fsck_lfs. Make it build again.

This commit is contained in:
perseant 2005-04-12 01:06:39 +00:00
parent ed335360d1
commit 4c0e96afd6
2 changed files with 21 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: make_lfs.c,v 1.2 2005/03/25 20:17:58 perseant Exp $ */
/* $NetBSD: make_lfs.c,v 1.3 2005/04/12 01:06:39 perseant Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -69,7 +69,7 @@
#if 0
static char sccsid[] = "@(#)lfs.c 8.5 (Berkeley) 5/24/95";
#else
__RCSID("$NetBSD: make_lfs.c,v 1.2 2005/03/25 20:17:58 perseant Exp $");
__RCSID("$NetBSD: make_lfs.c,v 1.3 2005/04/12 01:06:39 perseant Exp $");
#endif
#endif /* not lint */
@ -344,9 +344,17 @@ make_lfs(int devfd, uint secsize, struct partition *partp, int minfree,
struct ubuf *bp;
struct uvnode *vp, *save_devvp;
int bb, ubb, dmeta, labelskew;
u_int64_t tsepb, tnseg;
/* Initialize buffer cache */
bufinit();
/*
* Initialize buffer cache. Use a ballpark guess of the length of
* the segment table for the number of hash chains.
*/
tnseg = partp->p_size / ((seg_size ? seg_size : DFL_LFSSEG) / secsize);
tsepb = (block_size ? block_size : DFL_LFSBLOCK) / sizeof(SEGSUM);
if (tnseg == 0)
fatal("zero size partition");
bufinit(tnseg / tsepb);
/* Initialize LFS subsystem with blank superblock and ifile. */
fs = lfs_init(devfd, start, (ufs_daddr_t)0, 1, 1/* XXX debug*/);

View File

@ -1,4 +1,4 @@
/* $NetBSD: newfs.c,v 1.15 2005/02/26 05:45:54 perseant Exp $ */
/* $NetBSD: newfs.c,v 1.16 2005/04/12 01:06:39 perseant Exp $ */
/*-
* Copyright (c) 1989, 1992, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1992, 1993\n\
#if 0
static char sccsid[] = "@(#)newfs.c 8.5 (Berkeley) 5/24/95";
#else
__RCSID("$NetBSD: newfs.c,v 1.15 2005/02/26 05:45:54 perseant Exp $");
__RCSID("$NetBSD: newfs.c,v 1.16 2005/04/12 01:06:39 perseant Exp $");
#endif
#endif /* not lint */
@ -72,6 +72,7 @@ __RCSID("$NetBSD: newfs.c,v 1.15 2005/02/26 05:45:54 perseant Exp $");
#include <util.h>
#include "config.h"
#include "extern.h"
#include "bufcache.h"
#define COMPAT /* allow non-labeled disks */
@ -169,6 +170,7 @@ main(int argc, char **argv)
daddr_t start;
char *cp, *opstring;
int byte_sized = 0;
int r;
version = DFL_VERSION; /* what version of lfs to make */
@ -346,9 +348,12 @@ main(int argc, char **argv)
}
/* If we're making a LFS, we break out here */
exit(make_lfs(fso, secsize, pp, minfree, bsize, fsize, segsize,
r = make_lfs(fso, secsize, pp, minfree, bsize, fsize, segsize,
minfreeseg, version, start, ibsize, interleave,
roll_id));
roll_id);
if (debug)
bufstats();
exit(r);
}
#ifdef COMPAT