-- MarkerPage.mesa (last edited by: Luniewski on: July 24, 1980 9:04 AM)
DIRECTORY
DiskChannel USING [Drive],
Environment USING [wordsPerPage],
File USING[ID],
LogicalVolume USING [Handle, LogicalSubvolumeMarker],
PhysicalVolume USING [ID],
PhysicalVolumeFormat USING [Handle, PhysicalSubvolumeMarker];
MarkerPage: DEFINITIONS =
BEGIN
-- SubVolumeMarkerPage is set up to occupy a full page, with each half taking half of the page. This allows each part to grow independently. This may not win much in the long run, but it is cheap ti implement.
SubVolumeMarkerPage: TYPE = MACHINE DEPENDENT RECORD[
logical: LogicalVolume.LogicalSubvolumeMarker,
fill1: ARRAY SubVolumeFill1 OF WORD ← NULL,
physical: PhysicalVolumeFormat.PhysicalSubvolumeMarker,
fill2: ARRAY SubVolumeFill2 OF WORD ← NULL,
checksum: CARDINAL ← 0];
CacheKey: TYPE = RECORD[SELECT type:* FROM
drive =>[h: DiskChannel.Drive],
physicalID =>[id: PhysicalVolume.ID],
ENDCASE ];
-- Procedures implemented in MarkerPageImpl
CreateMarkerPage: PROCEDURE[pvHandle: PhysicalVolumeFormat.Handle, lvHandle: LogicalVolume.Handle, physicalSubvolumeNumber: CARDINAL];
UpdateLogicalMarkerPages: PROCEDURE[lvHandle: LogicalVolume.Handle];
UpdatePhysicalMarkerPages: PROCEDURE[pvHandle: PhysicalVolumeFormat.Handle];
Enter: PROCEDURE[drive: DiskChannel.Drive, physicalID: PhysicalVolume.ID];
EnterMarkerID: PROCEDURE[c: CacheKey, markerID: File.ID];
GetNextPhysicalVolume: PROCEDURE[thisPvID: PhysicalVolume.ID] RETURNS [nextPvID: PhysicalVolume.ID, drive: DiskChannel.Drive];
-- Find is exported because some of Special Volume operations use it.
Find: PROCEDURE[CacheKey] RETURNS [drive: DiskChannel.Drive, physicalID: POINTER TO READONLY PhysicalVolume.ID, markerID: POINTER TO READONLY File.ID];
NotFound: ERROR;
Flush: PROCEDURE[CacheKey];
-- Constants
SubVolumeFill1: TYPE = [SIZE[LogicalVolume.LogicalSubvolumeMarker]..Environment.wordsPerPage/2);
SubVolumeFill2: TYPE = [Environment.wordsPerPage/2+SIZE[PhysicalVolumeFormat.PhysicalSubvolumeMarker]..Environment.wordsPerPage-1);
-- Assertion
SubVolumeMarkerSize: CARDINAL[Environment.wordsPerPage..Environment.wordsPerPage] = SIZE[SubVolumeMarkerPage];
END.......
LOG
Time: October 1, 1979 12:20 PMBy: ForrestAction: Created from old code in volumeImpl.mesa
Time: May 20, 1980 2:50 PMBy: LuniewskiAction: PhysicalVolume => PhysicalVolumeFormat
Time: July 24, 1980 9:04 AMBy: LuniewskiAction: Added GetNextPhysicalVolume.