1: /*
   2:  *	SCCS id	@(#)dkbad.c	2.1 (Berkeley)	8/5/83
   3:  */
   4: 
   5: #include "param.h"
   6: #ifdef BADSECT
   7: #include <sys/buf.h>
   8: #include <sys/dkbad.h>
   9: 
  10: /*
  11:  * Search the bad sector table looking for
  12:  * the specified sector.  Return index if found.
  13:  * Return -1 if not found.
  14:  */
  15: 
  16: isbad(bt, cyl, trk, sec)
  17:     register struct dkbad *bt;
  18: {
  19:     register int i;
  20:     register long blk, bblk;
  21: 
  22:     blk = ((long)cyl << 16) + (trk << 8) + sec;
  23:     for (i = 0; i < MAXBAD; i++) {
  24:         bblk = ((long)bt->bt_bad[i].bt_cyl << 16) + bt->bt_bad[i].bt_trksec;
  25:         if (blk == bblk)
  26:             return (i);
  27:         if (blk < bblk || bblk < 0)
  28:             break;
  29:     }
  30:     return (-1);
  31: }
  32: #endif

Defined functions

Last modified: 1983-08-06
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 698
Valid CSS Valid XHTML 1.0 Strict