Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dm Use RUN_ONCE(9) again. (Everyone happy now?)



details:   https://anonhg.NetBSD.org/src/rev/b05933f1eef7
branches:  trunk
changeset: 752466:b05933f1eef7
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sat Feb 27 00:31:57 2010 +0000

description:
Use RUN_ONCE(9) again.  (Everyone happy now?)

diffstat:

 sys/dev/dm/device-mapper.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r 2a8a2a0c9956 -r b05933f1eef7 sys/dev/dm/device-mapper.c
--- a/sys/dev/dm/device-mapper.c        Fri Feb 26 23:52:43 2010 +0000
+++ b/sys/dev/dm/device-mapper.c        Sat Feb 27 00:31:57 2010 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: device-mapper.c,v 1.18 2010/02/26 23:52:43 jakllsch Exp $ */
+/*        $NetBSD: device-mapper.c,v 1.19 2010/02/27 00:31:57 jakllsch Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -46,6 +46,7 @@
 #include <sys/ioccom.h>
 #include <sys/kmem.h>
 #include <sys/module.h>
+#include <sys/once.h>
 
 #include "netbsd-dm.h"
 #include "dm.h"
@@ -62,7 +63,9 @@
 void dmattach(int);
 int dmdestroy(void);
 
+static ONCE_DECL(doinit_control);
 static int doinit(void);
+
 static int dm_cmd_to_fun(prop_dictionary_t);
 static int disk_ioctl_switch(dev_t, u_long, void *);
 static int dm_ioctl_switch(u_long);
@@ -161,7 +164,7 @@
                if (error)
                        break;
 
-               error = doinit();
+               error = RUN_ONCE(&doinit_control, doinit);
                if (error) {
                        config_cfdriver_detach(&dm_cd);
                        break;
@@ -292,7 +295,7 @@
 void
 dmattach(int n)
 {
-       doinit();
+       RUN_ONCE(&doinit_control, doinit);
 }
 
 /* Destroy routine */



Home | Main Index | Thread Index | Old Index