From owner-cvs-src Fri Feb 14 8:55:47 2003 Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B3C837B401; Fri, 14 Feb 2003 08:55:44 -0800 (PST) Received: from tesla.distributel.net (nat.MTL.distributel.NET [66.38.181.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 643CA43FBD; Fri, 14 Feb 2003 08:55:43 -0800 (PST) (envelope-from bmilekic@unixdaemons.com) Received: (from bmilekic@localhost) by tesla.distributel.net (8.11.6/8.11.6) id h1EGtbI54170; Fri, 14 Feb 2003 11:55:37 -0500 (EST) (envelope-from bmilekic@unixdaemons.com) Date: Fri, 14 Feb 2003 11:55:37 -0500 From: Bosko Milekic To: Bosko Milekic Cc: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern subr_mbuf.c subr_mchain.c Message-ID: <20030214115537.B54113@unixdaemons.com> References: <200302141650.h1EGoDl6052028@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200302141650.h1EGoDl6052028@repoman.freebsd.org>; from bmilekic@FreeBSD.org on Fri, Feb 14, 2003 at 08:50:13AM -0800 Sender: owner-cvs-src@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Feb 14, 2003 at 08:50:13AM -0800, Bosko Milekic wrote: > bmilekic 2003/02/14 08:50:13 PST > > Modified files: > sys/kern subr_mbuf.c subr_mchain.c > Log: > Make m_getm() always return the top of the newly allocated chain, as > opposed to returning the top of the old chain when there was one and > the top of the newly allocated chain if there was no old chain. > > Actually, it should be noted that prior to this fix, although the > comment above m_getm() advertised that m_getm() would return the > top of the old chain (if an old chain was being passed in) it > actually [wrongly] was returning the tail mbuf in the old chain > instead. This is a bug but since the one use of m_getm() in > the tree luckily did not depend on the behavior, it happened > to work out without notice. > > Harti Brandt pointed out that the advertised behavior was actually > not the real behavior and so this change makes m_getm() ALWAYS > return the newly allocated chain (and fixes the comment). This > is less confusing and is the best course of action as then the > caller is always able to have both a reference to the top of > the original chain (because it's passing it in in the call) and > a reference to the newly attached chain. Although the API is > slightly modified, I don't think that any third-party code uses > m_getm() and if it does, it surely can't be working properly > because the old behavior was bogus. > > API bug pointed out by: Harti Brandt P.S.: Harti Brandt is actually a committer, so: Pointed out by: harti Sorry about that. :-) > Revision Changes Path > 1.37 +2 -4 src/sys/kern/subr_mbuf.c > 1.12 +0 -1 src/sys/kern/subr_mchain.c -- Bosko Milekic * bmilekic@unixdaemons.com * bmilekic@FreeBSD.org "If we open a quarrel between the past and the present, we shall find that we have lost the future." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-src" in the body of the message