-- TestPilotKernel>KernelFile.mesa (last edited by Gobbel September 2, 1980 4:35 PM)
-- This interface supplies FileManager-level file facilities for higher-level software within Pilot (PilotControl, TransactionMgr, VMMgr).
DIRECTORY
Device USING [Type],
File USING [Capability, ID, PageCount, PageNumber, Type],
SpecialFile USING [Link],
System USING [VolumeID],
Transaction USING [Handle],
VMMapLog USING [Entry],
Volume USING [ID];
KernelFile: DEFINITIONS =
BEGIN
ExistingFile: ERROR;
CreateWithID: PROCEDURE [volume: System.VolumeID, initialSize: File.PageCount, type: File.Type, id: File.ID];
-- Same as File.Create, but uses supplied ID. May only be used for transaction crash recovery! Raises ExistingFile if a file is found with same ID.
GetBootLocation: PROCEDURE [file: File.Capability, filePage: File.PageNumber ← 0]
RETURNS [deviceType: Device.Type, deviceOrdinal: CARDINAL, link: SpecialFile.Link];
-- Returns device type, ordinal of device within its type, and disk address of given boot file and page.
-- Only one process may be operating on file at a time. The FileMgr does not serialize calls to this procedure with other calls to procedures in File/KernelFile.
GetFileAttributes: PROCEDURE [file: File.Capability] RETURNS [size: File.PageCount, immutable: BOOLEAN, readOnly: BOOLEAN];
-- In a single call, returns those attributes of file that are needed by the VMMgr. (Combines File.GetAttributes, File.GetSize, and File.ShowCapability, plus readOnly also reflects any readOnly access to the volume.)
-- May raise File.Unknown, Volume.Unknown.
GetFilePoint: PROCEDURE [pEntry: LONG POINTER TO VMMapLog.Entry, pFile: POINTER TO File.Capability, filePage: File.PageNumber];
-- Sets pEntry↑ to description of run of backing-store pages beginning with given filePage; page field of returned Entry is garbage.
-- Only one process may be operating on file at a time. The FileMgr does not serialize calls to this procedure with other calls to procedures in File/KernelFile.
GetNextFile: PROCEDURE [volume: Volume.ID, file: File.Capability] RETURNS [nextFile: File.Capability];
-- Enumerates files on given volume (started with and ends with File.nullCapability).
GetRootFile: PROCEDURE [type: File.Type, volume: Volume.ID] RETURNS [file: File.Capability];
-- Gets file with maxPermissions of given (Root) type from volume root page.
LogContents: PROCEDURE [transaction: Transaction.Handle, file: File.Capability, base: File.PageNumber, count: File.PageCount];
-- Saves the contents of the count pages of file starting at base in the transaction’s log file. The data to be logged must be currently in the client’s file. That is, if the data is mapped in VM and is dirty, it must be forced out to the backing file before calling LogContents.
-- May raise Transaction.InvalidHandle, File.Unknown, Volume.Unknown.
MakeMutable: PROCEDURE [file: File.Capability];
-- Inverse of File.MakeImmutable. May only be used for transaction crash recovery and transaction abort!
-- May raise File.Unknown, Volume.Unknown.
MakeTemporary: PROCEDURE [file: File.Capability];
-- Inverse of File.MakePermanent. May only be used for transaction crash recovery and transaction abort!
-- May raise File.Unknown, Volume.Unknown.
Pin: PROCEDURE [file: File.Capability, page: File.PageNumber ← 0, count: File.PageCount ← defaultPageCount];
-- Pins the file descriptor of file and page group descriptors for the count pages of the file starting at page into the File Cache. defaultPageCount means to the end of the file.
defaultPageCount: File.PageCount = LAST[File.PageCount];
Unpin: PROCEDURE [file: File.Capability, page: File.PageNumber ← 0, count: File.PageCount ← defaultPageCount];
-- Unpins the file descriptor of file and page group descriptors for the count pages of the file starting at page from the File Cache. defaultPageCount means to the end of the file.
END.
LOG
(For earlier entries, please see version archived with Pilot 3.0.)
February 3, 1980 1:05 PMMcJonesReplaced device parameter to GetBootLocation with deviceType and deviceHandle.
May 15, 1980 4:50 PMMcJonesAdded page and count parameters to Pin.
July 1, 1980 8:22 PMGobbelAdded MakeMutable and MakeTemporary.
July 14, 1980 2:07 PMGobbelDeleted DeleteTemps and OpenVolume.
July 22, 1980 5:10 PMLuniewskiAdded GetFileAttributes.
July 29, 1980 1:16 PMGobbelAdded CreateWithID.
August 21, 1980 9:03 AMKnutsenAdded LogContents, Unpin, deleted GetFileDescriptor.
September 2, 1980 4:35 PMGobbelAdded ExistingFile.