From owner-p4-projects@FreeBSD.ORG Fri Jul 14 19:52:48 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 61FE716A4DE; Fri, 14 Jul 2006 19:52:48 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B3A616A4DA for ; Fri, 14 Jul 2006 19:52:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A20B43D45 for ; Fri, 14 Jul 2006 19:52:48 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6EJql05029832 for ; Fri, 14 Jul 2006 19:52:47 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6EJqlSJ029829 for perforce@freebsd.org; Fri, 14 Jul 2006 19:52:47 GMT (envelope-from jhb@freebsd.org) Date: Fri, 14 Jul 2006 19:52:47 GMT Message-Id: <200607141952.k6EJqlSJ029829@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 101590 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2006 19:52:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=101590 Change 101590 by jhb@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);