[TUHS] V6 UNIX main() oddness
clemc at ccc.com
Fri Jan 26 05:41:16 AEST 2018
Seems reasonable to me give the code path and time its being called. Maybe
left over from hacking from an earlier kernel requirement and never noticed
by Ken. I wonder if the mount table had been set up in some earlier scheme
and he wanted to make sure it was checked first. That's the only thing
that seems logical, but we all miss optimizations.
On Thu, Jan 25, 2018 at 1:42 PM, Noel Chiappa <jnc at mercury.lcs.mit.edu>
> So, while bringing up V6 on a hardware PDP-11/23 with an RK11 emulator
> an SD card for storage which Dave Bridgham and I are doing, I found this
> of code in main() on V6 Unix:
> rootdir = iget(rootdev, ROOTINO);
> rootdir->i_flag =& ~ILOCK;
> u.u_cdir = iget(rootdev, ROOTINO);
> u.u_cdir->i_flag =& ~ILOCK;
> I don't get why two separate calls to iget(), with the same arguments;
> why not replace the second pair of lines with:
> u.u_cdir = rootdir;
> What am I missing?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the TUHS