PERFORCE change 101590 for review

John Baldwin jhb at FreeBSD.org
Fri Jul 14 19:52:48 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=101590

Change 101590 by jhb at jhb_mutex on 2006/07/14 19:52:30

	Use TAILQ_HEAD_INITIALIZER() to avoid pain.

Affected files ...

.. //depot/projects/smpng/sys/dev/streams/streams.c#23 edit

Differences ...

==== //depot/projects/smpng/sys/dev/streams/streams.c#23 (text+ko) ====

@@ -68,11 +68,8 @@
 static int svr4_ptm_alloc(struct thread *);
 static  d_open_t	streamsopen;
 
-struct svr4_sockcache_head svr4_head;
+struct svr4_sockcache_head svr4_head = TAILQ_HEAD_INITIALIZER(svr4_head);
 
-/* Initialization flag (set/queried by svr4_mod LKM) */
-int svr4_str_initialized = 0;
-
 /*
  * Device minor numbers
  */
@@ -390,14 +387,6 @@
 	struct svr4_sockcache_entry *e;
 	void *cookie = ((struct socket *)fp->f_data)->so_emuldata;
 
-	while (svr4_str_initialized != 2) {
-		if (atomic_cmpset_acq_int(&svr4_str_initialized, 0, 1)) {
-			TAILQ_INIT(&svr4_head);
-			atomic_store_rel_int(&svr4_str_initialized, 2);
-		}
-		return;
-	}
-
 	TAILQ_FOREACH(e, &svr4_head, entries)
 		if (e->p == p && e->cookie == cookie) {
 			TAILQ_REMOVE(&svr4_head, e, entries);


More information about the p4-projects mailing list