Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-10]: src/sbin/scan_ffs Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/3841cf5cb51e
branches:  netbsd-10
changeset: 373618:3841cf5cb51e
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Feb 22 13:11:37 2023 +0000

description:
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.

diffstat:

 sbin/scan_ffs/Makefile   |   6 +++---
 sbin/scan_ffs/scan_ffs.c |  13 +++++++++++--
 2 files changed, 14 insertions(+), 5 deletions(-)

diffs (62 lines):

diff -r c64a7b2dd8c7 -r 3841cf5cb51e sbin/scan_ffs/Makefile
--- a/sbin/scan_ffs/Makefile    Wed Feb 22 13:09:33 2023 +0000
+++ b/sbin/scan_ffs/Makefile    Wed Feb 22 13:11:37 2023 +0000
@@ -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 @@
 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
 
diff -r c64a7b2dd8c7 -r 3841cf5cb51e sbin/scan_ffs/scan_ffs.c
--- a/sbin/scan_ffs/scan_ffs.c  Wed Feb 22 13:09:33 2023 +0000
+++ b/sbin/scan_ffs/scan_ffs.c  Wed Feb 22 13:11:37 2023 +0000
@@ -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 @@
 
 #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 @@
 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;



Home | Main Index | Thread Index | Old Index