PERFORCE change 99081 for review

Tom Rhodes trhodes at FreeBSD.org
Mon Jun 12 21:13:25 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=99081

Change 99081 by trhodes at trhodes_local on 2006/06/12 21:10:06

	Add a new function, vfs_oeaction() to wrap around calls to
	panic() in file systems.

Affected files ...

.. //depot/projects/trhodesbsd/src/sys/kern/vfs_mount.c#2 edit
.. //depot/projects/trhodesbsd/src/sys/sys/mount.h#2 edit

Differences ...

==== //depot/projects/trhodesbsd/src/sys/kern/vfs_mount.c#2 (text+ko) ====

@@ -42,6 +42,7 @@
 #include <sys/jail.h>
 #include <sys/kernel.h>
 #include <sys/libkern.h>
+#include <sys/syslog.h>
 #include <sys/mac.h>
 #include <sys/malloc.h>
 #include <sys/mount.h>
@@ -141,6 +142,8 @@
 	"suid",
 	"exec",
 	"update",
+	"oepanic",
+	"oerdonly",
 	NULL
 };
 
@@ -2111,3 +2114,15 @@
 	error = kernel_mount(ma, flags);
 	return (error);
 }
+
+void
+vfs_oeaction(struct mount *vmount, char *message)
+{
+
+	if (vfs_flagopt(vmount->mnt_opt, "oerdonly", NULL, 0)) {
+	    printf("%s: Setting filesystem to read-only\n", message);
+	      vmount->mnt_flag &=MNT_RDONLY;
+		log(LOG_ALERT, "%s\n", message);
+	} else
+	    panic(message);
+}

==== //depot/projects/trhodesbsd/src/sys/sys/mount.h#2 (text+ko) ====

@@ -181,6 +181,8 @@
 struct vnode *__mnt_vnode_first(struct vnode **mvp, struct mount *mp);
 void          __mnt_vnode_markerfree(struct vnode **mvp, struct mount *mp);
 
+void vfs_oeaction(struct mount *, char *);
+
 #define MNT_VNODE_FOREACH(vp, mp, mvp) \
 	for (vp = __mnt_vnode_first(&(mvp), (mp)); \
 		(vp) != NULL; vp = __mnt_vnode_next(&(mvp), (mp)))


More information about the p4-projects mailing list