summaryrefslogtreecommitdiff
path: root/ext2fs/balloc.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-10-01 21:53:38 +0000
committerRoland McGrath <roland@gnu.org>1999-10-01 21:53:38 +0000
commit93028dc75b5c91d6d7194b0ee6479fd1b090cf6a (patch)
tree8c229d6edad0afecde657e0a1458783545c05325 /ext2fs/balloc.c
parenta994827b8de4e85f62fa85518bab59569213182a (diff)
1999-10-01 Roland McGrath <roland@baalperazim.frob.com>
* bitmap.c (memscan): Function removed. * ext2fs.h: Removed its decl. * balloc.c (memscan): New static function, defined using memchr.
Diffstat (limited to 'ext2fs/balloc.c')
-rw-r--r--ext2fs/balloc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext2fs/balloc.c b/ext2fs/balloc.c
index 8cdfb79c..661894f6 100644
--- a/ext2fs/balloc.c
+++ b/ext2fs/balloc.c
@@ -43,6 +43,16 @@
#include <string.h>
#include "ext2fs.h"
+
+/* Returns a pointer to the first occurence of CH in the buffer BUF of len
+ LEN, or BUF + LEN if CH doesn't occur. */
+static inline void *
+memscan (void *buf, unsigned char ch, size_t len)
+{
+ return memchr (buf, ch, len) ?: buf + len;
+}
+
+
#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1)
void