Date: Mon, 12 Jun 2006 21:11:06 GMT From: Tom Rhodes <trhodes@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 99081 for review Message-ID: <200606122111.k5CLB6iS018637@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=99081 Change 99081 by trhodes@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)))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606122111.k5CLB6iS018637>