diff options
author | msmith <msmith@FreeBSD.org> | 1999-08-21 06:24:40 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1999-08-21 06:24:40 +0000 |
commit | b51f157bff8b959d943b0836a1c57f065b9318d5 (patch) | |
tree | e447ab34080a4d202ed41db3476df31ef1f56a50 /sys/cam/scsi | |
parent | a753b272ec1066c690e1ba83c8780af55e3a6c78 (diff) | |
download | FreeBSD-src-b51f157bff8b959d943b0836a1c57f065b9318d5.zip FreeBSD-src-b51f157bff8b959d943b0836a1c57f065b9318d5.tar.gz |
Implement a new generic mechanism for attaching handler functions to
events, in order to pave the way for removing a number of the ad-hoc
implementations currently in use.
Retire the at_shutdown family of functions and replace them with
new event handler lists.
Rework kern_shutdown.c to take greater advantage of the use of event
handlers.
Reviewed by: green
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index b23a35d..594ca34 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_da.c,v 1.32 1999/08/14 11:40:31 phk Exp $ + * $Id: scsi_da.c,v 1.33 1999/08/15 23:34:40 mjacob Exp $ */ #include "opt_hw_wdog.h" @@ -38,6 +38,7 @@ #include <sys/dkbad.h> #include <sys/disklabel.h> #include <sys/diskslice.h> +#include <sys/eventhandler.h> #include <sys/malloc.h> #include <sys/conf.h> #include <sys/cons.h> @@ -198,7 +199,7 @@ static void daprevent(struct cam_periph *periph, int action); static void dasetgeom(struct cam_periph *periph, struct scsi_read_capacity_data * rdcap); static timeout_t dasendorderedtag; -static void dashutdown(int howto, void *arg); +static void dashutdown(void *arg, int howto); #ifndef DA_DEFAULT_TIMEOUT #define DA_DEFAULT_TIMEOUT 60 /* Timeout in seconds */ @@ -815,7 +816,6 @@ dainit(void) printf("da: Failed to attach master async callback " "due to status 0x%x!\n", status); } else { - int err; /* If we were successfull, register our devsw */ cdevsw_add(&da_cdevsw); @@ -827,9 +827,10 @@ dainit(void) timeout(dasendorderedtag, NULL, (DA_DEFAULT_TIMEOUT * hz) / DA_ORDEREDTAG_INTERVAL); - if ((err = at_shutdown(dashutdown, NULL, - SHUTDOWN_POST_SYNC)) != 0) - printf("dainit: at_shutdown returned %d!\n", err); + /* Register our shutdown event handler */ + if ((EVENTHANDLER_REGISTER(shutdown_post_sync, dashutdown, + NULL, SHUTDOWN_PRI_DEFAULT)) == NULL) + printf("dainit: shutdown event registration failed!\n"); } } @@ -1553,7 +1554,7 @@ dasendorderedtag(void *arg) * sync the disk cache to physical media. */ static void -dashutdown(int howto, void *arg) +dashutdown(void * arg, int howto) { struct cam_periph *periph; struct da_softc *softc; |