Date: Wed, 16 Apr 2008 20:58:32 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Robert Watson <rwatson@freebsd.org> Cc: Roman Divacky <rdivacky@freebsd.org>, Alfred Perlstein <alfred@freebsd.org>, Pawel Jakub Dawidek <pjd@freebsd.org>, freebsd-arch@freebsd.org Subject: Re: final decision about *at syscalls Message-ID: <20080416175832.GX18958@deviant.kiev.zoral.com.ua> In-Reply-To: <20080416184522.F1046@fledge.watson.org> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080416175832.GX18958>