Module Name:    src
Committed By:   martin
Date:           Wed Feb 22 13:11:38 UTC 2023

Modified Files:
        src/sbin/scan_ffs [netbsd-10]: Makefile scan_ffs.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #94):

        sbin/scan_ffs/Makefile: revision 1.11
        sbin/scan_ffs/scan_ffs.c: revision 1.37

Work on swapped-endian FFS.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.6.1 src/sbin/scan_ffs/Makefile
cvs rdiff -u -r1.36 -r1.36.2.1 src/sbin/scan_ffs/scan_ffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/scan_ffs/Makefile
diff -u src/sbin/scan_ffs/Makefile:1.10 src/sbin/scan_ffs/Makefile:1.10.6.1
--- src/sbin/scan_ffs/Makefile:1.10	Mon Sep  7 03:09:53 2020
+++ src/sbin/scan_ffs/Makefile	Wed Feb 22 13:11:37 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2020/09/07 03:09:53 mrg Exp $
+# $NetBSD: Makefile,v 1.10.6.1 2023/02/22 13:11:37 martin Exp $
 
 .include <bsd.own.mk>
 
@@ -10,9 +10,9 @@ MLINKS=	scan_ffs.8 scan_lfs.8
 LDADD=	-lutil
 DPADD=	${LIBUTIL}
 
-SRCS=	scan_ffs.c lfs_cksum.c
+SRCS=	scan_ffs.c ffs_bswap.c lfs_cksum.c
 SCAN_FFS=${NETBSDSRCDIR}/sbin/scan_ffs
-.PATH:  ${NETBSDSRCDIR}/sys/ufs/lfs ${SCAN_FFS}
+.PATH:  ${NETBSDSRCDIR}/sys/ufs/ffs ${NETBSDSRCDIR}/sys/ufs/lfs ${SCAN_FFS}
 
 MAN=	scan_ffs.8
 

Index: src/sbin/scan_ffs/scan_ffs.c
diff -u src/sbin/scan_ffs/scan_ffs.c:1.36 src/sbin/scan_ffs/scan_ffs.c:1.36.2.1
--- src/sbin/scan_ffs/scan_ffs.c:1.36	Thu Nov 17 06:40:39 2022
+++ src/sbin/scan_ffs/scan_ffs.c	Wed Feb 22 13:11:37 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: scan_ffs.c,v 1.36 2022/11/17 06:40:39 chs Exp $ */
+/* $NetBSD: scan_ffs.c,v 1.36.2.1 2023/02/22 13:11:37 martin Exp $ */
 
 /*
  * Copyright (c) 2005-2007 Juan Romero Pardines
@@ -33,7 +33,7 @@
  
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: scan_ffs.c,v 1.36 2022/11/17 06:40:39 chs Exp $");
+__RCSID("$NetBSD: scan_ffs.c,v 1.36.2.1 2023/02/22 13:11:37 martin Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -50,6 +50,7 @@ __RCSID("$NetBSD: scan_ffs.c,v 1.36 2022
 
 #include <ufs/ufs/dinode.h>
 #include <ufs/ffs/fs.h>
+#include <ufs/ffs/ffs_extern.h>
 
 #include <unistd.h>
 #include <stdlib.h>
@@ -123,6 +124,14 @@ static int
 ffs_checkver(struct sblockinfo *sbi)
 {
 	switch (sbi->ffs->fs_magic) {
+		case FS_UFS1_MAGIC_SWAPPED:
+		case FS_UFS2_MAGIC_SWAPPED:
+		case FS_UFS2EA_MAGIC_SWAPPED:
+			ffs_sb_swap(sbi->ffs, sbi->ffs);
+			break;
+	}
+
+	switch (sbi->ffs->fs_magic) {
 		case FS_UFS1_MAGIC:
 		case FS_UFS1_MAGIC_SWAPPED:
 			sbi->ffs->fs_size = sbi->ffs->fs_old_size;

Reply via email to