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

Defined functions

isbad defined in line 14; never used
Last modified: 1983-04-12
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 638
Valid CSS Valid XHTML 1.0 Strict