summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2001-06-11 15:17:45 +0000
committerTheodore Ts'o <tytso@mit.edu>2001-06-11 15:17:45 +0000
commit3034f62a0f9c31e6dce8bd1237cffd3851847250 (patch)
treec62d365dbb2681aab7fb802767f7bb1918bccf67 /lib
parent5df55d7f847e29d23227592a0bb23daad1a61500 (diff)
downloade2fsprogs-3034f62a0f9c31e6dce8bd1237cffd3851847250.tar.gz
ChangeLog, Makefile.in, bitops.h, gen_bitmap.c:
Makefile.in, gen_bitmap.c, bitops.h: Move inline functions ext2fs_mark_generic_bitmap and ext2fs_unmark_generic_bitmap to gen_bitmap.c as normal functions. (This saves space and doesn't significantly change the speed of e2fsck on a P-III.) ChangeLog: Add missing log entry for unix.c.
Diffstat (limited to 'lib')
-rw-r--r--lib/ext2fs/ChangeLog6
-rw-r--r--lib/ext2fs/Makefile.in2
-rw-r--r--lib/ext2fs/bitops.h26
-rw-r--r--lib/ext2fs/gen_bitmap.c48
4 files changed, 59 insertions, 23 deletions
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index f26f76b8..710f79ed 100644
--- a/lib/ext2fs/ChangeLog
+++ b/lib/ext2fs/ChangeLog
@@ -1,5 +1,11 @@
2001-06-11 Theodore Tso <tytso@valinux.com>
+ * Makefile.in, gen_bitmap.c, bitops.h: Move inline functions
+ ext2fs_mark_generic_bitmap and
+ ext2fs_unmark_generic_bitmap to gen_bitmap.c as normal
+ functions. (This saves space and doesn't significantly
+ change the speed of e2fsck on a P-III.)
+
* ext2fs.h, bitops.h, block.c, bmap.c, closefs.c, dirblock.c,
inode.c, native.c, openfs.c, rw_bitmaps.c, swapfs.c: Only
include the byte-swapping logic if ENABLE_SWAPFS is turned
diff --git a/lib/ext2fs/Makefile.in b/lib/ext2fs/Makefile.in
index 6278b8d2..98444e5d 100644
--- a/lib/ext2fs/Makefile.in
+++ b/lib/ext2fs/Makefile.in
@@ -30,6 +30,7 @@ OBJS= ext2_err.o \
finddev.o \
flushb.o \
freefs.o \
+ gen_bitmap.o \
get_pathname.o \
getsize.o \
icount.o \
@@ -82,6 +83,7 @@ SRCS= ext2_err.c \
$(srcdir)/finddev.c \
$(srcdir)/flushb.c \
$(srcdir)/freefs.c \
+ $(srcdir/gen_bitmap.c \
$(srcdir)/get_pathname.c \
$(srcdir)/getsize.c \
$(srcdir)/icount.c \
diff --git a/lib/ext2fs/bitops.h b/lib/ext2fs/bitops.h
index f4b8e260..464f5e99 100644
--- a/lib/ext2fs/bitops.h
+++ b/lib/ext2fs/bitops.h
@@ -354,33 +354,14 @@ _INLINE_ __u32 ext2fs_swab32(__u32 val)
#endif /* !_EXT2_HAVE_ASM_SWAB */
-_INLINE_ int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
+/* These two routines moved to gen_bitmap.c */
+extern int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
__u32 bitno);
-_INLINE_ int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
+extern int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
blk_t bitno);
_INLINE_ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
blk_t bitno);
-_INLINE_ int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
- __u32 bitno)
-{
- if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
- ext2fs_warn_bitmap2(bitmap, EXT2FS_MARK_ERROR, bitno);
- return 0;
- }
- return ext2fs_set_bit(bitno - bitmap->start, bitmap->bitmap);
-}
-
-_INLINE_ int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
- blk_t bitno)
-{
- if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
- ext2fs_warn_bitmap2(bitmap, EXT2FS_UNMARK_ERROR, bitno);
- return 0;
- }
- return ext2fs_clear_bit(bitno - bitmap->start, bitmap->bitmap);
-}
-
_INLINE_ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
blk_t bitno)
{
@@ -627,7 +608,6 @@ _INLINE_ void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
for (i=0; i < num; i++)
ext2fs_clear_bit(block + i - bitmap->start, bitmap->bitmap);
}
-
#undef _INLINE_
#endif
diff --git a/lib/ext2fs/gen_bitmap.c b/lib/ext2fs/gen_bitmap.c
new file mode 100644
index 00000000..700affa1
--- /dev/null
+++ b/lib/ext2fs/gen_bitmap.c
@@ -0,0 +1,48 @@
+/*
+ * gen_bitmap.c --- Generic bitmap routines that used to be inlined.
+ *
+ * Copyright (C) 2001 Theodore Ts'o.
+ *
+ * %Begin-Header%
+ * This file may be redistributed under the terms of the GNU Public
+ * License.
+ * %End-Header%
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <fcntl.h>
+#include <time.h>
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#include "ext2_fs.h"
+#include "ext2fs.h"
+
+int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
+ __u32 bitno)
+{
+ if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
+ ext2fs_warn_bitmap2(bitmap, EXT2FS_MARK_ERROR, bitno);
+ return 0;
+ }
+ return ext2fs_set_bit(bitno - bitmap->start, bitmap->bitmap);
+}
+
+int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
+ blk_t bitno)
+{
+ if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
+ ext2fs_warn_bitmap2(bitmap, EXT2FS_UNMARK_ERROR, bitno);
+ return 0;
+ }
+ return ext2fs_clear_bit(bitno - bitmap->start, bitmap->bitmap);
+}