Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!rice!uw-beaver!mit-eddie!snorkelwacker.mit.edu!usc!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!mcnc!ncsuvx!news From: kdarling@hobbes.ncsu.edu (Kevin Darling) Newsgroups: comp.os.os9 Subject: Re: GIME & IRQ Message-ID: <1991Jan31.194258.5796@ncsuvx.ncsu.edu> Date: 31 Jan 91 19:42:58 GMT References: <1991Jan27.011002.21385@lsuc.on.ca> <1991Jan28.023048.24497@ncsuvx.ncsu.edu> <1991Jan30.090914.11090@tkou02.enet.dec.com> Sender: news@ncsuvx.ncsu.edu (USENET News System) Distribution: na Organization: NCSU Computing Center Lines: 44 zambotti@wpowz.enet.dec.com (Walter Zambotti DEC) writes: > p.s. Quick question : > It seems that the PD does not store the full name of that path if it is a > block device file name! > How does OS9 know when multiple processes open the same file (in order > to keep track of file sharing and byte range locking)? You ask tough questions! ;-) Short answer: it knows because the File Descriptor sector is the same. If same FD, then must be same file! Each RBF Path Descriptor contains the FD LSN (or FD disk byte offset in the case of OSK) for that file. (FD pointers are also used whenever you do a "chx" or "chd"... the name isn't stored, only a pointer to the FD for that directory. Which is why if you swap disks, you may need to "chd/x" again.) Longer answer with details: RBF keeps a linked list of open files; this list begins in the static storage for each drive. So for each open _file_, RBF can check if anyone is already using it. This PD list is sorted by their FD offsets. Now when more than one _path_ is opened to the same file, that new path is added to another linked list based on any previous path to that file. Example: let's say there were paths open to "/d0/startup", "/d0/src/bob.a", and yet another path to "/d0/startup". The links are: /d0 table ===> Path Desc 1 ===> Path Desc 1 ===> none to "startup" to "src/bob.a" /\ || \/ Path Desc 2 to "startup" (more paths would go below \/) So if you did an I$Read from the second path to "startup", RBF could easily use just that path's linked list to check on the locking variables used by it and the other open path(s) to that same file... instead of searching all PDs using that disk. Mind you, I'm no expert on RBF internals. I suspect that only a handful of people are! best - kevin