From owner-freebsd-arch@FreeBSD.ORG Wed Apr 16 17:58:38 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E7BA106564A; Wed, 16 Apr 2008 17:58:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay03.kiev.sovam.com (relay03.kiev.sovam.com [62.64.120.201]) by mx1.freebsd.org (Postfix) with ESMTP id BB0AE8FC1E; Wed, 16 Apr 2008 17:58:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay03.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JmBtz-000Aw6-Rl; Wed, 16 Apr 2008 20:58:36 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3GHwdaH003781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Apr 2008 20:58:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3GHwWmC056261; Wed, 16 Apr 2008 20:58:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m3GHwWiv056260; Wed, 16 Apr 2008 20:58:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 16 Apr 2008 20:58:32 +0300 From: Kostik Belousov To: Robert Watson Message-ID: <20080416175832.GX18958@deviant.kiev.zoral.com.ua> References: <20071218092222.GA9695@freebsd.org> <200712201138.56423.jhb@freebsd.org> <20080412112019.GI45299@garage.freebsd.pl> <200804161014.41025.jhb@freebsd.org> <20080416165612.GA31094@garage.freebsd.pl> <20080416170341.GN95731@elvis.mu.org> <20080416184522.F1046@fledge.watson.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aJDJANv8BPX70wwH" Content-Disposition: inline In-Reply-To: <20080416184522.F1046@fledge.watson.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua X-Scanner-Signature: ca614d1e091d53a46adb2ef7a730c6a6 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2646 [Apr 16 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release Cc: Roman Divacky , Alfred Perlstein , Pawel Jakub Dawidek , freebsd-arch@freebsd.org Subject: Re: final decision about *at syscalls X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2008 17:58:38 -0000 --aJDJANv8BPX70wwH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 16, 2008 at 06:52:12PM +0100, Robert Watson wrote: >=20 > On Wed, 16 Apr 2008, Alfred Perlstein wrote: >=20 > >>File descriptor proposal works like this: > >> > >>userland > >> openat(fd, path) > >>kernel > >> NDINIT_AT(&vp, path, fd); > >> /* operate on vp */ > >> > >>Vnode proposal works this way: > >> > >>userland > >> openat(fd, path) > >>kernel > >> dvp =3D file_descriptor_to_vnode(fd); > >> NDINIT_AT(&vp, path, dvp); > >> /* operate on vp */ > > > >My first impression is that passing fp to vp code is a layering > >violation and bad news. I need to think about it more. >=20 > NDINIT() is already aware of the file descriptor array because it uses th= at=20 > to get the current working and root directories. And what the *at() syst= em=20 > calls are effectively doing is substituting another directory for the=20 > current working directory. The exact expression of all this doesn't matt= er=20 > all that much to me, but I think evaluating the file descriptor array for= =20 > directory stuff all in one place, rather than spread over the caller and= =20 > NDINIT(), is cleaner and avoids a lot of code everywhere. Nothing says y= ou=20 > can't have: >=20 > void > NDINIT(struct nameidata *ndp, u_long op, u_long flags, > enum uio_seg segflg, const char *namep, struct thread *td); >=20 > void > NDINIT_AT(struct nameidata *ndp, u_long op, u_long flags, > enum uio_seg segflg, const char *namep, int fd, struct thread *t= d); >=20 > NDINIT_DVP(struct nameidata *ndp, u_long op, u_long flags, > enum uio_seg segflg, const char *namep, struct vnode *vp, > struct thread *td); >=20 > However, I think I wouldn't want NDINIT_AT() to be a wrapper for=20 > NDINIT_DVP(), because I'd like all that fdp following to occur together. I already mailed the patch implementing all the above, modulo s/_DVP/_ATVP/. I want to get the response from Pawel and others. If positive, the patch is to be tested and committed. I see no reason for heating the debate. --aJDJANv8BPX70wwH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkgGPkcACgkQC3+MBN1Mb4jCngCgl4uSoRlhEnCTsC5FagUNKVlN 78EAnibPH/Vh0KEr8RcOlhkikMkQqZ6k =WFdv -----END PGP SIGNATURE----- --aJDJANv8BPX70wwH--