applets
arch
archival
console-tools
coreutils
debianutils
docs
e2fsprogs
old_e2fsprogs
blkid
e2p
ext2fs
Kbuild.src
alloc.c
alloc_sb.c
alloc_stats.c
alloc_tables.c
badblocks.c
bb_compat.c
bb_inode.c
bitmaps.c
bitops.c
bitops.h
block.c
bmap.c
bmove.c
brel.h
brel_ma.c
check_desc.c
closefs.c
cmp_bitmaps.c
dblist.c
dblist_dir.c
dir_iterate.c
dirblock.c
dirhash.c
dupfs.c
e2image.h
expanddir.c
ext2_err.h
ext2_ext_attr.h
ext2_fs.h
ext2_io.h
ext2_types.h
ext2fs.h
ext2fsP.h
ext2fs_inline.c
ext_attr.c
fileio.c
finddev.c
flushb.c
freefs.c
gen_bitmap.c
get_pathname.c
getsectsize.c
getsize.c
icount.c
imager.c
ind_block.c
initialize.c
inline.c
inode.c
inode_io.c
io_manager.c
irel.h
irel_ma.c
ismounted.c
jfs_dat.h
kernel-jbd.h
kernel-list.h
link.c
lookup.c
mkdir.c
mkjournal.c
namei.c
newdir.c
openfs.c
read_bb.c
read_bb_file.c
res_gdt.c
rs_bitmap.c
rw_bitmaps.c
sparse.c
swapfs.c
test_io.c
unix_io.c
unlink.c
valid_blk.c
version.c
write_bb_file.c
uuid
Config.src
Kbuild.src
README
chattr.c
e2fsbb.h
e2fsck.c
e2fsck.h
fsck.c
fsck.h
lsattr.c
mke2fs.c
tune2fs.c
util.c
util.h
Config.src
Kbuild.src
README
chattr.c
e2fs_defs.h
e2fs_lib.c
e2fs_lib.h
fsck.c
lsattr.c
tune2fs.c
editors
examples
findutils
include
init
libbb
libpwdgrp
loginutils
mailutils
miscutils
modutils
networking
printutils
procps
runit
scripts
selinux
shell
sysklogd
testsuite
util-linux
.gitignore
.indent.pro
AUTHORS
Config.in
INSTALL
LICENSE
Makefile
Makefile.custom
Makefile.flags
Makefile.help
README
TEST_config_nommu
TEST_config_noprintf
TEST_config_rh9
TODO
TODO_unicode
50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
/* vi: set sw=4 ts=4: */
|
|
/*
|
|
* 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);
|
|
}
|