From owner-svn-src-head@freebsd.org Sat Oct 14 06:33:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCCD8E3EA25; Sat, 14 Oct 2017 06:33:16 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B862A657ED; Sat, 14 Oct 2017 06:33:16 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: by mail-pf0-f179.google.com with SMTP id t188so9493341pfd.10; Fri, 13 Oct 2017 23:33:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=VcaZbJcjay7JIjFtVGFUTdbtp43sKzMaf9hlyzHLXPc=; b=V1Tw4YBgL++KFPUy+pTMQfw30coUQcfthMsj0x/qdBG4xzAt+GtjpL5GL2yHjdLUx7 Ba9uv7fOVEflwO+/oYWH1Lq2Ndx5uM6JRBBk6p/Ra1OeBCKH6kGJpy+DGv54e/tcoTMz IMtHpM7Bkzng2wXZg1oVydU/n44WjaruF4b+5BeXFFBy1lfRSml4+XUAI1ubv/XHpaEn RlSgQJYtci8z/YbDHuhHSibpbzKRsSzHUVQTaEkMXUsJ3fgj2DZpUj+aNNzrRRVjWt2l 78bm7y6eJHkf+2oGYbh9xz36BM2tSb01kLwOSISR0f+Hav2hZIM2rRM39SLDO/bjAqh0 MUxg== X-Gm-Message-State: AMCzsaX4eHJpi99mcQyoSDu8iaaBKQ3YyvUtlOt+JtuGMUxoEwSluGZQ DffW9wrYdw662bXu33VSoRobQkZl X-Google-Smtp-Source: AOwi7QCExboDykYgUlEoHtrZ/QmzooUYm/8WXkhbZrwqRrX4dhbgf7UGQ4sgyZvL7+c7jILfOiI08g== X-Received: by 10.99.111.197 with SMTP id k188mr3175995pgc.344.1507959391308; Fri, 13 Oct 2017 22:36:31 -0700 (PDT) Received: from [192.168.2.122] (174-24-242-218.tukw.qwest.net. [174.24.242.218]) by smtp.gmail.com with ESMTPSA id s83sm4907881pfg.104.2017.10.13.22.36.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 22:36:30 -0700 (PDT) Subject: Re: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710112153.v9BLroeR007323@repo.freebsd.org> <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com> From: Matt Joras Message-ID: Date: Fri, 13 Oct 2017 22:36:26 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 06:33:17 -0000 On 10/13/2017 22:12, Ngie Cooper (yaneurabeya) wrote: >> Modified: head/sys/kern/subr_unit.c >> ============================================================================== >> --- head/sys/kern/subr_unit.c Wed Oct 11 20:36:22 2017 (r324540) >> +++ head/sys/kern/subr_unit.c Wed Oct 11 21:53:50 2017 (r324541) >> @@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh) >> Free(uh); >> } >> >> +void >> +clear_unrhdr(struct unrhdr *uh) >> +{ >> + struct unr *up, *uq; >> + >> + KASSERT(TAILQ_EMPTY(&uh->ppfree), >> + ("unrhdr has postponed item for free")); >> + up = TAILQ_FIRST(&uh->head); >> + while (up != NULL) { > Could this be done with TAILQ_FOREACH_SAFE? > -Ngie Yes but it is arguably inferior to do so. This while loop is theoretically faster since there is no need to individually remove the elements when you intend to delete every element. Matt