home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17438 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  4.0 KB

  1. Path: sparky!uunet!munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!economics.adelaide.edu.au!djung
  2. From: djung@economics.adelaide.edu.au (David Jung)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: A few Handler/FileSys Q's (Mod.Long.)
  5. Date: 17 Dec 92 05:19:05 ACST
  6. Organization: Economics, University of Adelaide
  7. Lines: 77
  8. Message-ID: <1992Dec17.051905.1@economics.adelaide.edu.au>
  9. NNTP-Posting-Host: eco.economics.adelaide.edu.au
  10. Keywords: handler filesystem packets Amiga DOS AmigaDOS lock FileLock
  11.  
  12. I am in the process (well beginning anyway) of writing a filesystem.  I have a
  13. few questions.
  14.  
  15. First here's what I have discovered ... a scenario ...
  16.  
  17. (to carry this out you need two floppy drives and a disk with a moderately
  18. long text file)
  19.  
  20. If I place a disk containing a text file into one drive - say df0, then open
  21. up a shell and type 'cd more' & 'more file' the file is displayed and the
  22. more program obtains a lock on the file (and the root dir incidently).
  23.  
  24. If I then remove the disk - the locks the FFS filesystem issued to More
  25. appear on the dol_LockList of the disk's volume node in the DosList.
  26.  
  27. If I then open a second shell and type 'ls diskname:' (where diskname: is the
  28. disk I just ejected) - I get the usual "please insert volume diskname in any
  29. drive".  This is because DOS has discovered the volume node's dol_Task is NULL.
  30.  
  31. OK - so far so good.
  32.  
  33. Cancel the requester.  Now - with the disk still ejected - press the space bar
  34. in the more window until more runs out of buffered file and has to read more
  35. from the disk.  Now I get a "Please insert volume diskname in device df0:".
  36. (Note this also happens if the disk has been inserted into the other drive!!)
  37. (i.e. is wants me to remove it from df1 and insert it into df0!)
  38.  
  39. Note that it wants df0 not any drive.  I ASSUME the following has happened.
  40.  
  41. More has asked DOS to read more of the file, and DOS has used the FileLock's
  42. fl_Task field to decide which handler to send the packet to. (only place
  43. it can get it from since the volume node's dol_Task is NULL).
  44.  
  45. The handler has recieved a packet containing a lock that it is no longer
  46. managing (no matching key or whatever) - and has put up the requester asking
  47. for the volume.  My questions are (finally)
  48.  
  49. 1) How can it do this??
  50.  
  51. If it called AutoRequest() or ErrorReport() it would be tied up - but it
  52. still appears to be accepting packets.  If you repeat this whole thing but
  53. bring up two more windows, then after getting a requester from pressing space
  54. in the first more window - if you press space in the second window a second
  55. identical requester appears.  if my ASSUMPTION is correct - the handler has
  56. received another packet and done the same thing.
  57.  
  58. I looked at the task list - nothing is creating extra tasks specifically to
  59. bring up requesters.
  60.  
  61.  
  62. 2) Is it legal, as a filesystem, to set the FileLock's fl_Task fields to
  63. NULL before putting them on the dol_LockList when a volume has been removed?
  64. Or is this rubbish. (wishfully thinking DOS might put up a requester for me)
  65.  
  66. 3) As a filesystem, if a volume has just been inserted into the device you're
  67. managing, and you grab the locks from the dol_LockList, can you Forbid(), go
  68. through and change the fl_Task field of all the locks to yourself, then Permit()
  69. so that any further use of the active FileLocks will be directed to you?
  70.  
  71.  
  72. 4) If, again as a filesystem, I get an argument FileLock for a volume I am
  73. no longer managing (volume was ejected from my device), can I, upon inspection
  74. of the DosList finding a non-NULL dol_Task field, send the packet onto
  75. the other filesystem that is managing the volume now (assuming the dol_Task
  76. field is non-NULL because the volume has been inserted into another device).
  77. I would have to set up the packet so it was returned either to me, or directly
  78. to the application/DOS.
  79.  
  80. Hope this makes sense.  Thanks for taking the time to read it.  Hope you
  81. can shead some light for me.
  82.  
  83.                         -David Jung.
  84.  
  85. -- 
  86. ------
  87. Freelance Software Developer    internet: djung@eco.adelaide.edu.au           //
  88. Adelaide, Australia.               or     david@maxus.levels.unisa.edu.au \\ //
  89.