Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/fsck_ffs add comments to make it clearer what cmpsblks(...
details: https://anonhg.NetBSD.org/src/rev/a23a9a53e8b9
branches: trunk
changeset: 515171:a23a9a53e8b9
user: lukem <lukem%NetBSD.org@localhost>
date: Tue Sep 18 08:38:28 2001 +0000
description:
add comments to make it clearer what cmpsblks() is doing
diffstat:
sbin/fsck_ffs/setup.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diffs (52 lines):
diff -r d00e92f4bd67 -r a23a9a53e8b9 sbin/fsck_ffs/setup.c
--- a/sbin/fsck_ffs/setup.c Tue Sep 18 06:29:08 2001 +0000
+++ b/sbin/fsck_ffs/setup.c Tue Sep 18 08:38:28 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.49 2001/09/06 02:16:00 lukem Exp $ */
+/* $NetBSD: setup.c,v 1.50 2001/09/18 08:38:28 lukem Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)setup.c 8.10 (Berkeley) 5/9/95";
#else
-__RCSID("$NetBSD: setup.c,v 1.49 2001/09/06 02:16:00 lukem Exp $");
+__RCSID("$NetBSD: setup.c,v 1.50 2001/09/18 08:38:28 lukem Exp $");
#endif
#endif /* not lint */
@@ -577,6 +577,13 @@
cmpsblks(const struct fs *sb, struct fs *asb)
{
+ /*
+ * Copy fields which we don't care if they're different in the
+ * alternate superblocks, as they're either likely to be
+ * different because they're per-cylinder-group specific, or
+ * because they're transient details which are only maintained
+ * in the primary superblock.
+ */
asb->fs_firstfield = sb->fs_firstfield;
asb->fs_unused_1 = sb->fs_unused_1;
asb->fs_time = sb->fs_time;
@@ -603,7 +610,7 @@
memmove(asb->fs_sparecon,
sb->fs_sparecon, sizeof sb->fs_sparecon);
/*
- * The following should not have to be copied.
+ * The following should not have to be copied, but need to be.
*/
asb->fs_fsbtodb = sb->fs_fsbtodb;
asb->fs_interleave = sb->fs_interleave;
@@ -614,6 +621,10 @@
asb->fs_state = sb->fs_state;
asb->fs_maxfilesize = sb->fs_maxfilesize;
+ /*
+ * Compare the superblocks, effectively checking every other
+ * field to see if they differ.
+ */
return (memcmp(sb, asb, (int)sb->fs_sbsize));
}
Home |
Main Index |
Thread Index |
Old Index