
The current SCSIdriver/SCSIFS pair suffer from potential data/map corruption
problems in that any program may (by accident or on purpose) issue
Write/Format/ModeSelect commands to a device currently mounted by SCSIFS.

The problem is not just one of preventing use by other programs but of
providing a clean change of device ownership from one user to another, as
SCSIdm for example is entitled to modify your disc, (to map out defects/
format/partition it etc) but must only do so once SCSIFS has closed down all
open files and dismounted the disc.

I propose adding the following SWI call to SCSIdriver



SCSI_Reserve
============

'Claim' - Claim exclusive use of a device
-------

This call attempts to claim exclusive use of the given device.
If the call is successful, the caller will be granted sole use of the
'dangerous' SCSIdriver calls for that device and may use them itself, only
by supplying the access key registered at 'Claim' time. Other callers
may only use safe calls such as SCSI_Initialise-DetermineDevice.

If the device has already been claimed, an error message 'Device Reserved'
will be returned.

entry
  R0 0
  R1 device ID
  R2 release address
  R3 workspace pointer, to be passed in R12 when release address is called
  R8 access key

exit
  VC
  VS & R0->error



'ForceClaim'
------------

This call is similar to 'Claim' above, however, if the device is already
claimed, it will ask the current claimant to release it, by calling the
release address registered for that device.
The current owner should try to tidy up, and call 'Release' but may refuse
by returning VS and R0 pointing to an error message

Aside: This call will be used by SCSIdm to ask SCSIfs to close files and
       dismount etc

entry
  R0 1
  R1 device ID
  R2 release address
  R3 workspace pointer, to be passed in R12 when release address is called
  R8 access key

exit
  VC
  VS & R0->error



'Release'
---------
This call will remove the reservation of a device.

entry
  R0 2
  R1 device ID
  R8 access key  (to prove you actually claimed it)

exit
  VC
  VS -> error (probably just "you haven't claimed it")


Aside: This call is used by SCSIFS in response to *DISMOUNT/*BYE



Passing access key value to SCSI SWI's
======================================
The access key (probably WorkSpacePointer) should be passed in R8
and is only checked if the specified device is claimed and the call/reason
code is 'dangerous'.





Comments please


---Richard
          
