Rework previous to avoid checking FS_FLAGS_UPDATED for ffsv2

This commit is contained in:
dsl 2004-03-27 11:46:40 +00:00
parent 2eb16b781e
commit 5f345f8d68

View File

@ -1,4 +1,4 @@
/* $NetBSD: readufs_ffs.c,v 1.6 2004/03/21 12:46:57 dsl Exp $ */
/* $NetBSD: readufs_ffs.c,v 1.7 2004/03/27 11:46:40 dsl Exp $ */
/* from Id: readufs_ffs.c,v 1.6 2003/04/08 09:19:32 itohy Exp */
/*
@ -50,19 +50,23 @@ try_ffs()
#ifdef DEBUG_WITH_STDIO
printf("FFS: sblk: pos %d magic 0x%x\n", btodb(*sbl), magic);
#endif
if (buf.sblk.fs_old_flags & FS_FLAGS_UPDATED) {
if (*sbl != buf.sblk.fs_sblockloc)
/* must be an alternate suberblock */
continue;
} else {
#ifdef USE_UFS1
if (magic == FS_UFS1_MAGIC
&& !(buf.sblk.fs_old_flags & FS_FLAGS_UPDATED)) {
if (*sbl == SBLOCK_UFS2)
/* might be an alternate suberblock */
continue;
break;
}
#endif
if (*sbl != buf.sblk.fs_sblockloc)
/* must be an alternate suberblock */
continue;
#ifdef USE_UFS1
if (magic == FS_UFS1_MAGIC)
if (magic == FS_UFS1_MAGIC) {
break;
}
#endif
#ifdef USE_UFS2
if (magic == FS_UFS2_MAGIC) {