badblock moves into this file
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sun, 31 Dec 1989 14:46:51 +0000 (06:46 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sun, 31 Dec 1989 14:46:51 +0000 (06:46 -0800)
SCCS-vsn: sys/ufs/ffs/ffs_alloc.c 7.15
SCCS-vsn: sys/ufs/lfs/lfs_alloc.c 7.15

usr/src/sys/ufs/ffs/ffs_alloc.c
usr/src/sys/ufs/lfs/lfs_alloc.c

index 872d059..8b6c6e8 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)ffs_alloc.c 7.14 (Berkeley) %G%
+ *     @(#)ffs_alloc.c 7.15 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -1087,6 +1087,22 @@ mapsearch(fs, cgp, bpref, allocsiz)
        return (-1);
 }
 
        return (-1);
 }
 
+/*
+ * Check that a specified block number is in range.
+ */
+badblock(fs, bn)
+       register struct fs *fs;
+       daddr_t bn;
+{
+
+       if ((unsigned)bn >= fs->fs_size) {
+               printf("bad block %d, ", bn);
+               fserr(fs, "bad block");
+               return (1);
+       }
+       return (0);
+}
+
 /*
  * Fserr prints the name of a file system with an error diagnostic.
  * 
 /*
  * Fserr prints the name of a file system with an error diagnostic.
  * 
index dc1827c..4e523bd 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)lfs_alloc.c 7.14 (Berkeley) %G%
+ *     @(#)lfs_alloc.c 7.15 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -1087,6 +1087,22 @@ mapsearch(fs, cgp, bpref, allocsiz)
        return (-1);
 }
 
        return (-1);
 }
 
+/*
+ * Check that a specified block number is in range.
+ */
+badblock(fs, bn)
+       register struct fs *fs;
+       daddr_t bn;
+{
+
+       if ((unsigned)bn >= fs->fs_size) {
+               printf("bad block %d, ", bn);
+               fserr(fs, "bad block");
+               return (1);
+       }
+       return (0);
+}
+
 /*
  * Fserr prints the name of a file system with an error diagnostic.
  * 
 /*
  * Fserr prints the name of a file system with an error diagnostic.
  *