
         To  : Distribution
         From: Keith Ball

         file: VOLLCK.DC2.TEXT
         date: December 7, 1983

         Re: Proposal on implementation of volume protection


         Volume protection is a lockout procedure.  When a user
         attempts to mount a volume with locked read and write
         access, the boot or mount manager verifies that the
         volume is not in use by another user.  If it is then the
         volume will not be mounted at all, even if users local
         access is read only.  This guarantees two users will not
         write to a volume at the same time and one user will not
         crash from invalid reads because another user writes to
         the volume.

         Volumes will be of three types 1) read only, 2) read and
         write and 3) locked read and write.  Locked read/write
         is defined by a new flag in the volume table, called the
         lock volume flag.  When the flag is set the mount
         manager and boot must check if the volume is locked.
         The system utilities, especially the drive manager, must
         be changed to allow for this third type of volume for
         adds and changes.

         Volumes are locked by setting bit 7 (msb) of byte
         indexed by 26 in block 2 of the volume.  The lock flag
         is in the directory file entry of the UCSD P-system
         directory that is the header in every Constellation II
         volume.  If the bit is clear then the volume is
         unlocked.  If the bit is set then the volume is locked.
         When locked, the remaining 7 bits of byte 26 and all of
         byte 27 are the user number from the drive.user table
         for the user who has the volume locked.

         Two programs, an unmount (or unlock) and a logoff, are
         necessary to unlock a volume no longer needed by a user.
         Unmount removes a single volume from the users mount
         table and unlocks the volume by clearing the lock flag.
         Logoff unmounts and unlocks all the user's locked
         volumes.  It must be executed before a user turns off
         their workstation or completes work for a period of
         time.

         How to lock volume in boot or mount manager when volume
         is of type locked read and write.

           1) Do drive command test and set on volume's lock
              flag.

           2) If the volume is locked then do not mount volume.
              The mount manager should read in the directory
              block (volume block 2) and get the user number of
              the user who has the volume locked.  Then it looks
              up the user name in the drive.user table and
              displays it.

           3) If the volume is not locked then the boot and the
              mount manager must write the user's number into
              the volumes's directory user number field.  Both
              programs must keep the user number for the drive
              from which they are mounting volumes.

         How to unlock volume

           1) Do drive command test and clear on volume's lock
              flag.
