From 4f81bc9756e6910d8e9d027d242d60632ea6e885 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 18 Jul 1994 20:01:23 +0000 Subject: Formerly subr.c.~7~ --- ufs/subr.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/ufs/subr.c b/ufs/subr.c index 5833dfef..6c7ea5f2 100644 --- a/ufs/subr.c +++ b/ufs/subr.c @@ -226,6 +226,40 @@ ffs_setblock(fs, cp, h) cp[h >> 3] |= (0x01 << (h & 0x7)); return; default: - panic("ffs_setblock"); + assert (0); } } + +/* Taken from 4.4 BSD sys/libkern/skpc.c: + @(#)skpc.c 8.1 (Berkeley) 6/10/93 +*/ +int +skpc(mask0, size, cp0) + int mask0; + int size; + char *cp0; +{ + register u_char *cp, *end, mask; + + mask = mask0; + cp = (u_char *)cp0; + for (end = &cp[size]; cp < end && *cp == mask; ++cp); + return (end - cp); +} + +/* Taken from 4.4 BSD sys/libkern/scanc.c: + @(#)scanc.c 8.1 (Berkeley) 6/10/93 +*/ +int +scanc(size, cp, table, mask0) + u_int size; + register u_char *cp, table[]; + int mask0; +{ + register u_char *end; + register u_char mask; + + mask = mask0; + for (end = &cp[size]; cp < end && (table[*cp] & mask) == 0; ++cp); + return (end - cp); +} -- cgit v1.2.3