-- Scavenger.mesa (last edited by: McJones on: January 28, 1981 12:39 PM)
DIRECTORY
File USING [Capability, ID, PageCount, PageNumber, Type],
Space USING [PageNumber],
System USING [GreenwichMeanTime],
Volume USING [ID];
Scavenger: DEFINITIONS =
BEGIN
Error: ERROR [error: ErrorType];
ErrorType: TYPE = {cannotWriteLog, noSuchPage, orphanNotFound, volumeOpen, diskHardwareError, diskNotReady};
Header: TYPE = MACHINE DEPENDENT RECORD [
volume (0): Volume.ID,
date (5): System.GreenwichMeanTime,
incomplete (7: 0..14): BOOLEAN,
repaired (7: 15..15): BOOLEAN,
numberOfFiles (10B): LONG CARDINAL];
LogFormat: TYPE = MACHINE DEPENDENT RECORD [
header (0): Header,
files (SIZE [Header]): ARRAY [0..0) OF FileEntry];
Problem: TYPE = MACHINE DEPENDENT RECORD [
trouble (0): SELECT entryType (0: 0..15):* FROM -- "trouble" added due to compiler bug.
unreadable, missing => [
first (1): File.PageNumber,
count (3): File.PageCount],
duplicate, orphan => [
id (1): OrphanHandle]
ENDCASE];
FileEntry: TYPE = MACHINE DEPENDENT RECORD [
file (0): File.ID,
numberOfProblems (5): CARDINAL,
problems (6): ARRAY [0..0) OF Problem];
OrphanHandle: TYPE [2];
DeleteLog: PROCEDURE [volume: Volume.ID];
DeleteOrphanPage: PROCEDURE [volume: Volume.ID, id: OrphanHandle];
GetLog: PROCEDURE [volume: Volume.ID] RETURNS [logFile: File.Capability];
ReadBadPage: PROCEDURE [file: File.ID, page: File.PageNumber, destination: Space.PageNumber];
ReadOrphanPage: PROCEDURE [volume: Volume.ID, id: OrphanHandle, destination: Space.PageNumber]
RETURNS [file: File.ID, type: File.Type, pageNumber: File.PageNumber, readErrors: BOOLEAN];
RewritePage: PROCEDURE [file: File.ID, page: File.PageNumber, source: Space.PageNumber];
Scavenge: PROCEDURE [volume, logDestination: Volume.ID, repair: BOOLEAN] RETURNS [logFile: File.Capability];
END.
LOG
Time: June 17, 1980 10:06 AMBy: LuniewskiAction: Create file
Time: July 13, 1980 9:08 PMBy: ForrestAction: Add error: to ERROR declaration
Time: September 2, 1980 4:58 PMBy: LuniewskiAction: Make all records be Machine Dependent and use explicit word numbers within those records
Time: October 10, 1980 6:30 PMBy: LuniewskiAction: SIZE[] => #
Time: January 28, 1981 12:39 PMBy: McJonesAction: Add diskHardwareError, diskNotReady to ErrorType