From owner-p4-projects@FreeBSD.ORG Mon Jun 12 21:13:24 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CF37316A473; Mon, 12 Jun 2006 21:13:24 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AAE7D16A41F for ; Mon, 12 Jun 2006 21:13:24 +0000 (UTC) (envelope-from trhodes@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2671C43D5C for ; Mon, 12 Jun 2006 21:13:23 +0000 (GMT) (envelope-from trhodes@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5CLB7pM018640 for ; Mon, 12 Jun 2006 21:11:07 GMT (envelope-from trhodes@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5CLB6iS018637 for perforce@freebsd.org; Mon, 12 Jun 2006 21:11:06 GMT (envelope-from trhodes@freebsd.org) Date: Mon, 12 Jun 2006 21:11:06 GMT Message-Id: <200606122111.k5CLB6iS018637@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to trhodes@freebsd.org using -f From: Tom Rhodes To: Perforce Change Reviews Cc: Subject: PERFORCE change 99081 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jun 2006 21:13:25 -0000 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 #include #include +#include #include #include #include @@ -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)))