home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17487 < prev    next >
Encoding:
Text File  |  1992-12-18  |  3.0 KB  |  70 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!jato!jdickson
  3. From: jdickson@jato.jpl.nasa.gov (Jeff Dickson)
  4. Subject: Re: A few Handler/FileSys Q's (Mod.Long.)
  5. Message-ID: <1992Dec17.220150.23832@jato.jpl.nasa.gov>
  6. Keywords: handler filesystem packets Amiga DOS AmigaDOS lock FileLock
  7. Organization: Jet Propulsion Laboratory
  8. References: <1992Dec17.051905.1@economics.adelaide.edu.au>
  9. Date: Thu, 17 Dec 1992 22:01:50 GMT
  10. Lines: 58
  11.  
  12. In article <1992Dec17.051905.1@economics.adelaide.edu.au> djung@economics.adelaide.edu.au (David Jung) writes:
  13. >I am in the process (well beginning anyway) of writing a filesystem.  I have a
  14. >few questions.
  15. >
  16. >First here's what I have discovered ... a scenario ...
  17. >
  18. >(to carry this out you need two floppy drives and a disk with a moderately
  19. >long text file)
  20. >
  21. >If I place a disk containing a text file into one drive - say df0, then open
  22. >up a shell and type 'cd more' & 'more file' the file is displayed and the
  23. >more program obtains a lock on the file (and the root dir incidently).
  24. >
  25. >If I then remove the disk - the locks the FFS filesystem issued to More
  26. >appear on the dol_LockList of the disk's volume node in the DosList.
  27. >
  28. >If I then open a second shell and type 'ls diskname:' (where diskname: is the
  29. >disk I just ejected) - I get the usual "please insert volume diskname in any
  30. >drive".  This is because DOS has discovered the volume node's dol_Task is NULL.
  31. >
  32. >OK - so far so good.
  33. >
  34. >Cancel the requester.  Now - with the disk still ejected - press the space bar
  35. >in the more window until more runs out of buffered file and has to read more
  36. >from the disk.  Now I get a "Please insert volume diskname in device df0:".
  37. >(Note this also happens if the disk has been inserted into the other drive!!)
  38. >(i.e. is wants me to remove it from df1 and insert it into df0!)
  39.  
  40. Locks cannot be used accross file systems as I would imagine applies to other
  41. objects as well (e.g. filehandles). DF0: and DF1: are distinct FS. 
  42.  
  43. >
  44. >Note that it wants df0 not any drive.  I ASSUME the following has happened.
  45. >
  46. >More has asked DOS to read more of the file, and DOS has used the FileLock's
  47. >fl_Task field to decide which handler to send the packet to. (only place
  48. >it can get it from since the volume node's dol_Task is NULL).
  49.  
  50. The file handle itself contains the address of the handler message port in 
  51. the field fh_Port or fh_Type. I had read somewhere that the meaning of these
  52. two fields were reversed. I think it was the article by John Tobes which
  53. appeared in the long since defunct Transactor magazine. 
  54.  
  55. >
  56. >The handler has recieved a packet containing a lock that it is no longer
  57. >managing (no matching key or whatever) - and has put up the requester asking
  58. >for the volume.  My questions are (finally)
  59.  
  60. MORE would simply issue another ACTION_READ DOS packet. The file handle
  61. contains the address of the handler message port. MORE would have only
  62. obtained a lock on the file to ensure its existance and find out how large
  63. it was. 
  64.  
  65. Hope this helps.
  66.  
  67. Jeff
  68.  
  69.  
  70.