mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-12-26 10:19:57 +08:00
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.
This commit is contained in:
parent
5df55d7f84
commit
3034f62a0f
@ -1,5 +1,8 @@
|
||||
2001-06-11 Theodore Tso <tytso@valinux.com>
|
||||
|
||||
* unix.c (PRS): Fix bug introduced in 1.20 which broke the -F
|
||||
flag.
|
||||
|
||||
* Makefile.in: Add message.c and swapfs.c to the list of source
|
||||
files to build the make depend.
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 \
|
||||
|
@ -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
|
||||
|
||||
|
48
lib/ext2fs/gen_bitmap.c
Normal file
48
lib/ext2fs/gen_bitmap.c
Normal file
@ -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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user