svn commit: r209528 - in user/jmallett/octeon: . bin/pkill bin/sh cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/binutils/doc etc/mtree gnu/usr.bin/binutils/ld lib lib/libc/mips/sys...

Juli Mallett jmallett at FreeBSD.org
Sat Jun 26 03:08:13 UTC 2010


Author: jmallett
Date: Sat Jun 26 03:08:12 2010
New Revision: 209528
URL: http://svn.freebsd.org/changeset/base/209528

Log:
  Merge from head and expand pte.h's description of cache coherency attributes
  at the same time.

Added:
  user/jmallett/octeon/Makefile.mips
     - copied unchanged from r209526, head/Makefile.mips
  user/jmallett/octeon/share/man/man4/aibs.4
     - copied unchanged from r209526, head/share/man/man4/aibs.4
  user/jmallett/octeon/sys/conf/ldscript.mips.n32
     - copied unchanged from r209526, head/sys/conf/ldscript.mips.n32
  user/jmallett/octeon/sys/dev/acpi_support/atk0110.c
     - copied unchanged from r209526, head/sys/dev/acpi_support/atk0110.c
  user/jmallett/octeon/sys/kern/kern_et.c
     - copied unchanged from r209526, head/sys/kern/kern_et.c
  user/jmallett/octeon/sys/mips/conf/XLRN32
     - copied unchanged from r209526, head/sys/mips/conf/XLRN32
  user/jmallett/octeon/sys/modules/acpi/aibs/
     - copied from r209526, head/sys/modules/acpi/aibs/
  user/jmallett/octeon/sys/sys/timeet.h
     - copied unchanged from r209526, head/sys/sys/timeet.h
  user/jmallett/octeon/sys/x86/x86/timeevents.c
     - copied unchanged from r209526, head/sys/x86/x86/timeevents.c
  user/jmallett/octeon/tools/tools/netrate/tcpp/parallelism.csh
     - copied unchanged from r209526, head/tools/tools/netrate/tcpp/parallelism.csh
  user/jmallett/octeon/tools/tools/netrate/tcpp/runit.pl
     - copied unchanged from r209526, head/tools/tools/netrate/tcpp/runit.pl
  user/jmallett/octeon/usr.sbin/pc-sysinstall/
     - copied from r209526, head/usr.sbin/pc-sysinstall/
Modified:
  user/jmallett/octeon/Makefile.inc1
  user/jmallett/octeon/bin/pkill/pkill.1
  user/jmallett/octeon/bin/pkill/pkill.c
  user/jmallett/octeon/bin/sh/parser.c
  user/jmallett/octeon/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l
  user/jmallett/octeon/contrib/binutils/binutils/doc/readelf.1
  user/jmallett/octeon/etc/mtree/BSD.usr.dist
  user/jmallett/octeon/gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh
  user/jmallett/octeon/gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh
  user/jmallett/octeon/lib/Makefile
  user/jmallett/octeon/lib/libc/mips/sys/brk.S
  user/jmallett/octeon/lib/libc/mips/sys/sbrk.S
  user/jmallett/octeon/lib/libc/nls/ru_RU.KOI8-R.msg   (contents, props changed)
  user/jmallett/octeon/sbin/fsck_ffs/main.c
  user/jmallett/octeon/sbin/fsck_ffs/suj.c
  user/jmallett/octeon/sbin/fsck_msdosfs/Makefile
  user/jmallett/octeon/sbin/fsck_msdosfs/boot.c
  user/jmallett/octeon/sbin/fsck_msdosfs/check.c
  user/jmallett/octeon/sbin/fsck_msdosfs/dir.c
  user/jmallett/octeon/sbin/fsck_msdosfs/fat.c
  user/jmallett/octeon/sbin/geom/class/part/geom_part.c
  user/jmallett/octeon/sbin/geom/class/sched/gsched.8
  user/jmallett/octeon/sbin/geom/core/geom.c
  user/jmallett/octeon/sbin/geom/core/geom.h
  user/jmallett/octeon/sbin/geom/misc/subr.c
  user/jmallett/octeon/sbin/geom/misc/subr.h
  user/jmallett/octeon/sbin/ping/ping.c
  user/jmallett/octeon/share/examples/perfmon/perfmon.c
  user/jmallett/octeon/share/man/man4/Makefile
  user/jmallett/octeon/sys/amd64/amd64/exception.S
  user/jmallett/octeon/sys/amd64/amd64/machdep.c
  user/jmallett/octeon/sys/amd64/amd64/mp_machdep.c
  user/jmallett/octeon/sys/amd64/ia32/ia32_exception.S
  user/jmallett/octeon/sys/amd64/include/apicvar.h
  user/jmallett/octeon/sys/amd64/include/asmacros.h
  user/jmallett/octeon/sys/boot/ficl/ficl.h
  user/jmallett/octeon/sys/boot/forth/loader.conf
  user/jmallett/octeon/sys/compat/x86bios/x86bios.c
  user/jmallett/octeon/sys/compat/x86bios/x86bios.h
  user/jmallett/octeon/sys/conf/files
  user/jmallett/octeon/sys/conf/files.amd64
  user/jmallett/octeon/sys/conf/files.i386
  user/jmallett/octeon/sys/dev/acpica/acpi_hpet.c
  user/jmallett/octeon/sys/dev/acpica/acpi_hpet.h
  user/jmallett/octeon/sys/dev/e1000/if_igb.c
  user/jmallett/octeon/sys/dev/fb/fbreg.h
  user/jmallett/octeon/sys/dev/fb/vesa.c
  user/jmallett/octeon/sys/dev/hptiop/hptiop.c
  user/jmallett/octeon/sys/dev/hptmv/entry.c
  user/jmallett/octeon/sys/dev/sound/usb/uaudio.c
  user/jmallett/octeon/sys/dev/sound/usb/uaudioreg.h
  user/jmallett/octeon/sys/dev/usb/controller/ehci.c
  user/jmallett/octeon/sys/dev/usb/controller/ohci.c
  user/jmallett/octeon/sys/dev/usb/controller/uhci.c
  user/jmallett/octeon/sys/dev/usb/net/if_rue.c
  user/jmallett/octeon/sys/dev/usb/quirk/usb_quirk.c
  user/jmallett/octeon/sys/dev/usb/usb_transfer.c
  user/jmallett/octeon/sys/dev/usb/usbdevs
  user/jmallett/octeon/sys/dev/usb/wlan/if_upgt.c
  user/jmallett/octeon/sys/fs/udf/udf_vnops.c
  user/jmallett/octeon/sys/i386/conf/NOTES
  user/jmallett/octeon/sys/i386/i386/apic_vector.s
  user/jmallett/octeon/sys/i386/i386/atpic_vector.s
  user/jmallett/octeon/sys/i386/i386/exception.s
  user/jmallett/octeon/sys/i386/i386/identcpu.c
  user/jmallett/octeon/sys/i386/i386/machdep.c
  user/jmallett/octeon/sys/i386/i386/mp_machdep.c
  user/jmallett/octeon/sys/i386/i386/support.s
  user/jmallett/octeon/sys/i386/i386/vm_machdep.c
  user/jmallett/octeon/sys/i386/include/apicvar.h
  user/jmallett/octeon/sys/i386/include/md_var.h
  user/jmallett/octeon/sys/i386/include/npx.h
  user/jmallett/octeon/sys/i386/include/pcb.h
  user/jmallett/octeon/sys/i386/isa/npx.c
  user/jmallett/octeon/sys/isa/rtc.h
  user/jmallett/octeon/sys/kern/kern_acct.c
  user/jmallett/octeon/sys/kern/kern_clock.c
  user/jmallett/octeon/sys/kern/kern_malloc.c
  user/jmallett/octeon/sys/kern/kern_mbuf.c
  user/jmallett/octeon/sys/kern/kern_module.c
  user/jmallett/octeon/sys/kern/kern_resource.c
  user/jmallett/octeon/sys/kern/kern_sdt.c
  user/jmallett/octeon/sys/kern/kern_sig.c
  user/jmallett/octeon/sys/kern/kern_tc.c
  user/jmallett/octeon/sys/kern/kern_umtx.c
  user/jmallett/octeon/sys/kern/makesyscalls.sh
  user/jmallett/octeon/sys/kern/subr_bus.c
  user/jmallett/octeon/sys/kern/subr_devstat.c
  user/jmallett/octeon/sys/kern/subr_fattime.c
  user/jmallett/octeon/sys/kern/subr_lock.c
  user/jmallett/octeon/sys/kern/subr_mchain.c
  user/jmallett/octeon/sys/kern/subr_module.c
  user/jmallett/octeon/sys/kern/subr_param.c
  user/jmallett/octeon/sys/kern/subr_trap.c
  user/jmallett/octeon/sys/kern/subr_witness.c
  user/jmallett/octeon/sys/kern/sys_process.c
  user/jmallett/octeon/sys/kern/systrace_args.c
  user/jmallett/octeon/sys/kern/uipc_mbuf.c
  user/jmallett/octeon/sys/kern/uipc_mbuf2.c
  user/jmallett/octeon/sys/kern/uipc_mqueue.c
  user/jmallett/octeon/sys/kern/uipc_syscalls.c
  user/jmallett/octeon/sys/kern/vfs_cache.c
  user/jmallett/octeon/sys/kern/vfs_subr.c
  user/jmallett/octeon/sys/mips/atheros/ar71xx_wdog.c
  user/jmallett/octeon/sys/mips/atheros/ar71xxreg.h
  user/jmallett/octeon/sys/mips/include/pte.h
  user/jmallett/octeon/sys/mips/include/vm.h
  user/jmallett/octeon/sys/mips/include/vmparam.h
  user/jmallett/octeon/sys/mips/mips/exception.S
  user/jmallett/octeon/sys/mips/mips/machdep.c
  user/jmallett/octeon/sys/mips/mips/pm_machdep.c
  user/jmallett/octeon/sys/mips/mips/pmap.c
  user/jmallett/octeon/sys/modules/acpi/Makefile
  user/jmallett/octeon/sys/modules/mqueue/Makefile
  user/jmallett/octeon/sys/netinet/sctp_pcb.c
  user/jmallett/octeon/sys/pc98/cbus/clock.c
  user/jmallett/octeon/sys/pc98/include/npx.h
  user/jmallett/octeon/sys/pc98/pc98/machdep.c
  user/jmallett/octeon/sys/powerpc/aim/mmu_oea.c
  user/jmallett/octeon/sys/powerpc/aim/nexus.c
  user/jmallett/octeon/sys/powerpc/booke/pmap.c
  user/jmallett/octeon/sys/powerpc/include/intr_machdep.h
  user/jmallett/octeon/sys/powerpc/include/openpicvar.h
  user/jmallett/octeon/sys/powerpc/mpc85xx/atpic.c
  user/jmallett/octeon/sys/powerpc/mpc85xx/ocpbus.c
  user/jmallett/octeon/sys/powerpc/mpc85xx/opic.c
  user/jmallett/octeon/sys/powerpc/mpc85xx/pci_ocp.c
  user/jmallett/octeon/sys/powerpc/powermac/cpcht.c
  user/jmallett/octeon/sys/powerpc/powermac/openpic_macio.c
  user/jmallett/octeon/sys/powerpc/powerpc/intr_machdep.c
  user/jmallett/octeon/sys/powerpc/powerpc/openpic.c
  user/jmallett/octeon/sys/powerpc/powerpc/pic_if.m
  user/jmallett/octeon/sys/sys/systm.h
  user/jmallett/octeon/sys/ufs/ufs/ufs_lookup.c
  user/jmallett/octeon/sys/vm/vm_page.c
  user/jmallett/octeon/sys/vm/vm_page.h
  user/jmallett/octeon/sys/vm/vm_pageout.c
  user/jmallett/octeon/sys/x86/cpufreq/est.c
  user/jmallett/octeon/sys/x86/isa/atrtc.c
  user/jmallett/octeon/sys/x86/isa/clock.c
  user/jmallett/octeon/sys/x86/x86/local_apic.c
  user/jmallett/octeon/tools/tools/netrate/tcpp/README
  user/jmallett/octeon/usr.bin/du/du.1
  user/jmallett/octeon/usr.bin/du/du.c
  user/jmallett/octeon/usr.bin/ypwhich/ypwhich.c
  user/jmallett/octeon/usr.sbin/Makefile
  user/jmallett/octeon/usr.sbin/boot0cfg/boot0cfg.c
  user/jmallett/octeon/usr.sbin/cpucontrol/amd.c
  user/jmallett/octeon/usr.sbin/cpucontrol/intel.c
  user/jmallett/octeon/usr.sbin/mptutil/mptutil.8
  user/jmallett/octeon/usr.sbin/sysinstall/Makefile
  user/jmallett/octeon/usr.sbin/sysinstall/dist.c
  user/jmallett/octeon/usr.sbin/sysinstall/index.c
  user/jmallett/octeon/usr.sbin/sysinstall/install.c
  user/jmallett/octeon/usr.sbin/sysinstall/misc.c
  user/jmallett/octeon/usr.sbin/sysinstall/sysinstall.8
  user/jmallett/octeon/usr.sbin/sysinstall/sysinstall.h
  user/jmallett/octeon/usr.sbin/timed/timed/measure.c
Directory Properties:
  user/jmallett/octeon/   (props changed)
  user/jmallett/octeon/share/mk/bsd.arch.inc.mk   (props changed)
  user/jmallett/octeon/sys/arm/include/bootinfo.h   (props changed)

Modified: user/jmallett/octeon/Makefile.inc1
==============================================================================
--- user/jmallett/octeon/Makefile.inc1	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/Makefile.inc1	Sat Jun 26 03:08:12 2010	(r209528)
@@ -30,9 +30,7 @@
 
 .include <bsd.own.mk>
 
-.if ${MACHINE_ARCH} == "mips"
-MK_RESCUE=no	# not yet
-.endif
+.include <bsd.arch.inc.mk>
 
 # We must do share/info early so that installation of info `dir'
 # entries works correctly.  Do it first since it is less likely to
@@ -167,7 +165,7 @@ BUILD_ARCH!=	uname -p
 .if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING)
 OBJTREE=	${MAKEOBJDIRPREFIX}
 .else
-OBJTREE=	${MAKEOBJDIRPREFIX}/${TARGET}
+OBJTREE=	${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
 .endif
 WORLDTMP=	${OBJTREE}${.CURDIR}/tmp
 # /usr/games added for fortune which depend on strfile
@@ -1110,10 +1108,10 @@ _prereq_libs= gnu/lib/libssp/libssp_nons
 # all shared libraries for ELF.
 #
 _startup_libs=	gnu/lib/csu
-.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
-_startup_libs+=	lib/csu/${MACHINE_ARCH}-elf
+.if exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf)
+_startup_libs+=	lib/csu/${MACHINE_CPUARCH}-elf
 .else
-_startup_libs+=	lib/csu/${MACHINE_ARCH}
+_startup_libs+=	lib/csu/${MACHINE_CPUARCH}
 .endif
 _startup_libs+=	gnu/lib/libgcc
 _startup_libs+=	lib/libc

Copied: user/jmallett/octeon/Makefile.mips (from r209526, head/Makefile.mips)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jmallett/octeon/Makefile.mips	Sat Jun 26 03:08:12 2010	(r209528, copy of r209526, head/Makefile.mips)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+# A bug in binutils prevents rescue from building, so override the user's
+# choice.
+MK_RESCUE=no

Modified: user/jmallett/octeon/bin/pkill/pkill.1
==============================================================================
--- user/jmallett/octeon/bin/pkill/pkill.1	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/bin/pkill/pkill.1	Sat Jun 26 03:08:12 2010	(r209528)
@@ -156,14 +156,16 @@ The value
 matches processes not in jail.
 .It Fl l
 Long output.
-Print the process name in addition to the process ID for each matching
+For
+.Nm pgrep ,
+print the process name in addition to the process ID for each matching
 process.
 If used in conjunction with
 .Fl f ,
 print the process ID and the full argument list for each matching process.
-This option can only be used with the
-.Nm pgrep
-command.
+For
+.Nm pkill ,
+display the kill command used for each process killed.
 .It Fl n
 Select only the newest (most recently started) of the matching processes.
 .It Fl o

Modified: user/jmallett/octeon/bin/pkill/pkill.c
==============================================================================
--- user/jmallett/octeon/bin/pkill/pkill.c	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/bin/pkill/pkill.c	Sat Jun 26 03:08:12 2010	(r209528)
@@ -128,7 +128,7 @@ main(int argc, char **argv)
 {
 	char buf[_POSIX2_LINE_MAX], *mstr, **pargv, *p, *q, *pidfile;
 	const char *execf, *coref;
-	int ancestors, debug_opt;
+	int ancestors, debug_opt, did_action;
 	int i, ch, bestidx, rv, criteria, pidfromfile, pidfilelock;
 	size_t jsz;
 	int (*action)(const struct kinfo_proc *);
@@ -242,8 +242,6 @@ main(int argc, char **argv)
 			criteria = 1;
 			break;
 		case 'l':
-			if (!pgrep)
-				usage();
 			longfmt = 1;
 			break;
 		case 'n':
@@ -530,16 +528,24 @@ main(int argc, char **argv)
 	/*
 	 * Take the appropriate action for each matched process, if any.
 	 */
+	did_action = 0;
 	for (i = 0, rv = 0, kp = plist; i < nproc; i++, kp++) {
 		if (PSKIP(kp))
 			continue;
 		if (selected[i]) {
+			if (longfmt && !pgrep) {
+				did_action = 1;
+				printf("kill -%d %d\n", signum, kp->ki_pid);
+			}
 			if (inverse)
 				continue;
 		} else if (!inverse)
 			continue;
 		rv |= (*action)(kp);
 	}
+	if (!did_action && !pgrep && longfmt)
+		fprintf(stderr,
+		    "No matching processes belonging to you were found\n");
 
 	exit(rv ? STATUS_MATCH : STATUS_NOMATCH);
 }
@@ -552,7 +558,7 @@ usage(void)
 	if (pgrep)
 		ustr = "[-LSfilnoqvx] [-d delim]";
 	else
-		ustr = "[-signal] [-ILfinovx]";
+		ustr = "[-signal] [-ILfilnovx]";
 
 	fprintf(stderr,
 		"usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n"

Modified: user/jmallett/octeon/bin/sh/parser.c
==============================================================================
--- user/jmallett/octeon/bin/sh/parser.c	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/bin/sh/parser.c	Sat Jun 26 03:08:12 2010	(r209528)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 
 #include <stdlib.h>
 #include <unistd.h>
+#include <stdio.h>
 
 #include "shell.h"
 #include "parser.h"

Modified: user/jmallett/octeon/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l
==============================================================================
--- user/jmallett/octeon/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l	Sat Jun 26 03:08:12 2010	(r209528)
@@ -67,8 +67,12 @@
  * for all subsequent invocations, which is the effect desired.
  */
 #undef  unput
-#define unput(c) \
-	if (c != EOF) yyunput( c, yytext_ptr )
+#define unput(c)					\
+	do {						\
+		int _c = c;				\
+		if (_c != EOF)				\
+			yyunput(_c, yytext_ptr);	\
+	} while(0)
 #endif
 
 static int id_or_type(const char *);

Modified: user/jmallett/octeon/contrib/binutils/binutils/doc/readelf.1
==============================================================================
--- user/jmallett/octeon/contrib/binutils/binutils/doc/readelf.1	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/contrib/binutils/binutils/doc/readelf.1	Sat Jun 26 03:08:12 2010	(r209528)
@@ -247,14 +247,6 @@ Displays the contents of the file's relo
 .PD
 Displays the contents of the file's unwind section, if it has one.  Only
 the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported.
-.IP "\fB\-u\fR" 4
-.IX Item "-u"
-.PD 0
-.IP "\fB\-\-unwind\fR" 4
-.IX Item "--unwind"
-.PD
-Displays the contents of the file's unwind section, if it has one.  Only
-the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported.
 .IP "\fB\-d\fR" 4
 .IX Item "-d"
 .PD 0

Modified: user/jmallett/octeon/etc/mtree/BSD.usr.dist
==============================================================================
--- user/jmallett/octeon/etc/mtree/BSD.usr.dist	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/etc/mtree/BSD.usr.dist	Sat Jun 26 03:08:12 2010	(r209528)
@@ -261,6 +261,8 @@
             ..
             nwclient
             ..
+            pc-sysinstall
+            ..
             perfmon
             ..
             pf
@@ -1226,6 +1228,20 @@
                 ..
             ..
         ..
+        pc-sysinstall
+            backend
+            ..
+	    backend-partmanager
+            ..
+	    backend-query
+            ..
+	    conf
+                license
+		..
+            ..
+	    doc
+            ..
+        ..
         security
         ..
         sendmail

Modified: user/jmallett/octeon/gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh
==============================================================================
--- user/jmallett/octeon/gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh	Sat Jun 26 03:08:12 2010	(r209528)
@@ -2,3 +2,4 @@
 . ${srcdir}/emulparams/elf32btsmipn32.sh
 . ${srcdir}/emulparams/elf_fbsd.sh
 GENERATE_PIE_SCRIPT=yes
+ALIGNMENT=8

Modified: user/jmallett/octeon/gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh
==============================================================================
--- user/jmallett/octeon/gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh	Sat Jun 26 03:08:12 2010	(r209528)
@@ -2,3 +2,4 @@
 . ${srcdir}/emulparams/elf32ltsmipn32.sh
 . ${srcdir}/emulparams/elf_fbsd.sh
 GENERATE_PIE_SCRIPT=yes
+ALIGNMENT=8

Modified: user/jmallett/octeon/lib/Makefile
==============================================================================
--- user/jmallett/octeon/lib/Makefile	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/lib/Makefile	Sat Jun 26 03:08:12 2010	(r209528)
@@ -138,7 +138,7 @@ _libsdp=	libsdp
 _libbsnmp=	libbsnmp
 .endif
 
-.if ${MK_CLANG} != "no"
+.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT)
 _clang=		clang
 .endif
 

Modified: user/jmallett/octeon/lib/libc/mips/sys/brk.S
==============================================================================
--- user/jmallett/octeon/lib/libc/mips/sys/brk.S	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/lib/libc/mips/sys/brk.S	Sat Jun 26 03:08:12 2010	(r209528)
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
 
 	.data
 _C_LABEL(minbrk):
-	.word	_C_LABEL(_end)
+	PTR_WORD	_C_LABEL(_end)
 
 	.text
 LEAF(__sys_brk)

Modified: user/jmallett/octeon/lib/libc/mips/sys/sbrk.S
==============================================================================
--- user/jmallett/octeon/lib/libc/mips/sys/sbrk.S	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/lib/libc/mips/sys/sbrk.S	Sat Jun 26 03:08:12 2010	(r209528)
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
 
 	.data
 _C_LABEL(__curbrk):
-	.word	_C_LABEL(_end)
+	PTR_WORD	_C_LABEL(_end)
 	.text
 
 LEAF(__sys_sbrk)

Modified: user/jmallett/octeon/lib/libc/nls/ru_RU.KOI8-R.msg
==============================================================================
--- user/jmallett/octeon/lib/libc/nls/ru_RU.KOI8-R.msg	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/lib/libc/nls/ru_RU.KOI8-R.msg	Sat Jun 26 03:08:12 2010	(r209528)
@@ -183,6 +183,16 @@ $ ENOATTR
 87 áÔÒÉÂÕÔ ÎÅ ÎÁÊÄÅÎ
 $ EDOOFUS
 88 ïÛÉÂËÁ ÐÒÏÇÒÁÍÍÉÒÏ×ÁÎÉÑ
+$ EBADMSG
+89 ðÌÏÈÏÊ ÆÏÒÍÁÔ ÓÏÏÂÝÅÎÉÑ
+$ EMULTIHOP
+90 ðÏÐÙÔËÁ ÍÕÌØÔÉÈÏÐÁ
+$ ENOLINK
+91 ëÁÎÁÌ ÒÁÚÏÒ×ÁÎ
+$ EPROTO
+92 ïÛÉÂËÁ ÐÒÏÔÏËÏÌÁ
+$ ENOTCAPABLE
+93 îÅÄÏÓÔÁÔÏÞÎÏ ×ÏÚÍÏÖÎÏÓÔÅÊ
 $
 $ strsignal() support catalog
 $

Modified: user/jmallett/octeon/sbin/fsck_ffs/main.c
==============================================================================
--- user/jmallett/octeon/sbin/fsck_ffs/main.c	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/sbin/fsck_ffs/main.c	Sat Jun 26 03:08:12 2010	(r209528)
@@ -388,16 +388,18 @@ checkfilesys(char *filesys)
 	/*
 	 * Determine if we can and should do journal recovery.
 	 */
-	if ((sblock.fs_flags & (FS_SUJ | FS_NEEDSFSCK)) == FS_SUJ) {
-		if (preen || reply("USE JOURNAL?")) {
-			if (suj_check(filesys) == 0) {
-				if (chkdoreload(mntp) == 0)
-					exit(0);
-				exit(4);
+	if ((sblock.fs_flags & FS_SUJ) == FS_SUJ) {
+		if ((sblock.fs_flags & FS_NEEDSFSCK) != FS_NEEDSFSCK && skipclean) {
+			if (preen || reply("USE JOURNAL?")) {
+				if (suj_check(filesys) == 0) {
+					printf("\n***** FILE SYSTEM MARKED CLEAN *****\n");
+					if (chkdoreload(mntp) == 0)
+						exit(0);
+					exit(4);
+				}
 			}
-			/* suj_check failed, fall through. */
+			printf("** Skipping journal, falling through to full fsck\n\n");
 		}
-		printf("** Skipping journal, falling through to full fsck\n");
 		/*
 		 * Write the superblock so we don't try to recover the
 		 * journal on another pass.

Modified: user/jmallett/octeon/sbin/fsck_ffs/suj.c
==============================================================================
--- user/jmallett/octeon/sbin/fsck_ffs/suj.c	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/sbin/fsck_ffs/suj.c	Sat Jun 26 03:08:12 2010	(r209528)
@@ -37,12 +37,15 @@ __FBSDID("$FreeBSD$");
 #include <ufs/ufs/dir.h>
 #include <ufs/ffs/fs.h>
 
+#include <setjmp.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
 #include <libufs.h>
 #include <string.h>
 #include <strings.h>
+#include <sysexits.h>
 #include <err.h>
 #include <assert.h>
 
@@ -141,7 +144,10 @@ uint64_t freedir;
 uint64_t jbytes;
 uint64_t jrecs;
 
+static jmp_buf	jmpbuf;
+
 typedef void (*ino_visitor)(ino_t, ufs_lbn_t, ufs2_daddr_t, int);
+static void err_suj(const char *, ...) __dead2;
 static void ino_trunc(ino_t, off_t);
 static void ino_decr(ino_t);
 static void ino_adjust(struct suj_ino *);
@@ -155,11 +161,30 @@ errmalloc(size_t n)
 
 	a = malloc(n);
 	if (a == NULL)
-		errx(1, "malloc(%zu)", n);
+		err(EX_OSERR, "malloc(%zu)", n);
 	return (a);
 }
 
 /*
+ * When hit a fatal error in journalling check, print out
+ * the error and then offer to fallback to normal fsck.
+ */
+static void
+err_suj(const char * restrict fmt, ...)
+{
+	va_list ap;
+
+	if (preen)
+		(void)fprintf(stdout, "%s: ", cdevname);
+
+	va_start(ap, fmt);
+	(void)vfprintf(stdout, fmt, ap);
+	va_end(ap);
+
+	longjmp(jmpbuf, -1);
+}
+
+/*
  * Open the given provider, load superblock.
  */
 static void
@@ -169,9 +194,9 @@ opendisk(const char *devnam)
 		return;
 	disk = malloc(sizeof(*disk));
 	if (disk == NULL)
-		errx(1, "malloc(%zu)", sizeof(*disk));
+		err(EX_OSERR, "malloc(%zu)", sizeof(*disk));
 	if (ufs_disk_fillout(disk, devnam) == -1) {
-		err(1, "ufs_disk_fillout(%s) failed: %s", devnam,
+		err(EX_OSERR, "ufs_disk_fillout(%s) failed: %s", devnam,
 		    disk->d_error);
 	}
 	fs = &disk->d_fs;
@@ -203,9 +228,9 @@ closedisk(const char *devnam)
 	fs->fs_time = time(NULL);
 	fs->fs_mtime = time(NULL);
 	if (sbwrite(disk, 0) == -1)
-		err(1, "sbwrite(%s)", devnam);
+		err(EX_OSERR, "sbwrite(%s)", devnam);
 	if (ufs_disk_close(disk) == -1)
-		err(1, "ufs_disk_close(%s)", devnam);
+		err(EX_OSERR, "ufs_disk_close(%s)", devnam);
 	free(disk);
 	disk = NULL;
 	fs = NULL;
@@ -221,10 +246,8 @@ cg_lookup(int cgx)
 	struct cghd *hd;
 	struct suj_cg *sc;
 
-	if (cgx < 0 || cgx >= fs->fs_ncg) {
-		abort();
-		errx(1, "Bad cg number %d", cgx);
-	}
+	if (cgx < 0 || cgx >= fs->fs_ncg)
+		err_suj("Bad cg number %d\n", cgx);
 	if (lastcg && lastcg->sc_cgx == cgx)
 		return (lastcg);
 	hd = &cghash[SUJ_HASH(cgx)];
@@ -241,7 +264,7 @@ cg_lookup(int cgx)
 	LIST_INSERT_HEAD(hd, sc, sc_next);
 	if (bread(disk, fsbtodb(fs, cgtod(fs, sc->sc_cgx)), sc->sc_cgbuf,
 	    fs->fs_bsize) == -1)
-		err(1, "Unable to read cylinder group %d", sc->sc_cgx);
+		err_suj("Unable to read cylinder group %d\n", sc->sc_cgx);
 
 	return (sc);
 }
@@ -344,7 +367,7 @@ dblk_read(ufs2_daddr_t blk, int size)
 		dblk->db_buf = errmalloc(size);
 		dblk->db_size = size;
 		if (bread(disk, fsbtodb(fs, blk), dblk->db_buf, size) == -1)
-			err(1, "Failed to read data block %jd", blk);
+			err_suj("Failed to read data block %jd\n", blk);
 	}
 	return (dblk->db_buf);
 }
@@ -370,7 +393,7 @@ dblk_write(void)
 				continue;
 			if (bwrite(disk, fsbtodb(fs, dblk->db_blk),
 			    dblk->db_buf, dblk->db_size) == -1)
-				err(1, "Unable to write block %jd",
+				err_suj("Unable to write block %jd\n",
 				    dblk->db_blk);
 		}
 	}
@@ -403,7 +426,7 @@ ino_read(ino_t ino)
 	iblk->ib_blk = blk;
 	LIST_INSERT_HEAD(hd, iblk, ib_next);
 	if (bread(disk, fsbtodb(fs, blk), iblk->ib_buf, fs->fs_bsize) == -1)
-		err(1, "Failed to read inode block %jd", blk);
+		err_suj("Failed to read inode block %jd\n", blk);
 found:
 	sc->sc_lastiblk = iblk;
 	off = ino_to_fsbo(fs, ino);
@@ -447,7 +470,7 @@ iblk_write(struct ino_blk *iblk)
 		return;
 	if (bwrite(disk, fsbtodb(fs, iblk->ib_blk), iblk->ib_buf,
 	    fs->fs_bsize) == -1)
-		err(1, "Failed to write inode block %jd", iblk->ib_blk);
+		err_suj("Failed to write inode block %jd\n", iblk->ib_blk);
 }
 
 static int
@@ -679,9 +702,9 @@ indir_blkatoff(ufs2_daddr_t blk, ino_t i
 		return (0);
 	level = lbn_level(cur);
 	if (level == -1)
-		errx(1, "Invalid indir lbn %jd", lbn);
+		err_suj("Invalid indir lbn %jd\n", lbn);
 	if (level == 0 && lbn < 0)
-		errx(1, "Invalid lbn %jd", lbn);
+		err_suj("Invalid lbn %jd\n", lbn);
 	bap2 = (void *)dblk_read(blk, fs->fs_bsize);
 	bap1 = (void *)bap2;
 	lbnadd = 1;
@@ -693,7 +716,7 @@ indir_blkatoff(ufs2_daddr_t blk, ino_t i
 	else
 		i = (-lbn - base) / lbnadd;
 	if (i < 0 || i >= NINDIR(fs))
-		errx(1, "Invalid indirect index %d produced by lbn %jd",
+		err_suj("Invalid indirect index %d produced by lbn %jd\n",
 		    i, lbn);
 	if (level == 0)
 		cur = base + (i * lbnadd);
@@ -705,10 +728,8 @@ indir_blkatoff(ufs2_daddr_t blk, ino_t i
 		blk = bap2[i];
 	if (cur == lbn)
 		return (blk);
-	if (level == 0) {
-		abort();
-		errx(1, "Invalid lbn %jd at level 0", lbn);
-	}
+	if (level == 0)
+		err_suj("Invalid lbn %jd at level 0\n", lbn);
 	return indir_blkatoff(blk, ino, cur, lbn);
 }
 
@@ -762,7 +783,8 @@ ino_blkatoff(union dinode *ip, ino_t ino
 			continue;
 		return indir_blkatoff(DIP(ip, di_ib[i]), ino, -cur - i, lbn);
 	}
-	errx(1, "lbn %jd not in ino", lbn);
+	err_suj("lbn %jd not in ino\n", lbn);
+	/* NOTREACHED */
 }
 
 /*
@@ -851,7 +873,7 @@ ino_isat(ino_t parent, off_t diroff, ino
 		dpoff += dp->d_reclen;
 	} while (dpoff <= doff);
 	if (dpoff > fs->fs_bsize)
-		errx(1, "Corrupt directory block in dir ino %d", parent);
+		err_suj("Corrupt directory block in dir ino %d\n", parent);
 	/* Not found. */
 	if (dpoff != doff) {
 		if (debug)
@@ -907,7 +929,7 @@ indir_visit(ino_t ino, ufs_lbn_t lbn, uf
 		return;
 	level = lbn_level(lbn);
 	if (level == -1)
-		errx(1, "Invalid level for lbn %jd", lbn);
+		err_suj("Invalid level for lbn %jd\n", lbn);
 	if ((flags & VISIT_ROOT) == 0 && blk_isindir(blk, ino, lbn) == 0) {
 		if (debug)
 			printf("blk %jd ino %d lbn %jd(%d) is not indir.\n",
@@ -1203,7 +1225,7 @@ ino_reclaim(union dinode *ip, ino_t ino,
 	uint32_t gen;
 
 	if (ino == ROOTINO)
-		errx(1, "Attempting to free ROOTINO");
+		err_suj("Attempting to free ROOTINO\n");
 	if (debug)
 		printf("Truncating and freeing ino %d, nlink %d, mode %o\n",
 		    ino, DIP(ip, di_nlink), DIP(ip, di_mode));
@@ -1240,9 +1262,9 @@ ino_decr(ino_t ino)
 	nlink = DIP(ip, di_nlink);
 	mode = DIP(ip, di_mode);
 	if (nlink < 1)
-		errx(1, "Inode %d link count %d invalid", ino, nlink);
+		err_suj("Inode %d link count %d invalid\n", ino, nlink);
 	if (mode == 0)
-		errx(1, "Inode %d has a link of %d with 0 mode.", ino, nlink);
+		err_suj("Inode %d has a link of %d with 0 mode\n", ino, nlink);
 	nlink--;
 	if ((mode & IFMT) == IFDIR)
 		reqlink = 2;
@@ -1300,8 +1322,8 @@ ino_adjust(struct suj_ino *sino)
 	ip = ino_read(ino);
 	mode = DIP(ip, di_mode) & IFMT;
 	if (nlink > LINK_MAX)
-		errx(1,
-		    "ino %d nlink manipulation error, new link %d, old link %d",
+		err_suj(
+		    "ino %d nlink manipulation error, new link %d, old link %d\n",
 		    ino, nlink, DIP(ip, di_nlink));
 	if (debug)
 		printf("Adjusting ino %d, nlink %d, old link %d lastmode %o\n",
@@ -1359,7 +1381,7 @@ indir_trunc(ino_t ino, ufs_lbn_t lbn, uf
 	dirty = 0;
 	level = lbn_level(lbn);
 	if (level == -1)
-		errx(1, "Invalid level for lbn %jd", lbn);
+		err_suj("Invalid level for lbn %jd\n", lbn);
 	lbnadd = 1;
 	for (i = level; i > 0; i--)
 		lbnadd *= NINDIR(fs);
@@ -1488,7 +1510,7 @@ ino_trunc(ino_t ino, off_t size)
 
 		bn = DIP(ip, di_db[visitlbn]);
 		if (bn == 0)
-			errx(1, "Bad blk at ino %d lbn %jd\n", ino, visitlbn);
+			err_suj("Bad blk at ino %d lbn %jd\n", ino, visitlbn);
 		oldspace = sblksize(fs, cursize, visitlbn);
 		newspace = sblksize(fs, size, visitlbn);
 		if (oldspace != newspace) {
@@ -1512,7 +1534,7 @@ ino_trunc(ino_t ino, off_t size)
 
 		bn = ino_blkatoff(ip, ino, visitlbn, &frags);
 		if (bn == 0)
-			errx(1, "Block missing from ino %d at lbn %jd\n",
+			err_suj("Block missing from ino %d at lbn %jd\n",
 			    ino, visitlbn);
 		clrsize = frags * fs->fs_fsize;
 		buf = dblk_read(bn, clrsize);
@@ -1555,7 +1577,7 @@ ino_check(struct suj_ino *sino)
 		isat = ino_isat(rrec->jr_parent, rrec->jr_diroff, 
 		    rrec->jr_ino, &mode, &isdot);
 		if (isat && (mode & IFMT) != (rrec->jr_mode & IFMT))
-			errx(1, "Inode mode/directory type mismatch %o != %o",
+			err_suj("Inode mode/directory type mismatch %o != %o\n",
 			    mode, rrec->jr_mode);
 		if (debug)
 			printf("jrefrec: op %d ino %d, nlink %d, parent %d, "
@@ -1778,7 +1800,7 @@ cg_write(struct suj_cg *sc)
 	fs->fs_cs(fs, sc->sc_cgx) = cgp->cg_cs;
 	if (bwrite(disk, fsbtodb(fs, cgtod(fs, sc->sc_cgx)), sc->sc_cgbuf,
 	    fs->fs_bsize) == -1)
-		err(1, "Unable to write cylinder group %d", sc->sc_cgx);
+		err_suj("Unable to write cylinder group %d\n", sc->sc_cgx);
 }
 
 /*
@@ -1970,6 +1992,7 @@ ino_build_ref(struct suj_ino *sino, stru
 				continue;
 			diroff = mvrec->jm_oldoff;
 			TAILQ_REMOVE(&sino->si_movs, srn, sr_next);
+			free(srn);
 			ino_dup_ref(sino, refrec, diroff);
 		}
 	}
@@ -2026,7 +2049,7 @@ ino_build_ref(struct suj_ino *sino, stru
 			TAILQ_REMOVE(&sino->si_newrecs, srn, sr_next);
 			break;
 		default:
-			errx(1, "ino_build_ref: Unknown op %d",
+			err_suj("ino_build_ref: Unknown op %d\n",
 			    srn->sr_rec->rec_jrefrec.jr_op);
 		}
 	}
@@ -2056,7 +2079,7 @@ ino_build(struct suj_ino *sino)
 			TAILQ_INSERT_TAIL(&sino->si_movs, srec, sr_next);
 			break;
 		default:
-			errx(1, "ino_build: Unknown op %d",
+			err_suj("ino_build: Unknown op %d\n",
 			    srec->sr_rec->rec_jrefrec.jr_op);
 		}
 	}
@@ -2107,7 +2130,7 @@ blk_build(struct jblkrec *blkrec)
 	blkrec->jb_blkno -= frag;
 	blkrec->jb_oldfrags = frag;
 	if (blkrec->jb_oldfrags + blkrec->jb_frags > fs->fs_frag)
-		errx(1, "Invalid fragment count %d oldfrags %d",
+		err_suj("Invalid fragment count %d oldfrags %d\n",
 		    blkrec->jb_frags, frag);
 	/*
 	 * Detect dups.  If we detect a dup we always discard the oldest
@@ -2185,7 +2208,7 @@ suj_build(void)
 				ino_build_trunc((struct jtrncrec *)rec);
 				break;
 			default:
-				errx(1, "Unknown journal operation %d (%d)",
+				err_suj("Unknown journal operation %d (%d)\n",
 				    rec->rec_jrefrec.jr_op, off);
 			}
 			i++;
@@ -2233,9 +2256,10 @@ suj_prune(void)
 		newseq = seg->ss_rec.jsr_seq;
 		
 	}
-	if (newseq != oldseq)
-		errx(1, "Journal file sequence mismatch %jd != %jd",
+	if (newseq != oldseq) {
+		err_suj("Journal file sequence mismatch %jd != %jd\n",
 		    newseq, oldseq);
+	}
 	/*
 	 * The kernel may asynchronously write segments which can create
 	 * gaps in the sequence space.  Throw away any segments after the
@@ -2463,9 +2487,10 @@ restart:
 		/*
 		 * Read 1MB at a time and scan for records within this block.
 		 */
-		if (bread(disk, blk, &block, size) == -1)
-			err(1, "Error reading journal block %jd",
+		if (bread(disk, blk, &block, size) == -1) {
+			err_suj("Error reading journal block %jd\n",
 			    (intmax_t)blk);
+		}
 		for (rec = (void *)block; size; size -= recsize,
 		    rec = (struct jsegrec *)((uintptr_t)rec + recsize)) {
 			recsize = DEV_BSIZE;
@@ -2544,7 +2569,7 @@ suj_find(ino_t ino, ufs_lbn_t lbn, ufs2_
 		return;
 	bytes = lfragtosize(fs, frags);
 	if (bread(disk, fsbtodb(fs, blk), block, bytes) <= 0)
-		err(1, "Failed to read ROOTINO directory block %jd", blk);
+		err_suj("Failed to read ROOTINO directory block %jd\n", blk);
 	for (off = 0; off < bytes; off += dp->d_reclen) {
 		dp = (struct direct *)&block[off];
 		if (dp->d_reclen == 0)
@@ -2569,17 +2594,43 @@ suj_check(const char *filesys)
 	union dinode *jip;
 	union dinode *ip;
 	uint64_t blocks;
+	int retval;
+	struct suj_seg *seg;
+	struct suj_seg *segn;
 
 	opendisk(filesys);
 	TAILQ_INIT(&allsegs);
+
+	/*
+	 * Set an exit point when SUJ check failed
+	 */
+	retval = setjmp(jmpbuf);
+	if (retval != 0) {
+		pwarn("UNEXPECTED SU+J INCONSISTENCY\n");
+		TAILQ_FOREACH_SAFE(seg, &allsegs, ss_next, segn) {
+			TAILQ_REMOVE(&allsegs, seg, ss_next);
+				free(seg->ss_blk);
+				free(seg);
+		}
+		if (reply("FALLBACK TO FULL FSCK") == 0) {
+			ckfini(0);
+			exit(EEXIT);
+		} else
+			return (-1);
+	}
+
 	/*
 	 * Find the journal inode.
 	 */
 	ip = ino_read(ROOTINO);
 	sujino = 0;
 	ino_visit(ip, ROOTINO, suj_find, 0);
-	if (sujino == 0)
-		errx(1, "Journal inode removed.  Use tunefs to re-create.");
+	if (sujino == 0) {
+		printf("Journal inode removed.  Use tunefs to re-create.\n");
+		sblock.fs_flags &= ~FS_SUJ;
+		sblock.fs_sujfree = 0;
+		return (-1);
+	}
 	/*
 	 * Fetch the journal inode and verify it.
 	 */
@@ -2595,8 +2646,10 @@ suj_check(const char *filesys)
 	    DIP(jip, di_size), sujino);
 	suj_jblocks = jblocks_create();
 	blocks = ino_visit(jip, sujino, suj_add_block, 0);
-	if (blocks != numfrags(fs, DIP(jip, di_size)))
-		errx(1, "Sparse journal inode %d.\n", sujino);
+	if (blocks != numfrags(fs, DIP(jip, di_size))) {
+		printf("Sparse journal inode %d.\n", sujino);
+		return (-1);
+	}
 	suj_read();
 	jblocks_destroy(suj_jblocks);
 	suj_jblocks = NULL;
@@ -2612,7 +2665,7 @@ suj_check(const char *filesys)
 		cg_apply(cg_check_blk);
 		cg_apply(cg_check_ino);
 	}
-	if (preen == 0 && reply("WRITE CHANGES") == 0)
+	if (preen == 0 && (jrecs > 0 || jbytes > 0) && reply("WRITE CHANGES") == 0)
 		return (0);
 	/*
 	 * To remain idempotent with partial truncations the free bitmaps
@@ -2625,10 +2678,12 @@ suj_check(const char *filesys)
 	cg_apply(cg_write_inos);
 	/* Write back superblock. */
 	closedisk(filesys);
-	printf("** %jd journal records in %jd bytes for %.2f%% utilization\n",
-	    jrecs, jbytes, ((float)jrecs / (float)(jbytes / JREC_SIZE)) * 100);
-	printf("** Freed %jd inodes (%jd dirs) %jd blocks, and %jd frags.\n",
-	    freeinos, freedir, freeblocks, freefrags);
+	if (jrecs > 0 || jbytes > 0) {
+		printf("** %jd journal records in %jd bytes for %.2f%% utilization\n",
+		    jrecs, jbytes, ((float)jrecs / (float)(jbytes / JREC_SIZE)) * 100);
+		printf("** Freed %jd inodes (%jd dirs) %jd blocks, and %jd frags.\n",
+		    freeinos, freedir, freeblocks, freefrags);
+	}
 
 	return (0);
 }

Modified: user/jmallett/octeon/sbin/fsck_msdosfs/Makefile
==============================================================================
--- user/jmallett/octeon/sbin/fsck_msdosfs/Makefile	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/sbin/fsck_msdosfs/Makefile	Sat Jun 26 03:08:12 2010	(r209528)
@@ -9,6 +9,6 @@ MAN=	fsck_msdosfs.8
 SRCS=	main.c check.c boot.c fat.c dir.c fsutil.c
 
 CFLAGS+= -I${FSCK}
-WARNS?=	0
+WARNS?=	2
 
 .include <bsd.prog.mk>

Modified: user/jmallett/octeon/sbin/fsck_msdosfs/boot.c
==============================================================================
--- user/jmallett/octeon/sbin/fsck_msdosfs/boot.c	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/sbin/fsck_msdosfs/boot.c	Sat Jun 26 03:08:12 2010	(r209528)
@@ -48,13 +48,14 @@ readboot(int dosfs, struct bootblock *bo
 	int ret = FSOK;
 	int i;
 	
-	if ((size_t)read(dosfs, block, sizeof block) != sizeof block) {
+	if (read(dosfs, block, sizeof block) != sizeof block) {
 		perror("could not read boot block");
 		return FSFATAL;
 	}
 
 	if (block[510] != 0x55 || block[511] != 0xaa) {
-		pfatal("Invalid signature in boot block: %02x%02x", block[511], block[510]);
+		pfatal("Invalid signature in boot block: %02x%02x",
+		    block[511], block[510]);
 		return FSFATAL;
 	}
 
@@ -72,8 +73,10 @@ readboot(int dosfs, struct bootblock *bo
 	boot->bpbFATsmall = block[22] + (block[23] << 8);
 	boot->SecPerTrack = block[24] + (block[25] << 8);
 	boot->bpbHeads = block[26] + (block[27] << 8);
-	boot->bpbHiddenSecs = block[28] + (block[29] << 8) + (block[30] << 16) + (block[31] << 24);
-	boot->bpbHugeSectors = block[32] + (block[33] << 8) + (block[34] << 16) + (block[35] << 24);
+	boot->bpbHiddenSecs = block[28] + (block[29] << 8) +
+	    (block[30] << 16) + (block[31] << 24);
+	boot->bpbHugeSectors = block[32] + (block[33] << 8) +
+	    (block[34] << 16) + (block[35] << 24);
 
 	boot->FATsecs = boot->bpbFATsmall;
 
@@ -97,10 +100,9 @@ readboot(int dosfs, struct bootblock *bo
 		boot->bpbFSInfo = block[48] + (block[49] << 8);
 		boot->bpbBackup = block[50] + (block[51] << 8);
 
-		if (lseek(dosfs, boot->bpbFSInfo * boot->bpbBytesPerSec, SEEK_SET)
-		    != boot->bpbFSInfo * boot->bpbBytesPerSec
-		    || read(dosfs, fsinfo, sizeof fsinfo)
-		    != sizeof fsinfo) {
+		if (lseek(dosfs, boot->bpbFSInfo * boot->bpbBytesPerSec,
+		    SEEK_SET) != boot->bpbFSInfo * boot->bpbBytesPerSec
+		    || read(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) {
 			perror("could not read fsinfo block");
 			return FSFATAL;
 		}
@@ -124,7 +126,8 @@ readboot(int dosfs, struct bootblock *bo
 				fsinfo[0x3fc] = fsinfo[0x3fd] = 0;
 				fsinfo[0x3fe] = 0x55;
 				fsinfo[0x3ff] = 0xaa;
-				if (lseek(dosfs, boot->bpbFSInfo * boot->bpbBytesPerSec, SEEK_SET)
+				if (lseek(dosfs, boot->bpbFSInfo *
+				    boot->bpbBytesPerSec, SEEK_SET)
 				    != boot->bpbFSInfo * boot->bpbBytesPerSec
 				    || write(dosfs, fsinfo, sizeof fsinfo)
 				    != sizeof fsinfo) {
@@ -144,7 +147,8 @@ readboot(int dosfs, struct bootblock *bo
 				       + (fsinfo[0x1ef] << 24);
 		}
 
-		if (lseek(dosfs, boot->bpbBackup * boot->bpbBytesPerSec, SEEK_SET)
+		if (lseek(dosfs, boot->bpbBackup * boot->bpbBytesPerSec,
+		    SEEK_SET)
 		    != boot->bpbBackup * boot->bpbBytesPerSec
 		    || read(dosfs, backup, sizeof backup) != sizeof  backup) {
 			perror("could not read backup bootblock");
@@ -172,11 +176,10 @@ readboot(int dosfs, struct bootblock *bo
 		/* Check backup bpbFSInfo?					XXX */
 	}
 
-	boot->ClusterOffset = (boot->bpbRootDirEnts * 32 + boot->bpbBytesPerSec - 1)
-	    / boot->bpbBytesPerSec
-	    + boot->bpbResSectors
-	    + boot->bpbFATs * boot->FATsecs
-	    - CLUST_FIRST * boot->bpbSecPerClust;
+	boot->ClusterOffset = (boot->bpbRootDirEnts * 32 +
+	    boot->bpbBytesPerSec - 1) / boot->bpbBytesPerSec +
+	    boot->bpbResSectors + boot->bpbFATs * boot->FATsecs -
+	    CLUST_FIRST * boot->bpbSecPerClust;
 
 	if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE != 0) {
 		pfatal("Invalid sector size: %u", boot->bpbBytesPerSec);
@@ -191,7 +194,8 @@ readboot(int dosfs, struct bootblock *bo
 		boot->NumSectors = boot->bpbSectors;
 	} else
 		boot->NumSectors = boot->bpbHugeSectors;
-	boot->NumClusters = (boot->NumSectors - boot->ClusterOffset) / boot->bpbSecPerClust;
+	boot->NumClusters = (boot->NumSectors - boot->ClusterOffset) /
+	    boot->bpbSecPerClust;
 
 	if (boot->flags&FAT32)
 		boot->ClustMask = CLUST32_MASK;

Modified: user/jmallett/octeon/sbin/fsck_msdosfs/check.c
==============================================================================
--- user/jmallett/octeon/sbin/fsck_msdosfs/check.c	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/sbin/fsck_msdosfs/check.c	Sat Jun 26 03:08:12 2010	(r209528)
@@ -98,7 +98,7 @@ checkfilesys(const char *fname)
 	}
 
 	if (boot.ValidFat < 0)
-		for (i = 1; i < (int)boot.bpbFATs; i++) {
+		for (i = 1; i < boot.bpbFATs; i++) {
 			struct fatEntry *currentFat;
 
 			mod |= readfat(dosfs, &boot, i, &currentFat);

Modified: user/jmallett/octeon/sbin/fsck_msdosfs/dir.c
==============================================================================
--- user/jmallett/octeon/sbin/fsck_msdosfs/dir.c	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/sbin/fsck_msdosfs/dir.c	Sat Jun 26 03:08:12 2010	(r209528)
@@ -242,7 +242,8 @@ resetDosDirSection(struct bootblock *boo
 
 	memset(rootDir, 0, sizeof *rootDir);
 	if (boot->flags & FAT32) {
-		if (boot->bpbRootClust < CLUST_FIRST || boot->bpbRootClust >= boot->NumClusters) {
+		if (boot->bpbRootClust < CLUST_FIRST ||
+		    boot->bpbRootClust >= boot->NumClusters) {
 			pfatal("Root directory starts with cluster out of range(%u)",
 			       boot->bpbRootClust);
 			return FSFATAL;
@@ -356,7 +357,8 @@ removede(int f, struct bootblock *boot, 
 		pwarn("Invalid long filename entry for %s\n", path);
 		break;
 	case 1:
-		pwarn("Invalid long filename entry at end of directory %s\n", path);
+		pwarn("Invalid long filename entry at end of directory %s\n",
+		    path);
 		break;
 	case 2:
 		pwarn("Invalid long filename entry for volume label\n");
@@ -418,7 +420,8 @@ checksize(struct bootblock *boot, struct
 			cl_t cl;
 			u_int32_t sz = 0;
 
-			for (cl = dir->head; (sz += boot->ClusterSize) < dir->size;)
+			for (cl = dir->head; (sz += boot->ClusterSize) <
+			    dir->size;)
 				cl = fat[cl].next;
 			clearchain(boot, fat, fat[cl].next);
 			fat[cl].next = CLUST_EOF;
@@ -462,7 +465,8 @@ readDosDirSection(int f, struct bootbloc
 	do {
 		if (!(boot->flags & FAT32) && !dir->parent) {
 			last = boot->bpbRootDirEnts * 32;
-			off = boot->bpbResSectors + boot->bpbFATs * boot->FATsecs;
+			off = boot->bpbResSectors + boot->bpbFATs *
+			    boot->FATsecs;
 		} else {
 			last = boot->bpbSecPerClust * boot->bpbBytesPerSec;
 			off = cl * boot->bpbSecPerClust + boot->ClusterOffset;
@@ -547,7 +551,8 @@ readDosDirSection(int f, struct bootbloc
 				}
 				lidx = *p & LRNOMASK;
 				t = longName + --lidx * 13;
-				for (k = 1; k < 11 && t < longName + sizeof(longName); k += 2) {
+				for (k = 1; k < 11 && t < longName +
+				    sizeof(longName); k += 2) {
 					if (!p[k] && !p[k + 1])
 						break;
 					*t++ = p[k];

Modified: user/jmallett/octeon/sbin/fsck_msdosfs/fat.c
==============================================================================
--- user/jmallett/octeon/sbin/fsck_msdosfs/fat.c	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/sbin/fsck_msdosfs/fat.c	Sat Jun 26 03:08:12 2010	(r209528)
@@ -87,7 +87,8 @@ checkdirty(int fs, struct bootblock *boo
 		goto err;
 	}
 
-	if (read(fs, buffer, boot->bpbBytesPerSec) != boot->bpbBytesPerSec) {
+	if ((size_t)read(fs, buffer, boot->bpbBytesPerSec) !=
+	    boot->bpbBytesPerSec) {
 		perror("Unable to read FAT");
 		goto err;
 	}

Modified: user/jmallett/octeon/sbin/geom/class/part/geom_part.c
==============================================================================
--- user/jmallett/octeon/sbin/geom/class/part/geom_part.c	Fri Jun 25 22:35:19 2010	(r209527)
+++ user/jmallett/octeon/sbin/geom/class/part/geom_part.c	Sat Jun 26 03:08:12 2010	(r209528)
@@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$");
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <limits.h>
+#include <inttypes.h>
 #include <string.h>
 #include <strings.h>
 #include <unistd.h>
@@ -60,6 +62,9 @@ static char autofill[] = "*";
 static char optional[] = "";
 static char flags[] = "C";
 
+static char sstart[32];
+static char ssize[32];
+
 static const char const bootcode_param[] = "bootcode";
 static const char const index_param[] = "index";
 static const char const partcode_param[] = "partcode";
@@ -68,8 +73,7 @@ static struct gclass *find_class(struct 
 static struct ggeom * find_geom(struct gclass *, const char *);
 static const char *find_geomcfg(struct ggeom *, const char *);
 static const char *find_provcfg(struct gprovider *, const char *);
-static struct gprovider *find_provider(struct ggeom *,
-    unsigned long long);
+static struct gprovider *find_provider(struct ggeom *, off_t);
 static const char *fmtsize(int64_t);
 static int gpart_autofill(struct gctl_req *);
 static int gpart_autofill_resize(struct gctl_req *);
@@ -84,8 +88,8 @@ static void gpart_write_partcode_vtoc8(s
 
 struct g_command PUBSYM(class_commands)[] = {
 	{ "add", 0, gpart_issue, {
-		{ 'b', "start", autofill, G_TYPE_ASCLBA },
-		{ 's', "size", autofill, G_TYPE_ASCLBA },
+		{ 'b', "start", autofill, G_TYPE_STRING },
+		{ 's', "size", autofill, G_TYPE_STRING },
 		{ 't', "type", NULL, G_TYPE_STRING },
 		{ 'i', index_param, optional, G_TYPE_ASCNUM },
 		{ 'l', "label", optional, G_TYPE_STRING },
@@ -149,7 +153,7 @@ struct g_command PUBSYM(class_commands)[
 	  "geom", NULL
 	},
 	{ "resize", 0, gpart_issue, {
-		{ 's', "size", autofill, G_TYPE_ASCLBA },
+		{ 's', "size", autofill, G_TYPE_STRING },
 		{ 'i', index_param, NULL, G_TYPE_ASCNUM },
 		{ 'f', "flags", flags, G_TYPE_STRING },
 		G_OPT_SENTINEL },
@@ -207,11 +211,11 @@ find_provcfg(struct gprovider *pp, const
 }
 
 static struct gprovider *
-find_provider(struct ggeom *gp, unsigned long long minsector)
+find_provider(struct ggeom *gp, off_t minsector)
 {
 	struct gprovider *pp, *bestpp;
 	const char *s;
-	unsigned long long sector, bestsector;
+	off_t sector, bestsector;
 
 	bestpp = NULL;
 	bestsector = 0;
@@ -219,9 +223,10 @@ find_provider(struct ggeom *gp, unsigned
 		s = find_provcfg(pp, "start");
 		if (s == NULL) {
 			s = find_provcfg(pp, "offset");
-			sector = atoll(s) / pp->lg_sectorsize;
+			sector =
+			    (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize;
 		} else
-			sector = atoll(s);
+			sector = (off_t)strtoimax(s, NULL, 0);
 
 		if (sector < minsector)
 			continue;
@@ -271,18 +276,12 @@ gpart_autofill_resize(struct gctl_req *r
 	struct gclass *cp;
 	struct ggeom *gp;
 	struct gprovider *pp;
-	unsigned long long last, size, start, new_size;
-	unsigned long long lba, new_lba;
+	off_t last, size, start, new_size;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-user mailing list