; static char *SCCSID = "@(#)volume.h   6.3 91/10/20";  
;       Maximum number of volumes that we can mount
;*
;*      The volume ID is kept in the high bits of the sector numbers
;*      kept in our RAM structures,
;*      so there is a tradeoff between max volumes and max sectors.
;*
;*      32 max volumes gives us a 65 billion byte volume limit,
;*      which should last us for a while.  Since sector numbers
;*      are stored on the disk without their volume upper bits
;*      this is strictly an implimentation detail; we can adjust
;*      the number of volumes or eliminate this tradeoff in other
;*      implimentations which will be 100% media compatable.
;*
;*      We use the term VSector to indicate a vol/sector combination
;*      and PSector to indicate just the physical absolute sector #
;*
;*      HISTORY
;*          19-Sep-89 by JR (John Rogers, JohnRo@Microsoft)
;*              - Avoid warnings from Microsoft C 5.2 (on slash-slash comments).
;*          01-Aug-1989 by JR (John Rogers, JohnRo@Microsoft)
;*              - PTR B705990: Allow regular mount of dirty volume.  (Added
;*                VS_WAS_DIRTY flag.)
;*          10-Jul-1989 by JR (John Rogers, JohnRo@Microsoft)
;*              - PTR B784106: Documented additional use of VS_MOUNTING flag.
;*              - PTR B784106: Added bSpareFlags to VOLTAB (more like the
;*                assembler version).  Deleted unused bFaultFlags from VOLTAB.
;  
VOL_DATA_INCL	EQU	1
;  tell fsdata.h that we've been included   
;       Bitmap related numbers   
BANDSHIFT	EQU	(BSHIFT+3 )            ;  right shift sector # to band index   
BANDMASK	EQU	(SPB*SECSIZE*8 -1 )    ;  mask for within band bits   
BANDSIZE	EQU	(SPB*SECSIZE*8 )      ;  # of sectors in a full band   
;**     BandTab - Disk Band Table
;*
;*      The disk is broken up into logical bands, each band being
;*      the amount of space that is addressed in 2K of bitmap.
;*
;*      This structure tracks the bands: the location of their respective
;*      bit maps, the amount of free space, etc.
;  

BANDTAB	STRUC
BANDTAB_scpMap	DB	SIZE SECPTR DUP (?)          ;  BT_MAP   Vsector # and hint pointer for map   
BANDTAB_csecFree	DW	?        ;  BT_FREE  # of free sectors in this band   
BANDTAB_cFilesInBand	DW	?    ;  BT_OFC   # of files allocating from this band   
BANDTAB_lsnBase	DD	?            ;  BT_BASE  Psector # of first sector in map   
BANDTAB_cbMapLen	DW	?          ;  BT_LEN   byte length of this map   
BANDTAB_ibHighWaterOffset	DW	? ;  BT_HWO   high water offset to 1st non-zero byte   
                                ;  BUGBUG - use BT_HWO   
BANDTAB	ENDS
PBANDTAB struc
	dd ?
PBANDTAB ends

;**     VolTab - Volume Table
;*
;*      VolPtr[i] points to the VolTab structure for that volume.
;*      This table contains volume specific information.
;*
;*      Nearly all file system API refers to a single particular volume.
;*      The proper volume is determined when the file system is entered
;*      and the FRAME structure contains a pointer to it.  Most code ignores
;*      volumes and deals with 32 bit physical sector #'s.  When we're about
;*      to interface with the device driver we then peek at the "global"
;*      volume value pointed to by the FRAME.
;*
;*      There are two exceptions to this, where per-volume structures are
;*      pooled, the buffer pool and the OFT pool.  In these two cases the
;*      sector number has the volume index set in it's high order VOLLSHIFT
;*      bits so that a single DWORD compare will qualify a sector on both
;*      a volume and sector basis.
;  

VOLTAB	STRUC
VOLTAB_bSpareFlags	DB	?       ;  VOL_FFLAG    Copy of flags from spare block.
;                            *              (Use SPF_xxx equates in "superb.h".)
;                            *              (Only valid when VS_MOUNTING flag
;                            *              in bStatusFlags is off.)   
VOLTAB_bStatusFlags	DB	?      ;  VOL_SFLAG    status flags - See VS_xxx   
VOLTAB_hVPB	DW	?            ;  VOL_????     os/2 volume handle   
        ;  not needed       /* VOL_DDCAP */
        ;  not needed       /* VOL_UNIT */
VOLTAB_ulVolBits	DD	?        ;  VOL_SECVAL   value to set on high order part
;                            *              of sector #   
VOLTAB_pbVolLabel	DD	?       ;               volume label, added later   
VOLTAB_ulSerial	DD	?         ;               serial number   
VOLTAB_cBands	DW	?          ;  VOL_BCNT     # of bitmap bands in this volume   
VOLTAB_cVDBcalls	DW	?       ;  VOL_VDBCnt   count of outstanding VerifyDB
;                            *              calls   
VOLTAB_cSpareDirblks	DW	?     ;  VOL_SDBcnt   count of spare DIRBLKs left for
;                            *              volume, if all are unused, else 0   
VOLTAB_cSectsOnVol	DD	?      ;  VOL_SBSEC    culSectsOnVol value from
;                            *              superblock.   
VOLTAB_bndDirBand	DB	SIZE BANDTAB DUP (?)     ;  VOL_DB       DIRBLK bandtab   
VOLTAB_psbdRoot	DB	SIZE PSUBDIR DUP (?)       ;  VOL_ROOT     Root SUBDIR pointer   
VOLTAB_csecSpace	DD	?         ;  VOL_SPACE    allocatable space limit (signed)   
VOLTAB_csecDirBlkBand	DD	?   ;  VOL_DBSIZE   copy of clsnDirBlkBand from
;                            *              SuperB   
        ;  not needed       /* VOL_DDSTRAT  address of device driver strategy
;                            *              routine - zero if driver doesn't
;                            *              support it   
        ;  not needed       /* VOL_DDVCHAR  addr of drvr vol characteristics   
                            ;               table   
        ;  not needed       /* VOL_DBCHGPR  addr of drvr change pri routine   
        ;  not needed       /* VOL_DDSETREST    addr of drvr SETREST routine */
        ;  not needed       /* VOL_DDGETBOUND   addr of drvr getboundary */
                            ;                   routine   
        ;  not needed       /* VOL_BDLAB    disk label from boot sector */
        ;  not needed       /* VOL_BDLLEN   length of disk label */
        ;  not needed       /* VOL_BOOTID   boot ID value */
        ;  not needed       /* VOL_SID      addr of SIDTAB for volume */
        ;  not needed       /* VOL_SIDSEC   SB_SIDSEC value */
VOLTAB_cHotFixInUse	DW	?      ;  VOL_HFUSE    # of hot fixes in effect   
VOLTAB_cHotFixMax	DW	?        ;  VOL_HFMAX    max # of hot fixes for volume   
VOLTAB_pHotFixArray	DD	?      ;  VOL_HFPTR    address of hot fix heap array   
                            ;               - bad sectors   
VOLTAB_pHotFixNew	DD	?        ;  VOL_HFNEW    address of substitute list   
                            ;               - replacement sectors   
        ;  not needed       /* VOL_LAZYFLAG non-zero if dovolio is lazywriting */
                            ;               this volume   
        ;  not needed       /* VOL_DUMY     padding */
        ;  not needed       /* VOL_VOL_LVOL pointer to lazywrite stuff */
VOLTAB_cCodePage	DW	?       ;  VOL_??       count of Code Pages stored on this   
                            ;               volume   
VOLTAB_paiCodePage	DD	?      ;  VOL_??       pointer to array [cCodePage] of   
                            ;               byte indices into CodePageTable   
VOLTAB_pfncStrategy2	DD	?      ;  VOL_??       addr of device driver's strategy2   
                            ;               routine, or null if none   
VOLTAB_SCBcapable	DB	?        ;  VOL_??       Device supports SCB protocol;     
                         ;              0 if SCB protocol not supported    
VOLTAB_VDU	DB	?       ;  VOL_??       Virtual Device Unit (VDU);     
                                 ;   0 if not VDU          
VOLTAB_idLogDisk	DB	?         ;  VOL_??       Logical disk ID for this volume.   
VOLTAB_chDriveLetter	DB	?     ;  VOL_??       Drive letter   
VOLTAB_csgMax	DW	?          ;  VOL_??       Max scatter-gather entries in a   
                            ;               single request.  0 if n/a.   
VOLTAB_apbndList	DD	1 DUP (?)  ;  VOL_BPTR     first of VOL_BCNT pointers, one per   
                            ;               band.  The BANDTABs that they point   
                            ;               to must be physically contiguous   
VOLTAB	ENDS
