From owner-cvs-all@FreeBSD.ORG Mon Feb 25 11:29:36 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C04C916A403; Mon, 25 Feb 2008 11:29:36 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 7286D13C4D1; Mon, 25 Feb 2008 11:29:36 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 04A132088; Mon, 25 Feb 2008 12:29:29 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.3/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 5EBFA2084; Mon, 25 Feb 2008 12:29:27 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Kris Kennaway References: <200802250855.m1P8t3w6052042@repoman.freebsd.org> <47C29A07.2070908@FreeBSD.org> Date: Mon, 25 Feb 2008 12:29:26 +0100 In-Reply-To: <47C29A07.2070908@FreeBSD.org> (Kris Kennaway's message of "Mon\, 25 Feb 2008 11\:35\:51 +0100") Message-ID: <86d4qli8a1.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, "David E. O'Brien" Subject: Re: cvs commit: src/sys/fs/nullfs null_vfsops.c src/sys/fs/nwfs nwfs_vfsops.c src/sys/fs/smbfs smbfs_vfsops.c src/sys/ufs/ufs quota.h ufs_quota.c ufs_vfsops.c src/sys/kern vfs_default.c vfs_vnops.c vnode_if.src src/sys/sys mount.h vnode.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2008 11:29:36 -0000 Kris Kennaway writes: > David E. O'Brien writes: > > [...] > > MFC: Eradicate caddr_t from the VFS API. > Does this change the KAPI on a stable branch? No, it changes neither the API nor the ABI. It replaces caddr_t (which is typedef'd to char *) with void *, and those two are compatible types. The following program demonstrates this: #include void *f1(void *arg) { return arg; } caddr_t f2(caddr_t arg) { return arg; } int main(void) { caddr_t ca; void *vp; ca =3D f1(ca); ca =3D f1(vp); vp =3D= f2(ca); vp =3D f2(vp); return 0; } Compile it with 'cc -Wall -Wextra -pedantic -o /dev/null caddr_t.c' The program tests both passing a caddr_t in to a function that expects void * and returning a void * to a caller that expects caddr_t, which are two of the three cases that might break (for completeness, it also tests the reverse, which isn't actually relevant here). The third case, which the program doesn't test, is the case where the type of a member of a struct that is exposed through the API changes; that would indeed change the API, because the caller might want to perform pointer arithmetic on that member. However, the patch does none of these things. It only changes internal use of caddr_t, and the type of some API function arguments - no return types, no structure members - so it's completely safe. To tell you the truth, I'm surprised this wasn't MFCed earlier... Thanks, David :) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no