tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: factoring out the change_root() and making exporting change_{root,dir}() as interface
On Wed, Jul 29, 2009 at 04:15:54AM +0000, David Holland wrote:
> On Wed, Jul 29, 2009 at 12:36:37AM +0200, Christoph Badura wrote:
> > - if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
> > + if ((error = fd_getvnode(fd, &fp)) != 0)
> that doesn't look right.
That is actually preceded by
int error, fd = SCARG(uap, fd);
it just fetch SCARG(uap, fd) a second time.
> > -static int
> > +int
> > change_dir(struct nameidata *ndp, struct lwp *l)
> > {
>
> Is it feasible to adjust this to pass a vnode instead of nameidata?
change_dir() actually does the namei() lookup currently.
I suppose it's possible to change the interface by moving a small bit
of common code out of it. But it is convenient as it stands.
The place were I use it, would be the third calling site and it needs to
do the namei(), too. Therefore i didn't change it. I don't care much
either way, though.
--chris
Home |
Main Index |
Thread Index |
Old Index