Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/scsipi Move setting of scsi_verbose_loaded flag into...
details: https://anonhg.NetBSD.org/src/rev/dbddd26cb0b0
branches: trunk
changeset: 756586:dbddd26cb0b0
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Sun Jul 25 13:49:58 2010 +0000
description:
Move setting of scsi_verbose_loaded flag into the module's init routine.
This ensures that the flag is set even if the module was manually loaded
by the user rather than just auto-loaded.
diffstat:
sys/dev/scsipi/scsipi_verbose.c | 5 +++--
sys/dev/scsipi/scsipiconf.c | 16 +++++++---------
2 files changed, 10 insertions(+), 11 deletions(-)
diffs (63 lines):
diff -r e264fc133acf -r dbddd26cb0b0 sys/dev/scsipi/scsipi_verbose.c
--- a/sys/dev/scsipi/scsipi_verbose.c Sun Jul 25 13:19:27 2010 +0000
+++ b/sys/dev/scsipi/scsipi_verbose.c Sun Jul 25 13:49:58 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scsipi_verbose.c,v 1.31 2010/06/07 01:41:39 pgoyette Exp $ */
+/* $NetBSD: scsipi_verbose.c,v 1.32 2010/07/25 13:49:58 pgoyette Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsipi_verbose.c,v 1.31 2010/06/07 01:41:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_verbose.c,v 1.32 2010/07/25 13:49:58 pgoyette Exp $");
#include <sys/param.h>
#include <sys/time.h>
@@ -615,6 +615,7 @@
saved_print_sense_data = scsipi_print_sense_data;
scsipi_print_sense = scsipi_print_sense_real;
scsipi_print_sense_data = scsipi_print_sense_data_real;
+ scsi_verbose_loaded = 1;
return 0;
case MODULE_CMD_FINI:
scsipi_print_sense = saved_print_sense;
diff -r e264fc133acf -r dbddd26cb0b0 sys/dev/scsipi/scsipiconf.c
--- a/sys/dev/scsipi/scsipiconf.c Sun Jul 25 13:19:27 2010 +0000
+++ b/sys/dev/scsipi/scsipiconf.c Sun Jul 25 13:49:58 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scsipiconf.c,v 1.38 2010/06/07 01:41:39 pgoyette Exp $ */
+/* $NetBSD: scsipiconf.c,v 1.39 2010/07/25 13:49:58 pgoyette Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsipiconf.c,v 1.38 2010/06/07 01:41:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipiconf.c,v 1.39 2010/07/25 13:49:58 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -107,13 +107,11 @@
void
scsipi_load_verbose(void)
{
- if (scsi_verbose_loaded)
- return;
-
- mutex_enter(&module_lock);
- if (module_autoload("scsiverbose", MODULE_CLASS_MISC) == 0)
- scsi_verbose_loaded++;
- mutex_exit(&module_lock);
+ if (scsi_verbose_loaded == 0) {
+ mutex_enter(&module_lock);
+ module_autoload("scsiverbose", MODULE_CLASS_MISC);
+ mutex_exit(&module_lock);
+ }
}
/*
Home |
Main Index |
Thread Index |
Old Index