Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/makefs - clean up some debugging and verbose output
details: https://anonhg.NetBSD.org/src/rev/5c33c61674e4
branches: trunk
changeset: 521806:5c33c61674e4
user: lukem <lukem%NetBSD.org@localhost>
date: Wed Feb 06 02:17:14 2002 +0000
description:
- clean up some debugging and verbose output
- use fs_cstotal.cs_nifree rather than fs->fs_ncg * fs->fs_ipg to
determine the number of free inodes available in the file system
- don't count '.' (the root node for a level) in inode sizing, since
the parent has already been counted
- some more todo items
diffstat:
usr.sbin/makefs/TODO | 13 +++++++------
usr.sbin/makefs/ffs.c | 22 ++++++++++++----------
2 files changed, 19 insertions(+), 16 deletions(-)
diffs (102 lines):
diff -r d411cc96aafe -r 5c33c61674e4 usr.sbin/makefs/TODO
--- a/usr.sbin/makefs/TODO Wed Feb 06 01:38:53 2002 +0000
+++ b/usr.sbin/makefs/TODO Wed Feb 06 02:17:14 2002 +0000
@@ -1,8 +1,10 @@
-$NetBSD: TODO,v 1.5 2002/01/24 03:21:34 lukem Exp $
+$NetBSD: TODO,v 1.6 2002/02/06 02:17:14 lukem Exp $
todo
----
+- display block numbers for a given file (e.g, /boot)
+
- finish makefs.8
- testing
@@ -18,11 +20,10 @@
- size estimation is still out (need to take into account indirect blocks!)
-- mkfs.c parameter checking when density is rather high or low (dumps core)
- e.g, a large directory with a small number of files dumps core with a
- floating exception i.e, density is too high such as 21886635 or too
- low such as 30.
- update: lukem, 2001/01/23. not sure if this is still an issue.
+- parameter checking when density is rather high or low.
+
+- filling up a file system (running out of inodes or whatever)
+ doesn't do the right thing.
discuss
diff -r d411cc96aafe -r 5c33c61674e4 usr.sbin/makefs/ffs.c
--- a/usr.sbin/makefs/ffs.c Wed Feb 06 01:38:53 2002 +0000
+++ b/usr.sbin/makefs/ffs.c Wed Feb 06 02:17:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs.c,v 1.12 2002/01/31 22:44:02 tv Exp $ */
+/* $NetBSD: ffs.c,v 1.13 2002/02/06 02:17:14 lukem Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.12 2002/01/31 22:44:02 tv Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.13 2002/02/06 02:17:14 lukem Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -104,7 +104,7 @@
#define DFL_BLKSIZE 8192 /* block size */
#define DFL_SECSIZE 512 /* sector size */
#define DFL_CYLSPERGROUP 65536 /* cylinders per group */
-#define DFL_FRAGSPERINODE 4 /* fragments per inode - XXX */
+#define DFL_FRAGSPERINODE 4 /* fragments per inode */
#define DFL_ROTDELAY 0 /* rotational delay */
#define DFL_NRPOS 1 /* rotational positions */
#define DFL_RPM 3600 /* rpm of disk */
@@ -479,13 +479,16 @@
t = ((struct fs *)fsopts->superblock)->fs_time;
printf("mkfs returned %p; fs_time %s",
fsopts->superblock, ctime(&t));
+ printf("fs totals: nbfree %d, nffree %d, nifree %d, ndir %d\n",
+ fs->fs_cstotal.cs_nbfree, fs->fs_cstotal.cs_nffree,
+ fs->fs_cstotal.cs_nifree, fs->fs_cstotal.cs_ndir);
}
- if ((long long)fs->fs_ncg * fs->fs_ipg < fsopts->inodes) {
+ if (fs->fs_cstotal.cs_nifree < fsopts->inodes) {
warnx(
- "Image file `%s' only has %lld inodes, but %lld are required.",
+ "Image file `%s' has %lld free inodes; %lld are required.",
image,
- (long long)fs->fs_ncg * fs->fs_ipg,
+ (long long)fs->fs_cstotal.cs_nifree,
(long long)fsopts->inodes);
return (-1);
}
@@ -522,7 +525,7 @@
} while (0);
/*
- * XXX this must take into account extra space consumed
+ * XXX this needs to take into account extra space consumed
* by indirect blocks, etc.
*/
#define ADDSIZE(x) do { \
@@ -535,12 +538,11 @@
if (node == root) { /* we're at "." */
assert(strcmp(node->name, ".") == 0);
ADDDIRENT("..");
- }
- if ((node->inode->flags & FI_SIZED) == 0) {
+ } else if ((node->inode->flags & FI_SIZED) == 0) {
/* don't count duplicate names */
node->inode->flags |= FI_SIZED;
if (debug & DEBUG_FS_SIZE_DIR_NODE)
- printf("ffs_size_dir: %s size %lld\n",
+ printf("ffs_size_dir: `%s' size %lld\n",
node->name,
(long long)node->inode->st.st_size);
fsopts->inodes++;
Home |
Main Index |
Thread Index |
Old Index