Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Add an FSILENT flag and use it to suppress "Medium Not P...
details: https://anonhg.NetBSD.org/src/rev/0ac095b1d31c
branches: trunk
changeset: 767782:0ac095b1d31c
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Jul 30 12:08:36 2011 +0000
description:
Add an FSILENT flag and use it to suppress "Medium Not Present" scsipi
spam when trying to access offline drives at boot.
diffstat:
sys/dev/dkwedge/dk.c | 6 +++---
sys/dev/raidframe/rf_netbsdkintf.c | 6 +++---
sys/dev/scsipi/sd.c | 8 ++++----
sys/kern/subr_disk_open.c | 6 +++---
sys/sys/fcntl.h | 3 ++-
5 files changed, 15 insertions(+), 14 deletions(-)
diffs (134 lines):
diff -r 02290a0538c5 -r 0ac095b1d31c sys/dev/dkwedge/dk.c
--- a/sys/dev/dkwedge/dk.c Sat Jul 30 11:18:23 2011 +0000
+++ b/sys/dev/dkwedge/dk.c Sat Jul 30 12:08:36 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dk.c,v 1.61 2011/06/12 03:35:52 rmind Exp $ */
+/* $NetBSD: dk.c,v 1.62 2011/07/30 12:08:36 jmcneill Exp $ */
/*-
* Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.61 2011/06/12 03:35:52 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.62 2011/07/30 12:08:36 jmcneill Exp $");
#ifdef _KERNEL_OPT
#include "opt_dkwedge.h"
@@ -899,7 +899,7 @@
goto out;
}
- error = VOP_OPEN(vp, FREAD, NOCRED);
+ error = VOP_OPEN(vp, FREAD | FSILENT, NOCRED);
if (error) {
aprint_error("%s: unable to open device, error = %d\n",
pdk->dk_name, error);
diff -r 02290a0538c5 -r 0ac095b1d31c sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c Sat Jul 30 11:18:23 2011 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c Sat Jul 30 12:08:36 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.292 2011/07/29 19:55:50 oster Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.293 2011/07/30 12:08:36 jmcneill Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.292 2011/07/29 19:55:50 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.293 2011/07/30 12:08:36 jmcneill Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -3044,7 +3044,7 @@
if (bdevvp(dev, &vp))
panic("RAID can't alloc vnode");
- error = VOP_OPEN(vp, FREAD, NOCRED);
+ error = VOP_OPEN(vp, FREAD | FSILENT, NOCRED);
if (error) {
/* "Who cares." Continue looking
diff -r 02290a0538c5 -r 0ac095b1d31c sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c Sat Jul 30 11:18:23 2011 +0000
+++ b/sys/dev/scsipi/sd.c Sat Jul 30 12:08:36 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sd.c,v 1.293 2010/04/14 22:26:33 jakllsch Exp $ */
+/* $NetBSD: sd.c,v 1.294 2011/07/30 12:08:37 jmcneill Exp $ */
/*-
* Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.293 2010/04/14 22:26:33 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.294 2011/07/30 12:08:37 jmcneill Exp $");
#include "opt_scsi.h"
#include "rnd.h"
@@ -439,7 +439,7 @@
} else {
int silent;
- if (part == RAW_PART && fmt == S_IFCHR)
+ if ((part == RAW_PART && fmt == S_IFCHR) || (flag & FSILENT))
silent = XS_CTL_SILENT;
else
silent = 0;
@@ -471,7 +471,7 @@
}
}
if (error) {
- if (silent)
+ if (silent && (flag & FSILENT) == 0)
goto out;
goto bad2;
}
diff -r 02290a0538c5 -r 0ac095b1d31c sys/kern/subr_disk_open.c
--- a/sys/kern/subr_disk_open.c Sat Jul 30 11:18:23 2011 +0000
+++ b/sys/kern/subr_disk_open.c Sat Jul 30 12:08:36 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_disk_open.c,v 1.2 2010/01/30 11:57:17 mlelstv Exp $ */
+/* $NetBSD: subr_disk_open.c,v 1.3 2011/07/30 12:08:36 jmcneill Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk_open.c,v 1.2 2010/01/30 11:57:17 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk_open.c,v 1.3 2011/07/30 12:08:36 jmcneill Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -63,7 +63,7 @@
if (bdevvp(dev, &tmpvn))
panic("%s: can't alloc vnode for %s", __func__,
device_xname(dv));
- error = VOP_OPEN(tmpvn, FREAD, NOCRED);
+ error = VOP_OPEN(tmpvn, FREAD | FSILENT, NOCRED);
if (error) {
#ifndef DEBUG
/*
diff -r 02290a0538c5 -r 0ac095b1d31c sys/sys/fcntl.h
--- a/sys/sys/fcntl.h Sat Jul 30 11:18:23 2011 +0000
+++ b/sys/sys/fcntl.h Sat Jul 30 12:08:36 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fcntl.h,v 1.38 2011/06/26 16:43:12 christos Exp $ */
+/* $NetBSD: fcntl.h,v 1.39 2011/07/30 12:08:36 jmcneill Exp $ */
/*-
* Copyright (c) 1983, 1990, 1993
@@ -130,6 +130,7 @@
#define FDEFER 0x00002000 /* defer for next gc pass */
#define FHASLOCK 0x00004000 /* descriptor holds advisory lock */
#define FSCAN 0x00100000 /* scan during gc passes */
+#define FSILENT 0x40000000 /* suppress kernel error messages */
#define FKIOCTL 0x80000000 /* kernel originated ioctl */
/* bits settable by fcntl(F_SETFL, ...) */
#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FDSYNC|FRSYNC|FALTIO|\
Home |
Main Index |
Thread Index |
Old Index