diff options
| author | jmcneill <jmcneill@NetBSD.org> | 2011-07-30 12:08:36 +0000 |
|---|---|---|
| committer | jmcneill <jmcneill@NetBSD.org> | 2011-07-30 12:08:36 +0000 |
| commit | 129a8e390fb720f4d1e12fb15989e0525ce05f6f (patch) | |
| tree | b77335444848d81fa9389c422552b1db7003d77c /sys/dev | |
| parent | c3da1e641391efed33032b31481eb2f2aae7e996 (diff) | |
Add an FSILENT flag and use it to suppress "Medium Not Present" scsipi
spam when trying to access offline drives at boot.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/dkwedge/dk.c | 6 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 6 | ||||
| -rw-r--r-- | sys/dev/scsipi/sd.c | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/dkwedge/dk.c b/sys/dev/dkwedge/dk.c index bb7d27d511a..92a908c1752 100644 --- a/sys/dev/dkwedge/dk.c +++ b/sys/dev/dkwedge/dk.c @@ -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 @@ dkwedge_discover(struct disk *pdk) 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 --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 6ea923de366..353b03f5e86 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -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 @@ rf_find_raid_components(void) 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 --git a/sys/dev/scsipi/sd.c b/sys/dev/scsipi/sd.c index 0909f87804d..88b78fabb03 100644 --- a/sys/dev/scsipi/sd.c +++ b/sys/dev/scsipi/sd.c @@ -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 @@ sdopen(dev_t dev, int flag, int fmt, struct lwp *l) } 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 @@ sdopen(dev_t dev, int flag, int fmt, struct lwp *l) } } if (error) { - if (silent) + if (silent && (flag & FSILENT) == 0) goto out; goto bad2; } |
