// IfsDDMgr.decl
// Copyright Xerox Corporation 1979, 1980, 1981
// Last modified June 27, 1981  7:53 PM by Taft

get "Ifs.decl"
get "IfsVMem.decl"
get "AltoFileSys.d"
get "Disks.d"
get "Tfs.d"


//----------------------------------------------------------------------------
structure IFSDDMgr:	// DiskDescriptor Manager
//----------------------------------------------------------------------------
[
// Standard defined operations (from Disks.d)
@DDMgr

// Instance data (for this implementation)
lock @Lock		// Interlocks access to the DDMgr
buffer word		// -> currently-locked buffer (0 if none)
vPage word		// Virtual page number of buffer
flushTimer word		// Timer for full flush of TFSKDs (see FlushKDs)
]
manifest lenIFSDDMgr = size IFSDDMgr/16

manifest
[
logDDPageGroupSize = TFSlnWordsPerPage-logVMPageLength
ddPageGroupSize = 1 lshift logDDPageGroupSize
maxDDDiskPages = lengthTFSDDpreamble+lengthTFSBT
maxDDVMPages = maxDDDiskPages lshift logDDPageGroupSize
]

//----------------------------------------------------------------------------
structure DDVMD:	// DiskDescriptor Virtual Memory Descriptor
//----------------------------------------------------------------------------
[
@VMD			// Standard stuff
disk word		// Disk owning this VMD
]
manifest lenDDVMD = size DDVMD/16

manifest
[
dirtyOffset = offset TFSDSK.diskBTsize/16 -1
vmdOffset = offset TFSDSK.version/16 -1
]

//----------------------------------------------------------------------------
structure IFSDSK:	// IFS extension of TFSDSK structure
//----------------------------------------------------------------------------
[
blank word dirtyOffset
dirty word		// nonzero if KDH needs flushing
blank word (vmdOffset-dirtyOffset-1)
vmd word		// -> DDVMD for this disk
]

//----------------------------------------------------------------------------
structure IFSKD:	// IFS extension of TFSKD structure
//----------------------------------------------------------------------------
[
currentKD @TFSKD	// the KD maintained by the TFS package
blank word (TFSwordsPerPage - 2*(size TFSKD/16))
initialKD @TFSKD	// state of the KD when disk last opened
]