DIRECTORY Disk USING [Channel, PageCount, PageNumber], File USING [FP, Handle, PageCount, PageNumber, PropertyStorage, Volume, VolumeFile, VolumeID], PhysicalVolume USING [Physical, PhysicalRC], Rope USING [ROPE]; FileBackdoor: CEDAR DEFINITIONS = BEGIN Volume: TYPE = File.Volume; Handle: TYPE = File.Handle; PageCount: TYPE = File.PageCount; PageNumber: TYPE = File.PageNumber; VolumeFile: TYPE = File.VolumeFile; FP: TYPE = File.FP; PropertyStorage: TYPE = File.PropertyStorage; ReservePages: PROC[physical: PhysicalVolume.Physical, start: Disk.PageNumber, size: Disk.PageCount]; ReserveNoPages: PROC[physical: PhysicalVolume.Physical]; GetVolumePages: PROC[volume: Volume] RETURNS[size, free, freeboard: INT]; VolumeFlusher: TYPE = PROC[Volume, INT, REF ANY] RETURNS[BOOL]; SetFlusher: PROC[volume: Volume, flusher: VolumeFlusher, data: REF ANY]; GetFlusher: PROC[volume: Volume] RETURNS[VolumeFlusher, REF ANY]; SetFreeboard: PROC[volume: Volume, freeboard: INT]; CreatePhysicalVolume: PROC[where: Disk.Channel, name: Rope.ROPE, id: File.VolumeID] RETURNS[PhysicalVolume.Physical]; CreateLogicalVolume: PROC[where: LIST OF PhysicalVolume.Physical, size: INT, name: Rope.ROPE, id: File.VolumeID] RETURNS[File.Volume]; PhysicalPageBad: PROC[physical: PhysicalVolume.Physical, address: Disk.PageNumber] RETURNS[ badTableFull: BOOL, status: PhysicalVolume.PhysicalRC ]; IsBadPage: PROC[physical: PhysicalVolume.Physical, diskPage: Disk.PageNumber] RETURNS[bad: BOOL, status: PhysicalVolume.PhysicalRC]; SpliceOutDataPage: PROC[file: Handle, filePage: File.PageCount] RETURNS [oldPage: Disk.PageNumber, oldChannel: Disk.Channel]; SetRoot: PROC[root: VolumeFile, file: Handle, page: PageNumber _ [0]]; GetRoot: PROC[volume: Volume, root: VolumeFile] RETURNS[fp: FP, page: PageNumber]; MarkDebugger: PROC[volume: Volume, isDebugger: BOOL]; IsDebugger: PROC[volume: Volume] RETURNS[BOOL]; EraseVolume: PROC[volume: Volume]; CreateVMBacking: PROC[volume: Volume, size: PageCount, report: PROC[File.FP, PropertyStorage, File.PageCount] _ NIL] RETURNS[Handle]; NextFile: PROC[volume: Volume, prev: FP] RETURNS[FP]; END. ΄FileBackdoor.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Andrew Birrell, September 20, 1983 2:04 pm Bob Hagmann January 29, 1985 2:06:37 pm PST Doug Wyatt, February 27, 1985 9:42:56 am PST This interface has the more private functions of the File Package. Types and Constants Volumes Management of volume free pages Notifies the volume creation machinery that the specified range of pages is not to be used (e.g. it contains initial microcode or an Alto partition) Notifies the volume creation machinery that no pages are currently reserved ! Error[wentOffline, nonCedarVolume, inconsistent, software, hardware] Returns the size and present free page count of this volume. Also returns the "freeboard" parameter set by a client (see volume flusher arrangements below). A procedure provided by a client which may be called occasionally to try to free up space on the volume. See "SetFlusher" below. ! no errors Specifies a volume flusher for this volume. Hereafter, the procedure will be called from inside this implementation when the implementation thinks it is a good time to free up some pages on the volume. When called, the procedure is handed "data", "volume" and a page count indicating how many pages it should try to free. The flusher procedure should return TRUE iff it thinks it is making progress. No internal locks are held synchronously with the call out to the flusher procedure. Setting a flusher of NIL disables this facility. If the client has never specified a freeboard, then this call sets a suitable default freeboard. ! no errors Returns NIL if there is currently no flusher for this volume. Requests that the implementation try to maintain that number of free pages by calling the volume flusher (if there is one) from time to time. Volume root page operations Record page as bad in the physical volume root Ask if a page is bad. The given page is removed from the file, and a new previously free page is allocated, its label is written, and inserted into the file at the location of the bad page. The bad page number is returned. The page is not marked bad, but the client is free to do this. Not valid for header pages. May invalidate address returned by GetProperties. ! Error[wentOffline, nonCedarVolume, unknownFile, inconsistent, software, hardware, mixedDevices] Installs the file as a root file of its volume, for subsequent access by GetRoot or when inloading/booting. "page", if provided, is the page number of the first data page used for inloading/booting from this file. ! Error[wentOffline, nonCedarVolume, inconsistent, software, hardware] Returns the appropriate root file of the volume, or nullFP if no root has been installed. ! Error[wentOffline, nonCedarVolume, inconsistent, software, hardware] Marks the volume as being one which is expected to be the system volume of a world-swap debugger. If you don't understand that, don't call this procedure. ! Error[wentOffline, inconsistent, software, hardware] Tells whether the volume is one which is expected to be the system volume of a world-swap debugger. If you don't understand that, don't call this procedure. ! Error[wentOffline, nonCedarVolume, inconsistent, software, hardware] Initialises the entire volume. This implicitly deletes every file on that volume, and sets all its volume root files to nullFP (except the VAM). Makes no assumptions about the previous contents of the volume. Error[inconsistent] probably indicates that a containing physical volume needs to be scavenged. Calling this for the volume that contains the current VM backing file is probably a bad idea. Files Special backdoor for FS to allow for special handling of the creation of the VM Backing File. Otherwise, this is identical to the Create procedure. ! Error[wentOffline, nonCedarVolume, volumeFull, fragmented, inconsistent, software, hardware] ! Error[wentOffline] Returns the FP of the "next" file in existence on the volume. Giving prev=nullFP returns the "first" file. Returns nullFP if there is no "next" file. The enumeration order is determined by the physical layout of the disk. This is intended as the primitive operation for higher level scavengers. Bob Hagmann January 29, 1985 9:28:26 am PST split from File.mesa Κ7˜codešœ™Kšœ Οmœ1™žœžœ&˜”K™.K˜—š  œžœ?žœžœ#˜„Kšœ™K™—š œžœ)žœ5˜}KšœΩ™ΩK˜—K˜š œžœ9˜FKšœa™aKšœΦ™ΦK˜—š œžœ#žœžœ˜RKšœF™FKšœY™YK˜—K˜š  œžœžœ˜5KšœF™FKšœ›™›K˜—š  œžœžœžœ˜/Kšœ6™6Kšœ™K˜—K˜š  œžœ˜"KšœF™FKšœ’™’——šœ™š  œžœ*žœžœ%žœžœ ˜…K™”Kšœ^™^K™—š  œžœžœžœžœ˜5Kšœ™K™ͺK™——K˜šžœ˜K™—™+KšΟr™K™K™K™K™K™K™——…—fQ