home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / alt_os / mint / mfs6011 / source / minixfs / check.c < prev    next >
C/C++ Source or Header  |  1993-11-25  |  1KB  |  47 lines

  1. /* This File is part of Minixfs, Copyright 1991,1992,1993 S.N.Henson */
  2.  
  3. #include "minixfs.h"
  4. #include "global.h"
  5. #include "proto.h"
  6.  
  7. /* Range checkers, see if inode/zone read ranges are allowed:
  8.  * if STRICT is set halt system on error, otherwise just print
  9.  * out an alert.
  10.  */
  11.  
  12. #ifdef STRICT
  13. #define badfilesys()    l_sync(); FATAL("Minixfs: Bad Filesystem, Reboot \
  14. and run fsck");
  15. #else
  16. #define badfilesys()    ALERT("Minixfs: Bad Filesystem, Repair with fsck")
  17. #endif
  18.  
  19. void chk_zone(start,count,drive)
  20. long start;
  21. int count,drive;
  22. {
  23.     super_info *psblk=super_ptr[drive];
  24.     if(start < psblk->sblk.s_firstdatazn ||
  25.         start+count > psblk->sblk.s_zones)
  26.     {
  27.         ALERT("Minixfs Zone Range Error Drive %c Zone %ld Count %d",
  28.         drive+'A',start,count);
  29.         badfilesys();
  30.     }
  31.     return;
  32. }
  33.  
  34. void chk_iblock(start,psblk)
  35. long start;
  36. super_info *psblk;
  37. {
  38.     if(start < psblk->ioff || start >= psblk->sblk.s_firstdatazn)
  39.     {
  40.         ALERT("Minixfs Inode Range Error Drive %c Block %ld",
  41.     psblk->dev+'A',start);
  42.         badfilesys();
  43.     }
  44.     return;
  45. }
  46.  
  47.