/*static char *SCCSID = "@(#)chkband.c	6.1 90/11/17";*/
/*static char *SCCSID = "@(#)chkband.c 13.2 90/01/25";*/
#include <os2def.h>
#include "api.h"
#include "const.h"
#include "misc.h"
#include "chain.h"
#include "buf.h"
#include "dir.h"
#include "volume.h"
#include "storage.h"
#include "fnode.h"
#include "tables.h"
#include "pb_ifs.h"
#include "lw.h"
#include "frame.h"
#include "fsdata.h"
#include "pr_DEBUG.h"
#include "pr_MISC.h"

/*
 ***	ChkBand - Check Band Tables
 *
 *	Check Allocation Band Tables for consistancy
 *
 *	ENTRY none
 *	EXIT  none
 *
 */
void far
ChkBand ()
{
    USHORT usBand;
    USHORT usVol;

    /*
     * For each volume if the vol pointer is not null, then check the
     * count of files in the band.
     */
    for (usVol = 0; usVol < VOLMNTMAX; usVol++) {

	if (VolPtr [usVol] != NULL) {
	    /* only look at VolPtr if not in the middle of a mount */
	    if (VolPtr [usVol]->bStatusFlags & VS_MOUNTING == 0) {
		for (usBand = 0; usBand < VolPtr [usVol]->cBands; usBand++) {
		    if ((LONG)VolPtr[usVol]->apbndList[usBand]->cFilesInBand < 0) {
			dprintf ("ChkBand: too many files in vol %d, band %d\n",
				 usVol, usBand);
			Int3 ();
		    }
		}
	    }
	}
    }
}
