mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2025-01-21 16:03:24 +08:00
Many files:
Checkin of e2fsprogs 0.5b
This commit is contained in:
parent
6f4a109706
commit
f3db3566b5
@ -370,9 +370,9 @@ void do_freei(int argc, char *argv[])
|
||||
if (!inode)
|
||||
return;
|
||||
|
||||
if (!ext2fs_test_inode_bitmap(fs,fs->inode_map,inode))
|
||||
if (!ext2fs_test_inode_bitmap(fs->inode_map,inode))
|
||||
com_err(argv[0], 0, "Warning: inode already clear");
|
||||
ext2fs_unmark_inode_bitmap(fs,fs->inode_map,inode);
|
||||
ext2fs_unmark_inode_bitmap(fs->inode_map,inode);
|
||||
ext2fs_mark_ib_dirty(fs);
|
||||
}
|
||||
|
||||
@ -394,9 +394,9 @@ void do_seti(int argc, char *argv[])
|
||||
if (!inode)
|
||||
return;
|
||||
|
||||
if (ext2fs_test_inode_bitmap(fs,fs->inode_map,inode))
|
||||
if (ext2fs_test_inode_bitmap(fs->inode_map,inode))
|
||||
com_err(argv[0], 0, "Warning: inode already set");
|
||||
ext2fs_mark_inode_bitmap(fs,fs->inode_map,inode);
|
||||
ext2fs_mark_inode_bitmap(fs->inode_map,inode);
|
||||
ext2fs_mark_ib_dirty(fs);
|
||||
}
|
||||
|
||||
@ -414,7 +414,7 @@ void do_testi(int argc, char *argv[])
|
||||
if (!inode)
|
||||
return;
|
||||
|
||||
if (ext2fs_test_inode_bitmap(fs,fs->inode_map,inode))
|
||||
if (ext2fs_test_inode_bitmap(fs->inode_map,inode))
|
||||
printf("Inode %ld is marked in use\n", inode);
|
||||
else
|
||||
printf("Inode %ld is not in use\n", inode);
|
||||
@ -441,9 +441,9 @@ void do_freeb(int argc, char *argv[])
|
||||
com_err(argv[0], 0, "No block 0");
|
||||
return;
|
||||
}
|
||||
if (!ext2fs_test_block_bitmap(fs,fs->block_map,block))
|
||||
if (!ext2fs_test_block_bitmap(fs->block_map,block))
|
||||
com_err(argv[0], 0, "Warning: block already clear");
|
||||
ext2fs_unmark_block_bitmap(fs,fs->block_map,block);
|
||||
ext2fs_unmark_block_bitmap(fs->block_map,block);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
}
|
||||
|
||||
@ -467,9 +467,9 @@ void do_setb(int argc, char *argv[])
|
||||
com_err(argv[0], 0, "No block 0");
|
||||
return;
|
||||
}
|
||||
if (ext2fs_test_block_bitmap(fs,fs->block_map,block))
|
||||
if (ext2fs_test_block_bitmap(fs->block_map,block))
|
||||
com_err(argv[0], 0, "Warning: block already set");
|
||||
ext2fs_mark_block_bitmap(fs,fs->block_map,block);
|
||||
ext2fs_mark_block_bitmap(fs->block_map,block);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
}
|
||||
|
||||
@ -489,7 +489,7 @@ void do_testb(int argc, char *argv[])
|
||||
com_err(argv[0], 0, "No block 0");
|
||||
return;
|
||||
}
|
||||
if (ext2fs_test_block_bitmap(fs,fs->block_map,block))
|
||||
if (ext2fs_test_block_bitmap(fs->block_map,block))
|
||||
printf("Block %ld marked in use\n", block);
|
||||
else printf("Block %ld not in use\n", block);
|
||||
}
|
||||
@ -719,22 +719,6 @@ void do_change_working_dir(int argc, char *argv[])
|
||||
return;
|
||||
}
|
||||
|
||||
void do_iname(int argc, char *argv[])
|
||||
{
|
||||
ino_t inode;
|
||||
|
||||
if (argc > 2) {
|
||||
com_err(argv[0], 0, "Usage: iname <inode>");
|
||||
return;
|
||||
}
|
||||
if (check_fs_open(argv[0]))
|
||||
return;
|
||||
|
||||
inode = strtoul(argv[1], NULL, 0);
|
||||
com_err(argv[0],0,"Function unimplemented");
|
||||
return;
|
||||
}
|
||||
|
||||
void do_print_working_directory(int argc, char *argv[])
|
||||
{
|
||||
int retval;
|
||||
@ -932,10 +916,6 @@ void do_find_free_inode(int argc, char *argv[])
|
||||
printf("Free inode found: %ld\n", free_inode);
|
||||
}
|
||||
|
||||
/*
|
||||
* Doesn't change directories count ---> add this later
|
||||
*/
|
||||
|
||||
void do_mkdir(int argc, char *argv[])
|
||||
{
|
||||
char *cp;
|
||||
@ -983,7 +963,7 @@ void do_rmdir(int argc, char *argv[])
|
||||
int release_blocks_proc(ext2_filsys fs, blk_t *blocknr, int blockcnt, void *private)
|
||||
{
|
||||
printf("%ld ", *blocknr);
|
||||
ext2fs_unmark_block_bitmap(fs,fs->block_map,*blocknr);
|
||||
ext2fs_unmark_block_bitmap(fs->block_map,*blocknr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -997,7 +977,7 @@ void kill_file_by_inode(ino_t inode)
|
||||
|
||||
printf("Kill file by inode %ld\n", inode);
|
||||
ext2fs_block_iterate(fs,inode,0,NULL,release_blocks_proc,NULL);
|
||||
ext2fs_unmark_inode_bitmap(fs,fs->inode_map,inode);
|
||||
ext2fs_unmark_inode_bitmap(fs->inode_map,inode);
|
||||
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
ext2fs_mark_ib_dirty(fs);
|
||||
|
143
debugfs/dump.c
Normal file
143
debugfs/dump.c
Normal file
@ -0,0 +1,143 @@
|
||||
/*
|
||||
* dump.c --- dump the contents of an inode out to a file
|
||||
*
|
||||
* Copyright (C) 1994 Theodore Ts'o. This file may be redistributed
|
||||
* under the terms of the GNU Public License.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "debugfs.h"
|
||||
|
||||
struct dump_block_struct {
|
||||
int fd;
|
||||
char *buf;
|
||||
errcode_t errcode;
|
||||
};
|
||||
|
||||
int dump_block(ext2_filsys fs, blk_t *blocknr, int blockcnt, void
|
||||
*private)
|
||||
{
|
||||
ssize_t nbytes;
|
||||
|
||||
struct dump_block_struct *rec = (struct dump_block_struct *) private;
|
||||
|
||||
if (blockcnt < 0)
|
||||
return 0;
|
||||
|
||||
if (*blocknr) {
|
||||
rec->errcode = io_channel_read_blk(fs->io, *blocknr,
|
||||
1, rec->buf);
|
||||
if (rec->errcode)
|
||||
return BLOCK_ABORT;
|
||||
} else
|
||||
memset(rec->buf, 0, fs->blocksize);
|
||||
|
||||
retry_write:
|
||||
nbytes = write(rec->fd, rec->buf, fs->blocksize);
|
||||
if (nbytes == -1) {
|
||||
if (errno == EINTR)
|
||||
goto retry_write;
|
||||
rec->errcode = errno;
|
||||
return BLOCK_ABORT;
|
||||
}
|
||||
if (nbytes != fs->blocksize) {
|
||||
/* XXX not quite right, but good enough */
|
||||
rec->errcode = EXT2_ET_SHORT_WRITE;
|
||||
return BLOCK_ABORT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dump_file(char *cmdname, ino_t inode, int fd, char *outname)
|
||||
{
|
||||
errcode_t retval;
|
||||
struct dump_block_struct rec;
|
||||
|
||||
rec.fd = fd;
|
||||
rec.errcode = 0;
|
||||
rec.buf = malloc(fs->blocksize);
|
||||
|
||||
if (rec.buf == 0) {
|
||||
com_err(cmdname, ENOMEM, "while allocating block buffer for dump_inode");
|
||||
return;
|
||||
}
|
||||
|
||||
retval = ext2fs_block_iterate(fs, inode, 0, NULL,
|
||||
dump_block, &rec);
|
||||
if (retval) {
|
||||
com_err(cmdname, retval, "while iterating over blocks in %s",
|
||||
outname);
|
||||
goto cleanup;
|
||||
}
|
||||
if (rec.errcode) {
|
||||
com_err(cmdname, retval, "in dump_block while dumping %s",
|
||||
outname);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
free(rec.buf);
|
||||
return;
|
||||
}
|
||||
|
||||
void do_dump(int argc, char **argv)
|
||||
{
|
||||
ino_t inode;
|
||||
int fd;
|
||||
|
||||
if (argc != 3) {
|
||||
com_err(argv[0], 0, "Usage: dump_inode <file> <output_file>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (check_fs_open(argv[0]))
|
||||
return;
|
||||
|
||||
inode = string_to_inode(argv[1]);
|
||||
if (!inode)
|
||||
return;
|
||||
|
||||
fd = open(argv[2], O_CREAT | O_WRONLY | O_TRUNC, 0666);
|
||||
if (fd < 0) {
|
||||
com_err(argv[0], errno, "while opening %s for dump_inode",
|
||||
argv[2]);
|
||||
return;
|
||||
}
|
||||
|
||||
dump_file(argv[0], inode, fd, argv[2]);
|
||||
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
void do_cat(int argc, char **argv)
|
||||
{
|
||||
ino_t inode;
|
||||
|
||||
if (argc != 2) {
|
||||
com_err(argv[0], 0, "Usage: cat <file>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (check_fs_open(argv[0]))
|
||||
return;
|
||||
|
||||
inode = string_to_inode(argv[1]);
|
||||
if (!inode)
|
||||
return;
|
||||
|
||||
dump_file(argv[0], inode, 0, argv[2]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
186
debugfs/lsdel.c
Normal file
186
debugfs/lsdel.c
Normal file
@ -0,0 +1,186 @@
|
||||
/*
|
||||
* undelete.c --- routines to try to help a user recover a deleted file.
|
||||
*
|
||||
* Copyright (C) 1994 Theodore Ts'o. This file may be redistributed
|
||||
* under the terms of the GNU Public License.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "debugfs.h"
|
||||
|
||||
struct deleted_info {
|
||||
ino_t ino;
|
||||
unsigned short mode;
|
||||
unsigned short uid;
|
||||
unsigned long size;
|
||||
time_t dtime;
|
||||
int num_blocks;
|
||||
int free_blocks;
|
||||
};
|
||||
|
||||
struct lsdel_struct {
|
||||
ino_t inode;
|
||||
int num_blocks;
|
||||
int free_blocks;
|
||||
int bad_blocks;
|
||||
};
|
||||
|
||||
int deleted_info_compare(const void *a, const void *b)
|
||||
{
|
||||
struct deleted_info *arg1, *arg2;
|
||||
|
||||
arg1 = (struct deleted_info *) a;
|
||||
arg2 = (struct deleted_info *) b;
|
||||
|
||||
return arg1->dtime - arg2->dtime;
|
||||
}
|
||||
|
||||
int lsdel_proc(ext2_filsys fs,
|
||||
blk_t *block_nr,
|
||||
int blockcnt,
|
||||
void *private)
|
||||
{
|
||||
struct lsdel_struct *lsd = (struct lsdel_struct *) private;
|
||||
|
||||
lsd->num_blocks++;
|
||||
|
||||
if (*block_nr < fs->super->s_first_data_block ||
|
||||
*block_nr >= fs->super->s_blocks_count) {
|
||||
lsd->bad_blocks++;
|
||||
return BLOCK_ABORT;
|
||||
}
|
||||
|
||||
if (!ext2fs_test_block_bitmap(fs->block_map,*block_nr))
|
||||
lsd->free_blocks++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void do_lsdel(int argc, char **argv)
|
||||
{
|
||||
struct lsdel_struct lsd;
|
||||
struct deleted_info *delarray;
|
||||
int num_delarray, max_delarray;
|
||||
ext2_inode_scan scan = 0;
|
||||
ino_t ino;
|
||||
struct ext2_inode inode;
|
||||
errcode_t retval;
|
||||
char *block_buf;
|
||||
int i;
|
||||
|
||||
if (argc > 1) {
|
||||
com_err(argv[0], 0, "Usage: ls_deleted_inodes\n");
|
||||
return;
|
||||
}
|
||||
if (check_fs_open(argv[0]))
|
||||
return;
|
||||
|
||||
max_delarray = 100;
|
||||
num_delarray = 0;
|
||||
delarray = malloc(max_delarray * sizeof(struct deleted_info));
|
||||
if (!delarray) {
|
||||
com_err("ls_deleted_inodes", ENOMEM,
|
||||
"while allocating deleted information storage");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
block_buf = malloc(fs->blocksize * 3);
|
||||
if (!block_buf) {
|
||||
com_err("ls_deleted_inodes", ENOMEM, "while allocating block buffer");
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
retval = ext2fs_open_inode_scan(fs, 0, &scan);
|
||||
if (retval) {
|
||||
com_err("ls_deleted_inodes", retval,
|
||||
"while opening inode scan");
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
retval = ext2fs_get_next_inode(scan, &ino, &inode);
|
||||
if (retval) {
|
||||
com_err("ls_deleted_inodes", retval,
|
||||
"while starting inode scan");
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
while (ino) {
|
||||
if (inode.i_dtime == 0)
|
||||
goto next;
|
||||
|
||||
lsd.inode = ino;
|
||||
lsd.num_blocks = 0;
|
||||
lsd.free_blocks = 0;
|
||||
lsd.bad_blocks = 0;
|
||||
|
||||
retval = ext2fs_block_iterate(fs, ino, 0, block_buf,
|
||||
lsdel_proc, &lsd);
|
||||
if (retval) {
|
||||
com_err("ls_deleted_inodes", retval,
|
||||
"while calling ext2_block_iterate");
|
||||
goto next;
|
||||
}
|
||||
if (lsd.free_blocks && !lsd.bad_blocks) {
|
||||
if (num_delarray >= max_delarray) {
|
||||
max_delarray += 50;
|
||||
delarray = realloc(delarray,
|
||||
max_delarray * sizeof(struct deleted_info));
|
||||
if (!delarray) {
|
||||
com_err("ls_deleted_inodes",
|
||||
ENOMEM,
|
||||
"while reallocating array");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
delarray[num_delarray].ino = ino;
|
||||
delarray[num_delarray].mode = inode.i_mode;
|
||||
delarray[num_delarray].uid = inode.i_uid;
|
||||
delarray[num_delarray].size = inode.i_size;
|
||||
delarray[num_delarray].dtime = inode.i_dtime;
|
||||
delarray[num_delarray].num_blocks = lsd.num_blocks;
|
||||
delarray[num_delarray].free_blocks = lsd.free_blocks;
|
||||
num_delarray++;
|
||||
}
|
||||
|
||||
next:
|
||||
retval = ext2fs_get_next_inode(scan, &ino, &inode);
|
||||
if (retval) {
|
||||
com_err("ls_deleted_inodes", retval,
|
||||
"while doing inode scan");
|
||||
goto error_out;
|
||||
}
|
||||
}
|
||||
|
||||
printf("%d deleted inodes found.\n", num_delarray);
|
||||
printf(" Inode Owner Mode Size Blocks Time deleted\n");
|
||||
|
||||
qsort(delarray, num_delarray, sizeof(struct deleted_info),
|
||||
deleted_info_compare);
|
||||
|
||||
for (i = 0; i < num_delarray; i++) {
|
||||
printf("%6lu %6d %6o %6lu %4d/%4d %s", delarray[i].ino,
|
||||
delarray[i].uid, delarray[i].mode, delarray[i].size,
|
||||
delarray[i].free_blocks, delarray[i].num_blocks,
|
||||
ctime(&delarray[i].dtime));
|
||||
}
|
||||
|
||||
error_out:
|
||||
free(block_buf);
|
||||
free(delarray);
|
||||
if (scan)
|
||||
ext2fs_close_inode_scan(scan);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
282
e2fsck/.depend
282
e2fsck/.depend
@ -3,227 +3,231 @@ badblocks.o : badblocks.c /usr/include/time.h /usr/include/features.h /usr/inclu
|
||||
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/sys/time.h /usr/include/linux/time.h \
|
||||
/usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/sys/stat.h \
|
||||
/usr/include/linux/stat.h /usr/include/sys/time.h /usr/include/linux/time.h \
|
||||
/usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
|
||||
/usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
|
||||
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
|
||||
/usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
|
||||
/usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
|
||||
/usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
|
||||
/usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
|
||||
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
|
||||
/usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h \
|
||||
../lib/ext2fs/ext2fs.h ../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
/usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h ../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h \
|
||||
../lib/ext2fs/bitops.h
|
||||
dirinfo.o : dirinfo.c ../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
e2fsck.h /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/sys/stat.h /usr/include/linux/stat.h \
|
||||
/usr/include/sys/time.h /usr/include/linux/time.h /usr/include/time.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
e2fsck.o : e2fsck.c /usr/include/string.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/fcntl.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/linux/fcntl.h /usr/include/ctype.h /usr/include/termios.h \
|
||||
/usr/include/linux/termios.h /usr/include/time.h /usr/include/getopt.h /usr/include/unistd.h \
|
||||
/usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/mntent.h /usr/include/stdio.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \
|
||||
/usr/include/malloc.h ../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
e2fsck.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/sys/stat.h /usr/include/linux/stat.h \
|
||||
/usr/include/sys/time.h /usr/include/linux/time.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/sys/time.h \
|
||||
/usr/include/linux/time.h /usr/include/time.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
|
||||
/usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
|
||||
/usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h ../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h \
|
||||
../lib/ext2fs/bitops.h ../version.h
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
e2fsck.o : e2fsck.c /usr/include/string.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/fcntl.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/ctype.h /usr/include/termios.h /usr/include/linux/termios.h /usr/include/time.h \
|
||||
/usr/include/getopt.h /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h \
|
||||
/usr/include/mntent.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/linux/ioctl.h /usr/include/malloc.h ../lib/et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h e2fsck.h /usr/include/stdlib.h \
|
||||
/usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/sys/time.h \
|
||||
/usr/include/linux/time.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h ../version.h
|
||||
ehandler.o : ehandler.c /usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/string.h /usr/include/ctype.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/sys/resource.h /usr/include/sys/time.h /usr/include/linux/time.h \
|
||||
/usr/include/time.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/limits.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/posix1_lim.h /usr/include/linux/limits.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/unistd.h \
|
||||
/usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/asm/types.h /usr/include/string.h /usr/include/ctype.h /usr/include/termios.h \
|
||||
/usr/include/linux/termios.h /usr/include/sys/resource.h /usr/include/sys/time.h \
|
||||
/usr/include/linux/time.h /usr/include/time.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/limits.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/syslimits.h /usr/include/limits.h \
|
||||
/usr/include/posix1_lim.h /usr/include/linux/limits.h /usr/include/posix2_lim.h \
|
||||
/usr/include/linux/resource.h e2fsck.h /usr/include/stdio.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
|
||||
/usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
|
||||
/usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h ../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../lib/ext2fs/io.h \
|
||||
../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
flushb.o : flushb.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/sys/ioctl.h \
|
||||
/usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
|
||||
/usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
|
||||
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
|
||||
/usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
|
||||
/usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
|
||||
/usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
|
||||
/usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
|
||||
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
|
||||
/usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h
|
||||
/usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h
|
||||
mtrace.o : mtrace.c ./malloc.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/limits.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/syslimits.h /usr/include/limits.h \
|
||||
/usr/include/posix1_lim.h /usr/include/linux/limits.h /usr/include/stdlib.h \
|
||||
/usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h
|
||||
/usr/include/posix1_lim.h /usr/include/linux/limits.h /usr/include/posix2_lim.h \
|
||||
/usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h
|
||||
pass1.o : pass1.c /usr/include/time.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h e2fsck.h \
|
||||
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/sys/time.h /usr/include/linux/time.h \
|
||||
/usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/sys/stat.h \
|
||||
/usr/include/linux/stat.h /usr/include/sys/time.h /usr/include/linux/time.h \
|
||||
/usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
|
||||
/usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
|
||||
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
|
||||
/usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
|
||||
/usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
|
||||
/usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
|
||||
/usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
|
||||
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
|
||||
/usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h \
|
||||
../lib/ext2fs/ext2fs.h ../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
/usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h ../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h \
|
||||
../lib/ext2fs/bitops.h
|
||||
pass1b.o : pass1b.c /usr/include/time.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h e2fsck.h \
|
||||
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/sys/time.h /usr/include/linux/time.h \
|
||||
/usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/sys/stat.h \
|
||||
/usr/include/linux/stat.h /usr/include/sys/time.h /usr/include/linux/time.h \
|
||||
/usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
|
||||
/usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
|
||||
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
|
||||
/usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
|
||||
/usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
|
||||
/usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
|
||||
/usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
|
||||
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
|
||||
/usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h \
|
||||
../lib/ext2fs/ext2fs.h ../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
/usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h ../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h \
|
||||
../lib/ext2fs/bitops.h
|
||||
pass2.o : pass2.c ../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
e2fsck.h /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/sys/stat.h /usr/include/linux/stat.h \
|
||||
/usr/include/sys/time.h /usr/include/linux/time.h /usr/include/time.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/sys/time.h \
|
||||
/usr/include/linux/time.h /usr/include/time.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
pass3.o : pass3.c ../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
e2fsck.h /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/sys/stat.h /usr/include/linux/stat.h \
|
||||
/usr/include/sys/time.h /usr/include/linux/time.h /usr/include/time.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/sys/time.h \
|
||||
/usr/include/linux/time.h /usr/include/time.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
pass4.o : pass4.c e2fsck.h /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/sys/stat.h /usr/include/linux/stat.h \
|
||||
/usr/include/sys/time.h /usr/include/linux/time.h /usr/include/time.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/sys/time.h \
|
||||
/usr/include/linux/time.h /usr/include/time.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../lib/ext2fs/io.h \
|
||||
../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
pass5.o : pass5.c ../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
e2fsck.h /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/sys/stat.h /usr/include/linux/stat.h \
|
||||
/usr/include/sys/time.h /usr/include/linux/time.h /usr/include/time.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/sys/time.h \
|
||||
/usr/include/linux/time.h /usr/include/time.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
scantest.o : scantest.c /usr/include/string.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/fcntl.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/ctype.h /usr/include/termios.h /usr/include/linux/termios.h /usr/include/time.h \
|
||||
/usr/include/getopt.h /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h \
|
||||
/usr/include/mntent.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/linux/ioctl.h /usr/include/malloc.h /usr/include/sys/resource.h \
|
||||
/usr/include/sys/time.h /usr/include/linux/time.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/limits.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/syslimits.h /usr/include/limits.h \
|
||||
/usr/include/posix1_lim.h /usr/include/linux/limits.h /usr/include/posix2_lim.h \
|
||||
/usr/include/linux/resource.h ../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../version.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/sys/stat.h \
|
||||
/usr/include/linux/stat.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
|
||||
/usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
|
||||
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
|
||||
/usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
|
||||
/usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h ../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h \
|
||||
../lib/ext2fs/bitops.h
|
||||
util.o : util.c /usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/string.h /usr/include/ctype.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/sys/resource.h /usr/include/sys/time.h /usr/include/linux/time.h \
|
||||
/usr/include/time.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/limits.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/posix1_lim.h /usr/include/linux/limits.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/unistd.h \
|
||||
/usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/asm/types.h /usr/include/string.h /usr/include/ctype.h /usr/include/termios.h \
|
||||
/usr/include/linux/termios.h /usr/include/sys/resource.h /usr/include/sys/time.h \
|
||||
/usr/include/linux/time.h /usr/include/time.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/limits.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/syslimits.h /usr/include/limits.h \
|
||||
/usr/include/posix1_lim.h /usr/include/linux/limits.h /usr/include/posix2_lim.h \
|
||||
/usr/include/linux/resource.h e2fsck.h /usr/include/stdio.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
|
||||
/usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
|
||||
/usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h ../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../lib/ext2fs/io.h ../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/umsdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/ext2_fs.h ../lib/ext2fs/ext2fs.h \
|
||||
../lib/et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../lib/ext2fs/io.h \
|
||||
../lib/ext2fs/ext2_err.h ../lib/ext2fs/bitops.h
|
||||
|
70
e2fsck/ChangeLog
Normal file
70
e2fsck/ChangeLog
Normal file
@ -0,0 +1,70 @@
|
||||
Sat Mar 11 13:12:16 1995 Theodore Y. Ts'o <tytso@localhost>
|
||||
|
||||
* pass1.c (unwind_pass1): Clear the file type statistics counter
|
||||
when pass 1 needs to be restarted from scratch.
|
||||
|
||||
* pass1.c (handle_fs_bad_blocks): Fix bug where bitmap blocks were
|
||||
being reallocated to blocks in the next block group,
|
||||
instead of the current block grup.
|
||||
|
||||
* pass1.c (pass1, check_blocks): Set inode_link_info[ino] whenever
|
||||
inode.i_links_count is set.
|
||||
|
||||
Tue Feb 14 01:38:04 1995 Theodore Y. Ts'o (tytso@rt-11)
|
||||
|
||||
* pass1.c (process_block): Add checks for if the block is
|
||||
trepassing on a superblock or group descriptor table.
|
||||
|
||||
Sat Dec 31 00:52:11 1994 <tytso@rsx-11.mit.edu>
|
||||
|
||||
* main.c (corrupt_msg): Extend the message which is printed out
|
||||
when the superblock is corrupt, to include the suggestion
|
||||
of using the -b option to specify an alternate superblock.
|
||||
|
||||
Thu Nov 24 09:29:58 1994 Theodore Y. Ts'o (tytso@rt-11)
|
||||
|
||||
* badblocks.c (read_bad_blocks_file): If we are adding or
|
||||
replacing bad blocks in the bad blocks inode, sanity check
|
||||
the bad block inode first, and clear out any illegal blocks.
|
||||
|
||||
* pass2.c (check_name): Don't bomb out if the attempt to get the
|
||||
pathname of the containing directory returns an error; the
|
||||
directory may be too badly damaged to expect that
|
||||
ext2fs_get_pathname will always succeed. Use "???" if the
|
||||
pathname can't be obtained (it's only for a printf to the
|
||||
user anyway).
|
||||
|
||||
The name of the containing directory and the bad filename
|
||||
were incorrectly interchanged in the user message. Fixed.
|
||||
|
||||
* pass2.c (check_name, check_dir_block): Use a common static
|
||||
string for the unknown pathname.
|
||||
|
||||
Mon Nov 7 22:30:54 1994 Remy Card <card@bbj>
|
||||
|
||||
* Fixed lots of printf formats to make sure that block and inode
|
||||
numbers are printed as unsigned integers.
|
||||
|
||||
Mon Oct 24 14:10:46 1994 (tytso@rsx-11)
|
||||
|
||||
* pass5.c (check_block_end): Fix calculation of how the last block
|
||||
in the block bitmap should be calculated.
|
||||
|
||||
Wed Sep 7 10:01:13 1994 (tytso@rsx-11)
|
||||
|
||||
* pass1b.c (pass1_dupblocks): Fix declaration of dup_inode_map to
|
||||
be an ext2fs_inode_bitmap, and free it properly.
|
||||
|
||||
* e2fsck.h
|
||||
* e2fsck.c (main): Folded in Remy Card's changes to add a revision
|
||||
level to the superblock.
|
||||
|
||||
Wed Aug 17 22:00:20 1994 Remy Card (card@bbj)
|
||||
|
||||
* e2fsck.c (usage): Fixed bogus usage message.
|
||||
|
||||
Wed Aug 17 11:21:45 1994 Theodore Y. Ts'o (tytso@rt-11)
|
||||
|
||||
* pass1.c (process_bad_block): Fixed bug so that blocks in the
|
||||
backup superblocks and group descriptors are handled gracefully.
|
||||
|
@ -9,8 +9,6 @@ CFLAGS= $(PROF) $(OPT) $(MTRACE) $(MCHECK) $(WFLAGS) -I../lib
|
||||
LDFLAGS= $(PROF) $(OPT)
|
||||
PROGS= e2fsck flushb
|
||||
MANPAGES= e2fsck.8
|
||||
BINDIR= $(SBINDIR)
|
||||
MANDIR= $(SMANDIR)
|
||||
|
||||
LIBS= -L../lib -lss -lcom_err -lext2fs $(CHECKLIB)
|
||||
DEPLIBS= ../lib/libss.a ../lib/libcom_err.a ../lib/libext2fs.a
|
||||
@ -20,7 +18,7 @@ DEPLIBS= ../lib/libss.a ../lib/libcom_err.a ../lib/libext2fs.a
|
||||
# Note: The optimization flags must include -g
|
||||
#
|
||||
#MCHECK= -checker
|
||||
#LIBS= -L../lib -lss -lcom_err -lext2fs $(CHECKLIB)
|
||||
#LIBS= -L../lib -lss -lcom_err -le2fs $(CHECKLIB)
|
||||
#DEPLIBS= ../lib/libss.a ../lib/libcom_err.a ../lib/libext2fs.a
|
||||
#CHECKLIB= /usr/lib/libchecker.o
|
||||
|
||||
@ -54,26 +52,34 @@ all: $(PROGS)
|
||||
# cc $(LDFLAGS) -o e2fsck $(OBJS) $(LIBS)
|
||||
|
||||
e2fsck: $(OBJS) $(DEPLIBS)
|
||||
cc $(LDFLAGS) -static -o e2fsck $(OBJS) $(LIBS)
|
||||
$(CC) $(LDFLAGS) -static -o e2fsck $(OBJS) $(LIBS)
|
||||
|
||||
flushb: flushb.o
|
||||
cc $(LDFLAGS) -o flushb flushb.o $(CHECKLIB)
|
||||
$(CC) $(LDFLAGS) -o flushb flushb.o $(CHECKLIB)
|
||||
|
||||
install:: $(PROGS)
|
||||
for i in $(PROGS); do \
|
||||
$(INSTALLBIN) $$i $(BINDIR)/$$i; \
|
||||
done
|
||||
ln -sf e2fsck $(BINDIR)/fsck.ext2
|
||||
$(INSTALLBIN) e2fsck $(SBINDIR)/e2fsck
|
||||
$(INSTALLBIN) flushb $(USRSBINDIR)/flushb
|
||||
ln -sf e2fsck $(SBINDIR)/fsck.ext2
|
||||
|
||||
install:: $(MANPAGES)
|
||||
for i in $(MANPAGES); do \
|
||||
$(INSTALLMAN) $$i $(MANDIR)/$$i; \
|
||||
$(INSTALLMAN) $$i $(SMANDIR)/$$i; \
|
||||
done
|
||||
|
||||
install-tree:: $(PROGS)
|
||||
for i in $(PROGS); do \
|
||||
rm -f ../bin/$$i; \
|
||||
cp $$i ../bin; \
|
||||
strip ../bin/$$i; \
|
||||
chmod 555 ../bin/$$i; \
|
||||
done
|
||||
ln -sf e2fsck ../bin/fsck.ext2
|
||||
|
||||
clean:
|
||||
rm -f $(PROGS) \#* *\# *.s *.o *.a *~ core
|
||||
|
||||
really-clean:
|
||||
really-clean: clean
|
||||
rm -f .depend
|
||||
|
||||
dep depend .depend:
|
||||
|
@ -10,6 +10,10 @@
|
||||
#include <et/com_err.h>
|
||||
#include "e2fsck.h"
|
||||
|
||||
static int check_bb_inode_blocks(ext2_filsys fs, blk_t *block_nr, int blockcnt,
|
||||
void *private);
|
||||
|
||||
|
||||
static void invalid_block(ext2_filsys fs, blk_t blk)
|
||||
{
|
||||
printf("Bad block %lu out of range; ignored.\n", blk);
|
||||
@ -24,6 +28,19 @@ void read_bad_blocks_file(ext2_filsys fs, const char *bad_blocks_file,
|
||||
FILE *f;
|
||||
|
||||
read_bitmaps(fs);
|
||||
|
||||
/*
|
||||
* Make sure the bad block inode is sane. If there are any
|
||||
* illegal blocks, clear them.
|
||||
*/
|
||||
retval = ext2fs_block_iterate(fs, EXT2_BAD_INO, 0, 0,
|
||||
check_bb_inode_blocks, 0);
|
||||
if (retval) {
|
||||
com_err("ext2fs_block_iterate", retval,
|
||||
"while sanity checking the bad blocks inode");
|
||||
fatal_error(0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* If we're appending to the bad blocks inode, read in the
|
||||
@ -69,6 +86,25 @@ void read_bad_blocks_file(ext2_filsys fs, const char *bad_blocks_file,
|
||||
return;
|
||||
}
|
||||
|
||||
static int check_bb_inode_blocks(ext2_filsys fs, blk_t *block_nr, int blockcnt,
|
||||
void *private)
|
||||
{
|
||||
if (!*block_nr)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* If the block number is outrageous, clear it and ignore it.
|
||||
*/
|
||||
if (*block_nr >= fs->super->s_blocks_count ||
|
||||
*block_nr < fs->super->s_first_data_block) {
|
||||
printf("Warning illegal block %lu found in bad block inode. Cleared.\n", *block_nr);
|
||||
*block_nr = 0;
|
||||
return BLOCK_CHANGED;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void test_disk(ext2_filsys fs)
|
||||
{
|
||||
errcode_t retval;
|
||||
|
@ -35,7 +35,7 @@ void add_dir_info(ext2_filsys fs, ino_t ino, ino_t parent,
|
||||
int i, j;
|
||||
|
||||
#if 0
|
||||
printf("add_dir_info for inode %d...\n", ino);
|
||||
printf("add_dir_info for inode %lu...\n", ino);
|
||||
#endif
|
||||
if (!dir_info) {
|
||||
dir_info_count = 0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
.\" Copyright 1993, 1994 by Theodore Ts'o. All Rights Reserved.
|
||||
.\" This file may be copied under the terms of the GNU Public License.
|
||||
.\"
|
||||
.TH NEW-E2FSCK 8 "March 1994" "Version 0.5"
|
||||
.TH E2FSCK 8 "November 1994" "Version 0.5b"
|
||||
.SH NAME
|
||||
e2fsck \- check a Linux second extended file system
|
||||
.SH SYNOPSIS
|
||||
@ -31,11 +31,26 @@ is used to check a Linux second extended file system.
|
||||
is the special file corresponding to the device (e.g /dev/hdXX).
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.I -a
|
||||
This option does the same thing as the
|
||||
.I -p
|
||||
option. It is provided for backwards compatibility only; it is
|
||||
suggested that people use
|
||||
.I -p
|
||||
option whever possible.
|
||||
.TP
|
||||
.I -b superblock
|
||||
Instead of using the normal superblock, use the alternative superblock
|
||||
specified by
|
||||
.IR superblock .
|
||||
.TP
|
||||
.I -B blocksize
|
||||
Normally, e2fsck will search for the superblock at various different
|
||||
block sizes in an attempt to find the appropriate block size. This
|
||||
search can be fooled in some cases. This option forces e2fsck to only
|
||||
try locating the superblock at a particular blocksize. If the
|
||||
superblock is not found, e2fsck will terminate with a fatal error.
|
||||
.TP
|
||||
.I -d
|
||||
Print debugging output (useless unless you are debugging
|
||||
.B e2fsck
|
||||
@ -77,9 +92,10 @@ to the filesystem.)
|
||||
.TP
|
||||
.I -p
|
||||
Automatically repair ("preen") the file system without any questions.
|
||||
The
|
||||
.I -a
|
||||
option is provided for backwards compatibility.
|
||||
.TP
|
||||
.I -r
|
||||
This option does nothing at all; it is provided only for backwards
|
||||
compatibility.
|
||||
.TP
|
||||
.I -t
|
||||
Print timing statistics for
|
||||
@ -118,10 +134,48 @@ is the sum of the following conditions:
|
||||
.br
|
||||
\ 128\ \-\ Shared library error
|
||||
.br
|
||||
.SH BUGS
|
||||
Almost any piece of software will have bugs. If you manage to find a
|
||||
filesystem which causes
|
||||
.B e2fsck
|
||||
to crash, or which
|
||||
.B e2fsck
|
||||
is unable to repair, please report it to the author.
|
||||
.PP
|
||||
Please include as much information as possible in your bug report.
|
||||
Ideally, include a complete transcript of the
|
||||
.B e2fsck
|
||||
run, so I can see exactly what error messages are displayed. If you
|
||||
have a writeable filesystem where the transcript can be stored, the
|
||||
.BR script (1)
|
||||
program is a handy way to save the output of
|
||||
.e2fsck
|
||||
to a file.
|
||||
.PP
|
||||
It is also useful to send the output of
|
||||
.BR dumpe2fs (8).
|
||||
If a specific inode or inodes seems to be giving
|
||||
.B e2fsck
|
||||
trouble, try running the
|
||||
.BR debugfs (8)
|
||||
command and send the output of the
|
||||
.I stat
|
||||
command run on the relevant inode(s). If the inode is a directory,
|
||||
the debugfs
|
||||
.I dump
|
||||
command will allow you to extract the contents of the directory inode,
|
||||
which can sent to me after being first run through
|
||||
.BR uuencode (1).
|
||||
.PP
|
||||
Always include the full version string which
|
||||
.B e2fsck
|
||||
displays when it is run, so I know which version you are running.
|
||||
.SH AUTHOR
|
||||
This version of
|
||||
.B e2fsck
|
||||
is written by Theodore Ts'o <tytso@mit.edu>.
|
||||
.SH SEE ALSO
|
||||
.BR mke2fs (8),
|
||||
.BR tune2fs (8)
|
||||
.BR tune2fs (8),
|
||||
.BR dumpe2fs (8),
|
||||
.BR debugfs (8)
|
||||
|
164
e2fsck/e2fsck.c
164
e2fsck/e2fsck.c
@ -51,6 +51,7 @@ int verbose = 0;
|
||||
int list = 0;
|
||||
int debug = 0;
|
||||
int force = 0;
|
||||
int invalid_bitmaps = 0;
|
||||
static int show_version_only = 0;
|
||||
|
||||
static int replace_bad_blocks = 0;
|
||||
@ -63,11 +64,17 @@ struct resource_track global_rtrack;
|
||||
static int root_filesystem = 0;
|
||||
static int read_only_root = 0;
|
||||
|
||||
int *invalid_inode_bitmap;
|
||||
int *invalid_block_bitmap;
|
||||
int *invalid_inode_table;
|
||||
int restart_e2fsck = 0;
|
||||
|
||||
static void usage(NOARGS)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Usage: %s [-panyrdfvtFV] [-b superblock] [-B blocksize]\n"
|
||||
"\t\tdevice\n", program_name);
|
||||
"Usage: %s [-panyrcdfvtFV] [-b superblock] [-B blocksize]\n"
|
||||
"\t\t[-I inode_buffer_blocks] [-P process_inode_size]\n"
|
||||
"\t\t[-l|-L bad_blocks_file] device\n", program_name);
|
||||
exit(FSCK_USAGE);
|
||||
}
|
||||
|
||||
@ -182,34 +189,133 @@ static void sync_disks(NOARGS)
|
||||
sync();
|
||||
}
|
||||
|
||||
#define MIN_CHECK 1
|
||||
#define MAX_CHECK 2
|
||||
|
||||
static const char *corrupt_msg = "\nThe filesystem superblock is corrupt. "
|
||||
"Try running e2fsck with an alternate\n"
|
||||
"superblock using the -b option. "
|
||||
"(8193 is commonly an alternate superblock;\n"
|
||||
"Hence, 'e2fsck -b 8193 <device>' may recover the filesystem.)\n\n";
|
||||
|
||||
static void check_super_value(const char *descr, unsigned long value,
|
||||
int flags, unsigned long min, unsigned long max)
|
||||
{
|
||||
if (((flags & MIN_CHECK) && (value < min)) ||
|
||||
((flags & MAX_CHECK) && (value > max))) {
|
||||
printf("Corruption found in superblock. (%s = %lu).\n",
|
||||
descr, value);
|
||||
printf(corrupt_msg);
|
||||
fatal_error(0);
|
||||
}
|
||||
}
|
||||
|
||||
static void check_super_block(ext2_filsys fs)
|
||||
{
|
||||
blk_t first_block, last_block;
|
||||
int blocks_per_group = fs->super->s_blocks_per_group;
|
||||
struct ext2_super_block *s = fs->super;
|
||||
blk_t blocks_per_group = fs->super->s_blocks_per_group;
|
||||
int i;
|
||||
blk_t should_be;
|
||||
|
||||
/*
|
||||
* Verify the super block constants...
|
||||
*/
|
||||
check_super_value("inodes_count", s->s_inodes_count,
|
||||
MIN_CHECK, 1, 0);
|
||||
check_super_value("blocks_count", s->s_blocks_count,
|
||||
MIN_CHECK, 1, 0);
|
||||
check_super_value("first_data_block", s->s_first_data_block,
|
||||
MAX_CHECK, 0, s->s_blocks_count);
|
||||
check_super_value("log_frag_size", s->s_log_frag_size,
|
||||
MAX_CHECK, 0, 2);
|
||||
check_super_value("log_block_size", s->s_log_block_size,
|
||||
MIN_CHECK | MAX_CHECK, s->s_log_frag_size,
|
||||
2);
|
||||
check_super_value("frags_per_group", s->s_frags_per_group,
|
||||
MIN_CHECK | MAX_CHECK, 1, 8 * EXT2_BLOCK_SIZE(s));
|
||||
check_super_value("blocks_per_group", s->s_blocks_per_group,
|
||||
MIN_CHECK | MAX_CHECK, 1, 8 * EXT2_BLOCK_SIZE(s));
|
||||
check_super_value("inodes_per_group", s->s_inodes_per_group,
|
||||
MIN_CHECK, 1, 0);
|
||||
check_super_value("r_blocks_count", s->s_r_blocks_count,
|
||||
MAX_CHECK, 0, s->s_blocks_count);
|
||||
|
||||
if (s->s_log_block_size != s->s_log_frag_size) {
|
||||
printf("Superblock block_size = %d, fragsize = %d.\n",
|
||||
EXT2_BLOCK_SIZE(s), EXT2_FRAG_SIZE(s));
|
||||
printf("This version of e2fsck does not support fragment "
|
||||
"sizes different\n"
|
||||
"from the block size.\n");
|
||||
fatal_error(0);
|
||||
}
|
||||
|
||||
should_be = s->s_frags_per_group /
|
||||
(s->s_log_block_size - s->s_log_frag_size + 1);
|
||||
if (s->s_blocks_per_group != should_be) {
|
||||
printf("Superblock blocks_per_group = %lu, should "
|
||||
"have been %lu\n", s->s_blocks_per_group,
|
||||
should_be);
|
||||
printf(corrupt_msg);
|
||||
}
|
||||
|
||||
should_be = (s->s_log_block_size == 0) ? 1 : 0;
|
||||
if (s->s_first_data_block != should_be) {
|
||||
printf("Superblock first_data_block = %lu, should "
|
||||
"have been %lu\n", s->s_first_data_block,
|
||||
should_be);
|
||||
printf(corrupt_msg);
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify the group descriptors....
|
||||
*/
|
||||
first_block = fs->super->s_first_data_block;
|
||||
last_block = first_block + blocks_per_group;
|
||||
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
if (i == fs->group_desc_count - 1)
|
||||
last_block = fs->super->s_blocks_count;
|
||||
if ((fs->group_desc[i].bg_block_bitmap < first_block) ||
|
||||
(fs->group_desc[i].bg_block_bitmap >= last_block)) {
|
||||
printf("Block bitmap %ld for group %d not in group.\n",
|
||||
printf("Block bitmap %lu for group %d is "
|
||||
"not in group.\n",
|
||||
fs->group_desc[i].bg_block_bitmap, i);
|
||||
fatal_error(0);
|
||||
preenhalt();
|
||||
if (!ask("Continue (and relocate)", 1)) {
|
||||
fatal_error(0);
|
||||
}
|
||||
fs->group_desc[i].bg_block_bitmap = 0;
|
||||
invalid_block_bitmap[i]++;
|
||||
invalid_bitmaps++;
|
||||
}
|
||||
if ((fs->group_desc[i].bg_inode_bitmap < first_block) ||
|
||||
(fs->group_desc[i].bg_inode_bitmap >= last_block)) {
|
||||
printf("Inode bitmap %ld for group %d not in group.\n",
|
||||
printf("Warning: Inode bitmap %lu for group %d "
|
||||
"not in group.\n",
|
||||
fs->group_desc[i].bg_inode_bitmap, i);
|
||||
fatal_error(0);
|
||||
preenhalt();
|
||||
if (!ask("Continue", 1)) {
|
||||
fatal_error(0);
|
||||
}
|
||||
fs->group_desc[i].bg_inode_bitmap = 0;
|
||||
invalid_inode_bitmap[i]++;
|
||||
invalid_bitmaps++;
|
||||
}
|
||||
if ((fs->group_desc[i].bg_inode_table < first_block) ||
|
||||
((fs->group_desc[i].bg_inode_table +
|
||||
fs->inode_blocks_per_group - 1) >= last_block)) {
|
||||
printf("Inode table %ld for group %d not in group.\n",
|
||||
printf("Warning: Inode table %lu for group %d "
|
||||
"not in group.\n",
|
||||
fs->group_desc[i].bg_inode_table, i);
|
||||
fatal_error(0);
|
||||
printf("WARNING: SEVERE DATA LOSS POSSIBLE.\n");
|
||||
preenhalt();
|
||||
if (!ask("Continue", 1)) {
|
||||
fatal_error(0);
|
||||
}
|
||||
fs->group_desc[i].bg_inode_table = 0;
|
||||
invalid_inode_table[i]++;
|
||||
invalid_bitmaps++;
|
||||
}
|
||||
first_block += fs->super->s_blocks_per_group;
|
||||
last_block += fs->super->s_blocks_per_group;
|
||||
@ -250,12 +356,13 @@ static void check_if_skip(ext2_filsys fs)
|
||||
|
||||
static void PRS(int argc, char *argv[])
|
||||
{
|
||||
int flush = 0;
|
||||
char c;
|
||||
int flush = 0;
|
||||
char c;
|
||||
#ifdef MTRACE
|
||||
extern void *mallwatch;
|
||||
extern void *mallwatch;
|
||||
#endif
|
||||
char *oldpath, newpath[PATH_MAX];
|
||||
char *oldpath;
|
||||
static char newpath[PATH_MAX];
|
||||
|
||||
/* Update our PATH to include /sbin */
|
||||
strcpy(newpath, "PATH=/sbin:");
|
||||
@ -392,6 +499,7 @@ int main (int argc, char *argv[])
|
||||
if (!isatty (0) || !isatty (1))
|
||||
die ("need terminal for interactive repairs");
|
||||
}
|
||||
restart:
|
||||
sync_disks();
|
||||
if (superblock && blocksize) {
|
||||
retval = ext2fs_open(device_name, rwflag ? EXT2_FLAG_RW : 0,
|
||||
@ -413,9 +521,21 @@ int main (int argc, char *argv[])
|
||||
if (retval) {
|
||||
com_err(program_name, retval, "while trying to open %s",
|
||||
device_name);
|
||||
printf("Couldn't find valid filesystem superblock.\n");
|
||||
if (retval == EXT2_ET_REV_TOO_HIGH)
|
||||
printf ("Get a newer version of e2fsck!\n");
|
||||
else
|
||||
printf(corrupt_msg);
|
||||
fatal_error(0);
|
||||
}
|
||||
|
||||
#ifdef EXT2_CURRENT_REV
|
||||
if (fs->super->s_rev_level > E2FSCK_CURRENT_REV) {
|
||||
com_err(program_name, retval, "while trying to open %s",
|
||||
device_name);
|
||||
printf ("Get a newer version of e2fsck!\n");
|
||||
fatal_error(0);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* If the user specified a specific superblock, presumably the
|
||||
* master superblock has been trashed. So we mark the
|
||||
@ -426,6 +546,16 @@ int main (int argc, char *argv[])
|
||||
|
||||
ehandler_init(fs->io);
|
||||
|
||||
invalid_inode_bitmap = allocate_memory(sizeof(int) *
|
||||
fs->group_desc_count,
|
||||
"invalid_inode_bitmap");
|
||||
invalid_block_bitmap = allocate_memory(sizeof(int) *
|
||||
fs->group_desc_count,
|
||||
"invalid_block_bitmap");
|
||||
invalid_inode_table = allocate_memory(sizeof(int) *
|
||||
fs->group_desc_count,
|
||||
"invalid_inode_table");
|
||||
|
||||
check_super_block(fs);
|
||||
check_if_skip(fs);
|
||||
if (bad_blocks_file)
|
||||
@ -439,6 +569,12 @@ int main (int argc, char *argv[])
|
||||
ext2fs_mark_valid(fs);
|
||||
|
||||
pass1(fs);
|
||||
if (restart_e2fsck) {
|
||||
ext2fs_close(fs);
|
||||
printf("Restarting e2fsck from the beginning...\n");
|
||||
restart_e2fsck = 0;
|
||||
goto restart;
|
||||
}
|
||||
pass2(fs);
|
||||
pass3(fs);
|
||||
pass4(fs);
|
||||
|
@ -37,6 +37,12 @@
|
||||
#define FSCK_USAGE 16 /* Usage or syntax error */
|
||||
#define FSCK_LIBRARY 128 /* Shared library error */
|
||||
|
||||
/*
|
||||
* The last ext2fs revision level that this version of e2fsck is able to
|
||||
* support
|
||||
*/
|
||||
#define E2FSCK_CURRENT_REV 0
|
||||
|
||||
/*
|
||||
* Inode count arrays
|
||||
*/
|
||||
@ -81,16 +87,21 @@ struct resource_track {
|
||||
extern const char * program_name;
|
||||
extern const char * device_name;
|
||||
|
||||
extern char * inode_used_map; /* Inodes which are in use */
|
||||
extern char * inode_bad_map; /* Inodes which are bad in some way */
|
||||
extern char * inode_dir_map; /* Inodes which are directories */
|
||||
extern ext2fs_inode_bitmap inode_used_map; /* Inodes which are in use */
|
||||
extern ext2fs_inode_bitmap inode_bad_map; /* Inodes which are bad somehow */
|
||||
extern ext2fs_inode_bitmap inode_dir_map; /* Inodes which are directories */
|
||||
|
||||
extern char * block_found_map; /* Blocks which are used by an inode */
|
||||
extern char * block_dup_map; /* Blocks which are used by more than once */
|
||||
extern ext2fs_block_bitmap block_found_map; /* Blocks which are in use */
|
||||
extern ext2fs_block_bitmap block_dup_map; /* Blocks which are used by more than once */
|
||||
|
||||
extern const char *fix_msg[2]; /* Fixed or ignored! */
|
||||
extern const char *clear_msg[2]; /* Cleared or ignored! */
|
||||
|
||||
extern int *invalid_inode_bitmap;
|
||||
extern int *invalid_block_bitmap;
|
||||
extern int *invalid_inode_table;
|
||||
extern int restart_e2fsck;
|
||||
|
||||
/* Command line options */
|
||||
extern int nflag;
|
||||
extern int yflag;
|
||||
@ -126,6 +137,8 @@ extern int fs_sockets_count;
|
||||
|
||||
extern struct resource_track global_rtrack;
|
||||
|
||||
extern int invalid_bitmaps;
|
||||
|
||||
/*
|
||||
* Procedure declarations
|
||||
*/
|
||||
@ -164,6 +177,10 @@ extern void preenhalt(NOARGS);
|
||||
extern void print_resource_track(struct resource_track *track);
|
||||
extern void init_resource_track(struct resource_track *track);
|
||||
extern int inode_has_valid_blocks(struct ext2_inode *inode);
|
||||
extern void e2fsck_read_inode(ext2_filsys fs, unsigned long ino,
|
||||
struct ext2_inode * inode, const char * proc);
|
||||
extern void e2fsck_write_inode(ext2_filsys fs, unsigned long ino,
|
||||
struct ext2_inode * inode, const char * proc);
|
||||
#ifdef MTRACE
|
||||
extern void mtrace_print(char *mesg);
|
||||
#endif
|
||||
|
@ -44,10 +44,10 @@ static errcode_t e2fsck_handle_read_error(io_channel channel,
|
||||
return 0;
|
||||
}
|
||||
if (operation)
|
||||
printf("Error reading block %ld (%s) while %s. ", block,
|
||||
printf("Error reading block %lu (%s) while %s. ", block,
|
||||
error_message(error), operation);
|
||||
else
|
||||
printf("Error reading block %ld (%s). ", block,
|
||||
printf("Error reading block %lu (%s). ", block,
|
||||
error_message(error));
|
||||
preenhalt();
|
||||
if (ask("Ignore error", 1))
|
||||
@ -84,10 +84,10 @@ static errcode_t e2fsck_handle_write_error(io_channel channel,
|
||||
}
|
||||
|
||||
if (operation)
|
||||
printf("Error writing block %ld (%s) while %s. ", block,
|
||||
printf("Error writing block %lu (%s) while %s. ", block,
|
||||
error_message(error), operation);
|
||||
else
|
||||
printf("Error writing block %ld (%s). ", block,
|
||||
printf("Error writing block %lu (%s). ", block,
|
||||
error_message(error));
|
||||
preenhalt();
|
||||
if (ask("Ignore error", 1))
|
||||
|
@ -15,14 +15,14 @@ follows:
|
||||
prepared to deal with)
|
||||
16 Usage or syntax error
|
||||
|
||||
During the regression test, the first exit code should be 1 (with the
|
||||
exception of the empty filesystem, empty.img, which will have an exit
|
||||
code of 0), and the second exit code should be 0. In other words, all
|
||||
of the test filesystems in this directory (with the exception of
|
||||
empty.img) have some sort of filesystem corruption, which e2fsck
|
||||
should fix on the first pass. After the first pass, e2fsck should
|
||||
leave a fully consistent filesystem with no detectable errors found in
|
||||
the second pass.
|
||||
During the regression test, the first exit code should be 1, and the
|
||||
second exit code should be 0. In other words, all (with one
|
||||
exception) of the test filesystems in this directory have some sort of
|
||||
filesystem corruption, which e2fsck should fix on the first pass.
|
||||
After the first pass, e2fsck should leave a fully consistent
|
||||
filesystem with no detectable errors found in the second pass. The
|
||||
exception is the okgroup.img filesystem, which contains no errors, and
|
||||
so both exit codes should be 0.
|
||||
|
||||
NOTE: It appears that at least some versions of the original e2fsck do
|
||||
not exit with an exit status code of 1 after correcting filesystem
|
||||
@ -35,6 +35,7 @@ Here's a one-line descriptons of the various test images in this
|
||||
directory:
|
||||
|
||||
baddir.img Filesystem with a corrupted directory
|
||||
badbblocks.img Filesystem with illegal blocks in the bad block inode.
|
||||
badinode.img Filesystem with various different corrupted inode
|
||||
entries.
|
||||
badlkcnt.img Filesystem with deleted files with non-zero link count
|
||||
@ -46,6 +47,10 @@ bitmaps.img Filesystem with corrupted inode and block bitmaps
|
||||
dirlink.img Filesystem with a hard link to a directory
|
||||
dup.img Filesystem with blocks claimed by two different files
|
||||
dup2.img Filesystem with blocks claimed by three different files
|
||||
dupfsblks.img Filesystem with blocks claimed by a file and
|
||||
inode/block bitmaps and inode tables
|
||||
dupsuper.img Filesystem with blocks claimed by a file and
|
||||
the superblock / group descriptors
|
||||
end-bitmap.img Filesystem with corruption at the end of the block
|
||||
bitmap
|
||||
expand.img Tests e2fsck's ability to expand lost+found if
|
||||
@ -54,6 +59,9 @@ lpf.img Filesystem with disconnected files and no /lost+found
|
||||
directory
|
||||
mke2fs2b.img Filesystem with corruption similar to that
|
||||
created by mke2fs version 0.2b
|
||||
noroot.img Filesystem with a deleted root directory.
|
||||
noroot.img Filesystem with a deleted root directory
|
||||
okgroup.img Filesystem that's exactly 8193 blocks long
|
||||
(otherwise OK)
|
||||
overfsblks.img Filesystem with overlapping inode and block bitmaps
|
||||
|
||||
|
||||
|
BIN
e2fsck/images/badbblocks.img.gz
Normal file
BIN
e2fsck/images/badbblocks.img.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
e2fsck/images/bitmapblks.img.gz
Normal file
BIN
e2fsck/images/bitmapblks.img.gz
Normal file
Binary file not shown.
BIN
e2fsck/images/dupfsblks.img.gz
Normal file
BIN
e2fsck/images/dupfsblks.img.gz
Normal file
Binary file not shown.
BIN
e2fsck/images/dupsuper.img.gz
Normal file
BIN
e2fsck/images/dupsuper.img.gz
Normal file
Binary file not shown.
BIN
e2fsck/images/illfsblks.img.gz
Normal file
BIN
e2fsck/images/illfsblks.img.gz
Normal file
Binary file not shown.
BIN
e2fsck/images/lotsbad.img.gz
Normal file
BIN
e2fsck/images/lotsbad.img.gz
Normal file
Binary file not shown.
BIN
e2fsck/images/messy_inode.img.gz
Normal file
BIN
e2fsck/images/messy_inode.img.gz
Normal file
Binary file not shown.
BIN
e2fsck/images/okgroup.img.gz
Normal file
BIN
e2fsck/images/okgroup.img.gz
Normal file
Binary file not shown.
BIN
e2fsck/images/overfsblks.img.gz
Normal file
BIN
e2fsck/images/overfsblks.img.gz
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
558
e2fsck/pass1.c
558
e2fsck/pass1.c
@ -48,13 +48,12 @@ int fs_total_count = 0;
|
||||
int fs_badblocks_count = 0;
|
||||
int fs_sockets_count = 0;
|
||||
|
||||
char * inode_used_map = 0; /* Inodes which are in use */
|
||||
char * inode_bad_map = 0; /* Inodes which are bad in some way */
|
||||
char * inode_dir_map = 0; /* Inodes which are directories */
|
||||
ext2fs_inode_bitmap inode_used_map = 0; /* Inodes which are in use */
|
||||
ext2fs_inode_bitmap inode_bad_map = 0; /* Inodes which are bad in some way */
|
||||
ext2fs_inode_bitmap inode_dir_map = 0; /* Inodes which are directories */
|
||||
|
||||
char * block_found_map = 0;
|
||||
char * block_dup_map = 0;
|
||||
static char * bad_fs_block_map = 0;
|
||||
ext2fs_block_bitmap block_found_map = 0;
|
||||
ext2fs_block_bitmap block_dup_map = 0;
|
||||
|
||||
static int fix_link_count = -1;
|
||||
|
||||
@ -64,25 +63,27 @@ static int process_block(ext2_filsys fs, blk_t *blocknr,
|
||||
int blockcnt, void *private);
|
||||
static int process_bad_block(ext2_filsys fs, blk_t *block_nr,
|
||||
int blockcnt, void *private);
|
||||
static int process_fs_bad_block(ext2_filsys fs, blk_t *block_nr,
|
||||
int blockcnt, void *private);
|
||||
static void check_blocks(ext2_filsys fs, ino_t ino, struct ext2_inode *inode,
|
||||
char *block_buf);
|
||||
static void mark_table_blocks(ext2_filsys fs);
|
||||
static errcode_t pass1_check_directory(ext2_filsys fs, ino_t ino);
|
||||
static errcode_t pass1_get_blocks(ext2_filsys fs, ino_t ino, blk_t *blocks);
|
||||
static void alloc_bad_map(ext2_filsys fs);
|
||||
static void handle_fs_bad_blocks(ext2_filsys fs, char *block_buf);
|
||||
static void handle_fs_bad_blocks(ext2_filsys fs);
|
||||
static void process_inodes(ext2_filsys fs, char *block_buf);
|
||||
static int process_inode_cmp(const void *a, const void *b);
|
||||
static int dir_block_cmp(const void *a, const void *b);
|
||||
static errcode_t scan_callback(ext2_filsys fs, ext2_inode_scan scan,
|
||||
dgrp_t group, void * private);
|
||||
|
||||
struct process_block_struct {
|
||||
ino_t ino;
|
||||
int is_dir;
|
||||
int is_dir:1, clear:1, suppress:1;
|
||||
int num_blocks;
|
||||
int last_block;
|
||||
int num_illegal_blocks;
|
||||
int fix;
|
||||
struct ext2_inode *inode;
|
||||
};
|
||||
|
||||
struct process_inode_block {
|
||||
@ -101,7 +102,7 @@ struct ext2_inode *stashed_inode;
|
||||
*/
|
||||
static struct process_inode_block *inodes_to_process;
|
||||
static int process_inode_count;
|
||||
int process_inode_size = 128;
|
||||
int process_inode_size = 256;
|
||||
|
||||
/*
|
||||
* For the directory blocks list.
|
||||
@ -110,6 +111,37 @@ struct dir_block_struct *dir_blocks = 0;
|
||||
int dir_block_count = 0;
|
||||
int dir_block_size = 0;
|
||||
|
||||
/*
|
||||
* Free all memory allocated by pass1 in preparation for restarting
|
||||
* things.
|
||||
*/
|
||||
static void unwind_pass1(ext2_filsys fs)
|
||||
{
|
||||
ext2fs_free_inode_bitmap(inode_used_map); inode_used_map = 0;
|
||||
ext2fs_free_inode_bitmap(inode_dir_map); inode_dir_map = 0;
|
||||
ext2fs_free_block_bitmap(block_found_map); block_found_map = 0;
|
||||
free(inode_link_info); inode_link_info = 0;
|
||||
free(inodes_to_process);inodes_to_process = 0;
|
||||
free(dir_blocks); dir_blocks = 0;
|
||||
dir_block_size = 0;
|
||||
if (block_dup_map) {
|
||||
free(block_dup_map); block_dup_map = 0;
|
||||
}
|
||||
|
||||
/* Clear statistic counters */
|
||||
fs_directory_count = 0;
|
||||
fs_regular_count = 0;
|
||||
fs_blockdev_count = 0;
|
||||
fs_chardev_count = 0;
|
||||
fs_links_count = 0;
|
||||
fs_symlinks_count = 0;
|
||||
fs_fast_symlinks_count = 0;
|
||||
fs_fifo_count = 0;
|
||||
fs_total_count = 0;
|
||||
fs_badblocks_count = 0;
|
||||
fs_sockets_count = 0;
|
||||
}
|
||||
|
||||
void pass1(ext2_filsys fs)
|
||||
{
|
||||
ino_t ino;
|
||||
@ -131,19 +163,22 @@ void pass1(ext2_filsys fs)
|
||||
/*
|
||||
* Allocate bitmaps structures
|
||||
*/
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, &inode_used_map);
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, "in-use inode map",
|
||||
&inode_used_map);
|
||||
if (retval) {
|
||||
com_err("ext2fs_allocate_inode_bitmap", retval,
|
||||
"while allocating inode_used_map");
|
||||
fatal_error(0);
|
||||
}
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, &inode_dir_map);
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, "directory inode map",
|
||||
&inode_dir_map);
|
||||
if (retval) {
|
||||
com_err("ext2fs_allocate_inode_bitmap", retval,
|
||||
"while allocating inode_dir_map");
|
||||
fatal_error(0);
|
||||
}
|
||||
retval = ext2fs_allocate_block_bitmap(fs, &block_found_map);
|
||||
retval = ext2fs_allocate_block_bitmap(fs, "in-use block map",
|
||||
&block_found_map);
|
||||
if (retval) {
|
||||
com_err("ext2fs_allocate_block_bitmap", retval,
|
||||
"while allocating block_found_map");
|
||||
@ -179,6 +214,7 @@ void pass1(ext2_filsys fs)
|
||||
fatal_error(0);
|
||||
}
|
||||
stashed_inode = &inode;
|
||||
ext2fs_set_inode_callback(scan, scan_callback, block_buf);
|
||||
while (ino) {
|
||||
stashed_ino = ino;
|
||||
inode_link_info[ino] = inode.i_links_count;
|
||||
@ -187,14 +223,16 @@ void pass1(ext2_filsys fs)
|
||||
|
||||
pb.ino = EXT2_BAD_INO;
|
||||
pb.num_blocks = pb.last_block = 0;
|
||||
pb.is_dir = 0;
|
||||
pb.num_illegal_blocks = 0;
|
||||
pb.suppress = pb.clear = pb.is_dir = 0;
|
||||
pb.fix = -1;
|
||||
pb.inode = &inode;
|
||||
retval = ext2fs_block_iterate(fs, ino, 0, block_buf,
|
||||
process_bad_block, &pb);
|
||||
if (retval)
|
||||
com_err(program_name, retval, "while calling e2fsc_block_interate in pass 1");
|
||||
|
||||
ext2fs_mark_inode_bitmap(fs, inode_used_map, ino);
|
||||
ext2fs_mark_inode_bitmap(inode_used_map, ino);
|
||||
goto next;
|
||||
}
|
||||
if (ino == EXT2_ROOT_INO) {
|
||||
@ -209,7 +247,9 @@ void pass1(ext2_filsys fs)
|
||||
if (ask("Clear", 1)) {
|
||||
inode.i_dtime = time(0);
|
||||
inode.i_links_count = 0;
|
||||
ext2fs_write_inode(fs, ino, &inode);
|
||||
inode_link_info[ino] = 0;
|
||||
e2fsck_write_inode(fs, ino, &inode,
|
||||
"pass1");
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
@ -227,7 +267,8 @@ void pass1(ext2_filsys fs)
|
||||
"(probably due to old mke2fs). Fix",
|
||||
1)) {
|
||||
inode.i_dtime = 0;
|
||||
ext2fs_write_inode(fs, ino, &inode);
|
||||
e2fsck_write_inode(fs, ino, &inode,
|
||||
"pass1");
|
||||
printf("Note: /lost+found will "
|
||||
"probably be deleted as well, "
|
||||
"due to the mke2fs bug.\n"
|
||||
@ -239,7 +280,7 @@ void pass1(ext2_filsys fs)
|
||||
}
|
||||
}
|
||||
if ((ino != EXT2_ROOT_INO) && (ino < EXT2_FIRST_INO)) {
|
||||
ext2fs_mark_inode_bitmap(fs, inode_used_map, ino);
|
||||
ext2fs_mark_inode_bitmap(inode_used_map, ino);
|
||||
check_blocks(fs, ino, &inode, block_buf);
|
||||
goto next;
|
||||
}
|
||||
@ -249,11 +290,12 @@ void pass1(ext2_filsys fs)
|
||||
*/
|
||||
if (!inode.i_links_count) {
|
||||
if (!inode.i_dtime && inode.i_mode) {
|
||||
printf("Deleted inode %ld has zero dtime.\n",
|
||||
printf("Deleted inode %lu has zero dtime.\n",
|
||||
ino);
|
||||
if (ask("Set dtime", 1)) {
|
||||
inode.i_dtime = time(0);
|
||||
ext2fs_write_inode(fs, ino, &inode);
|
||||
e2fsck_write_inode(fs, ino, &inode,
|
||||
"pass1");
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
@ -275,26 +317,27 @@ void pass1(ext2_filsys fs)
|
||||
printf("This is probably due to old ext2fs kernel code. \n");
|
||||
fix_link_count = ask("Fix inode(s)", 1);
|
||||
}
|
||||
printf("Inode %ld is deleted w/ non-zero link_count. %s\n",
|
||||
printf("Inode %lu is deleted w/ non-zero link_count. %s\n",
|
||||
ino, clear_msg[fix_link_count]);
|
||||
if (fix_link_count) {
|
||||
inode.i_links_count = 0;
|
||||
ext2fs_write_inode(fs, ino, &inode);
|
||||
inode_link_info[ino] = 0;
|
||||
e2fsck_write_inode(fs, ino, &inode, "pass1");
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
goto next;
|
||||
}
|
||||
|
||||
ext2fs_mark_inode_bitmap(fs, inode_used_map, ino);
|
||||
ext2fs_mark_inode_bitmap(inode_used_map, ino);
|
||||
if (inode.i_faddr || inode.i_frag || inode.i_fsize ||
|
||||
inode.i_file_acl || inode.i_dir_acl) {
|
||||
if (!inode_bad_map)
|
||||
alloc_bad_map(fs);
|
||||
ext2fs_mark_inode_bitmap(fs, inode_bad_map, ino);
|
||||
ext2fs_mark_inode_bitmap(inode_bad_map, ino);
|
||||
}
|
||||
|
||||
if (S_ISDIR(inode.i_mode)) {
|
||||
ext2fs_mark_inode_bitmap(fs, inode_dir_map, ino);
|
||||
ext2fs_mark_inode_bitmap(inode_dir_map, ino);
|
||||
add_dir_info(fs, ino, 0, &inode);
|
||||
fs_directory_count++;
|
||||
} else if (S_ISREG (inode.i_mode))
|
||||
@ -315,7 +358,7 @@ void pass1(ext2_filsys fs)
|
||||
else {
|
||||
if (!inode_bad_map)
|
||||
alloc_bad_map(fs);
|
||||
ext2fs_mark_inode_bitmap(fs, inode_bad_map, ino);
|
||||
ext2fs_mark_inode_bitmap(inode_bad_map, ino);
|
||||
}
|
||||
if (inode.i_block[EXT2_IND_BLOCK] ||
|
||||
inode.i_block[EXT2_DIND_BLOCK] ||
|
||||
@ -323,9 +366,8 @@ void pass1(ext2_filsys fs)
|
||||
inodes_to_process[process_inode_count].ino = ino;
|
||||
inodes_to_process[process_inode_count].inode = inode;
|
||||
process_inode_count++;
|
||||
} else
|
||||
} else
|
||||
check_blocks(fs, ino, &inode, block_buf);
|
||||
inode_link_info[ino] = inode.i_links_count;
|
||||
|
||||
if (process_inode_count >= process_inode_size)
|
||||
process_inodes(fs, block_buf);
|
||||
@ -344,6 +386,14 @@ void pass1(ext2_filsys fs)
|
||||
qsort(dir_blocks, dir_block_count, sizeof(struct dir_block_struct),
|
||||
dir_block_cmp);
|
||||
|
||||
if (invalid_bitmaps)
|
||||
handle_fs_bad_blocks(fs);
|
||||
|
||||
if (restart_e2fsck) {
|
||||
unwind_pass1(fs);
|
||||
goto endit;
|
||||
}
|
||||
|
||||
if (block_dup_map) {
|
||||
if (preen) {
|
||||
printf("Duplicate or bad blocks in use!\n");
|
||||
@ -354,18 +404,25 @@ void pass1(ext2_filsys fs)
|
||||
fs->get_blocks = 0;
|
||||
fs->check_directory = 0;
|
||||
free(inodes_to_process);
|
||||
if (bad_fs_block_map) {
|
||||
handle_fs_bad_blocks(fs, block_buf);
|
||||
free(bad_fs_block_map);
|
||||
}
|
||||
endit:
|
||||
free(block_buf);
|
||||
|
||||
if (tflag > 1) {
|
||||
printf("Pass 1: ");
|
||||
print_resource_track(&rtrack);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* When the inode_scan routines call this callback at the end of the
|
||||
* glock group, call process_inodes.
|
||||
*/
|
||||
static errcode_t scan_callback(ext2_filsys fs, ext2_inode_scan scan,
|
||||
dgrp_t group, void * private)
|
||||
{
|
||||
process_inodes(fs, (char *) private);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Process the inodes in the "inodes to process" list.
|
||||
*/
|
||||
@ -378,7 +435,7 @@ static void process_inodes(ext2_filsys fs, char *block_buf)
|
||||
char buf[80];
|
||||
|
||||
#if 0
|
||||
printf("process_inodes: ");
|
||||
printf("begin process_inodes: ");
|
||||
#endif
|
||||
old_operation = ehandler_operation(0);
|
||||
old_stashed_inode = stashed_inode;
|
||||
@ -389,9 +446,9 @@ static void process_inodes(ext2_filsys fs, char *block_buf)
|
||||
ino = inodes_to_process[i].ino;
|
||||
stashed_ino = ino;
|
||||
#if 0
|
||||
printf("%d ", ino);
|
||||
printf("%lu ", ino);
|
||||
#endif
|
||||
sprintf(buf, "reading indirect blocks of inode %ld", ino);
|
||||
sprintf(buf, "reading indirect blocks of inode %lu", ino);
|
||||
ehandler_operation(buf);
|
||||
check_blocks(fs, ino, stashed_inode, block_buf);
|
||||
|
||||
@ -399,7 +456,7 @@ static void process_inodes(ext2_filsys fs, char *block_buf)
|
||||
stashed_inode = old_stashed_inode;
|
||||
process_inode_count = 0;
|
||||
#if 0
|
||||
printf("\n");
|
||||
printf("end process inodes\n");
|
||||
#endif
|
||||
ehandler_operation(old_operation);
|
||||
}
|
||||
@ -432,7 +489,8 @@ static void alloc_bad_map(ext2_filsys fs)
|
||||
{
|
||||
errcode_t retval;
|
||||
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, &inode_bad_map);
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, "bad inode map",
|
||||
&inode_bad_map);
|
||||
if (retval) {
|
||||
com_err("ext2fs_allocate_inode_bitmap", retval,
|
||||
"while allocating inode_bad_map");
|
||||
@ -448,19 +506,19 @@ static void mark_block_used(ext2_filsys fs, blk_t block)
|
||||
{
|
||||
errcode_t retval;
|
||||
|
||||
if (ext2fs_test_block_bitmap(fs, block_found_map, block)) {
|
||||
if (ext2fs_test_block_bitmap(block_found_map, block)) {
|
||||
if (!block_dup_map) {
|
||||
retval = ext2fs_allocate_block_bitmap(fs,
|
||||
&block_dup_map);
|
||||
"multiply claimed block map", &block_dup_map);
|
||||
if (retval) {
|
||||
com_err("ext2fs_allocate_block_bitmap", retval,
|
||||
"while allocating block_dup_map");
|
||||
fatal_error(0);
|
||||
}
|
||||
}
|
||||
ext2fs_mark_block_bitmap(fs, block_dup_map, block);
|
||||
ext2fs_mark_block_bitmap(block_dup_map, block);
|
||||
} else {
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map, block);
|
||||
ext2fs_mark_block_bitmap(block_found_map, block);
|
||||
}
|
||||
}
|
||||
|
||||
@ -479,48 +537,77 @@ static void check_blocks(ext2_filsys fs, ino_t ino, struct ext2_inode *inode,
|
||||
|
||||
pb.ino = ino;
|
||||
pb.num_blocks = pb.last_block = 0;
|
||||
pb.num_illegal_blocks = 0;
|
||||
pb.suppress = pb.clear = 0;
|
||||
pb.is_dir = S_ISDIR(inode->i_mode);
|
||||
pb.fix = -1;
|
||||
pb.inode = inode;
|
||||
retval = ext2fs_block_iterate(fs, ino, 0, block_buf,
|
||||
process_block, &pb);
|
||||
if (retval)
|
||||
com_err(program_name, retval,
|
||||
"while calling ext2fs_block_iterate in check_blocks");
|
||||
|
||||
if (pb.clear) {
|
||||
e2fsck_read_inode(fs, ino, inode, "check_blocks");
|
||||
if (retval) {
|
||||
com_err("check_blocks", retval,
|
||||
"while reading to be cleared inode %d", ino);
|
||||
fatal_error(0);
|
||||
}
|
||||
inode->i_links_count = 0;
|
||||
inode_link_info[ino] = 0;
|
||||
inode->i_dtime = time(0);
|
||||
e2fsck_write_inode(fs, ino, inode, "check_blocks");
|
||||
ext2fs_unmark_inode_bitmap(inode_dir_map, ino);
|
||||
ext2fs_unmark_inode_bitmap(inode_used_map, ino);
|
||||
/*
|
||||
* The inode was probably partially accounted for
|
||||
* before processing was aborted, so we need to
|
||||
* restart the pass 1 scan.
|
||||
*/
|
||||
restart_e2fsck++;
|
||||
return;
|
||||
}
|
||||
|
||||
if (pb.fix > 0)
|
||||
e2fsck_read_inode(fs, ino, inode, "check_blocks");
|
||||
|
||||
pb.num_blocks *= (fs->blocksize / 512);
|
||||
#if 0
|
||||
printf("inode %d, i_size = %d, last_block = %d, i_blocks=%d, num_blocks = %d\n",
|
||||
printf("inode %lu, i_size = %lu, last_block = %lu, i_blocks=%lu, num_blocks = %lu\n",
|
||||
ino, inode->i_size, pb.last_block, inode->i_blocks,
|
||||
pb.num_blocks);
|
||||
#endif
|
||||
if (!pb.num_blocks && pb.is_dir) {
|
||||
printf("Inode %ld is a zero length directory. ", ino);
|
||||
printf("Inode %lu is a zero length directory. ", ino);
|
||||
if (ask("Clear", 1)) {
|
||||
inode->i_links_count = 0;
|
||||
inode_link_info[ino] = 0;
|
||||
inode->i_dtime = time(0);
|
||||
ext2fs_write_inode(fs, ino, inode);
|
||||
ext2fs_unmark_inode_bitmap(fs, inode_dir_map, ino);
|
||||
ext2fs_unmark_inode_bitmap(fs, inode_used_map, ino);
|
||||
e2fsck_write_inode(fs, ino, inode, "check_blocks");
|
||||
ext2fs_unmark_inode_bitmap(inode_dir_map, ino);
|
||||
ext2fs_unmark_inode_bitmap(inode_used_map, ino);
|
||||
fs_directory_count--;
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
if (inode->i_size < pb.last_block * fs->blocksize) {
|
||||
printf ("Inode %ld, incorrect size, %ld (counted = %d). ",
|
||||
printf ("Inode %lu, incorrect size, %lu (counted = %u). ",
|
||||
ino, inode->i_size,
|
||||
(pb.last_block+1) * fs->blocksize);
|
||||
if (ask ("Set size to counted", 1)) {
|
||||
inode->i_size = (pb.last_block+1) * fs->blocksize;
|
||||
ext2fs_write_inode(fs, ino, inode);
|
||||
e2fsck_write_inode(fs, ino, inode, "check_blocks");
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
if (pb.num_blocks != inode->i_blocks) {
|
||||
printf ("Inode %ld, i_blocks wrong %ld (counted=%d) .",
|
||||
printf ("Inode %lu, i_blocks wrong %lu (counted=%u). ",
|
||||
ino, inode->i_blocks, pb.num_blocks);
|
||||
if (ask ("Set i_blocks to counted", 1)) {
|
||||
inode->i_blocks = pb.num_blocks;
|
||||
ext2fs_write_inode(fs, ino, inode);
|
||||
e2fsck_write_inode(fs, ino, inode, "check_blocks");
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
@ -538,7 +625,7 @@ int process_block(ext2_filsys fs,
|
||||
int group;
|
||||
int illegal_block = 0;
|
||||
char problem[80];
|
||||
blk_t firstblock;
|
||||
blk_t firstblock, group_super;
|
||||
blk_t blk = *block_nr;
|
||||
|
||||
if (!blk)
|
||||
@ -546,21 +633,27 @@ int process_block(ext2_filsys fs,
|
||||
p = (struct process_block_struct *) private;
|
||||
|
||||
#if 0
|
||||
printf("Process_block, inode %d, block %d, #%d\n", p->ino, blk,
|
||||
printf("Process_block, inode %lu, block %lu, #%d\n", p->ino, blk,
|
||||
blockcnt);
|
||||
#endif
|
||||
|
||||
p->num_blocks++;
|
||||
if (blockcnt > 0)
|
||||
p->last_block = blockcnt;
|
||||
|
||||
firstblock = fs->super->s_first_data_block;
|
||||
group = (blk - firstblock) / fs->super->s_blocks_per_group;
|
||||
group_super = ((group * fs->super->s_blocks_per_group) +
|
||||
fs->super->s_first_data_block);
|
||||
if (blk < firstblock) {
|
||||
sprintf(problem, "< FIRSTBLOCK (%ld)", firstblock);
|
||||
sprintf(problem, "< FIRSTBLOCK (%lu)", firstblock);
|
||||
illegal_block++;
|
||||
} else if (blk >= fs->super->s_blocks_count) {
|
||||
sprintf(problem, "> BLOCKS (%ld)", fs->super->s_blocks_count);
|
||||
sprintf(problem, "> BLOCKS (%lu)", fs->super->s_blocks_count);
|
||||
illegal_block++;
|
||||
} else if (blk == group_super) {
|
||||
sprintf(problem, "is the superblock in group %d", group);
|
||||
illegal_block++;
|
||||
} else if (blk > group_super &&
|
||||
blk <= (group_super + fs->desc_blocks)) {
|
||||
sprintf(problem, "is in the group descriptors in group %d",
|
||||
group);
|
||||
illegal_block++;
|
||||
} else if (blk == fs->group_desc[group].bg_block_bitmap) {
|
||||
sprintf(problem, "is the block bitmap of group %d", group);
|
||||
@ -575,16 +668,29 @@ int process_block(ext2_filsys fs,
|
||||
}
|
||||
if (illegal_block) {
|
||||
if (preen) {
|
||||
printf("Block %ld of inode %ld %s\n", blk, p->ino,
|
||||
printf("Block %lu of inode %lu %s\n", blk, p->ino,
|
||||
problem);
|
||||
preenhalt();
|
||||
}
|
||||
if (p->fix == -1) {
|
||||
printf("Remove illegal block(s) in inode %ld", p->ino);
|
||||
printf("Remove illegal block(s) in inode %lu", p->ino);
|
||||
p->fix = ask("", 1);
|
||||
}
|
||||
printf("Block #%d (%ld) %s. %s\n", blockcnt, blk, problem,
|
||||
clear_msg[p->fix]);
|
||||
p->num_illegal_blocks++;
|
||||
if (!p->suppress && (p->num_illegal_blocks % 20) == 0) {
|
||||
printf("Too many illegal blocks in inode %lu.\n",
|
||||
p->ino);
|
||||
if (ask("Clear inode", 1)) {
|
||||
p->clear = 1;
|
||||
return BLOCK_ABORT;
|
||||
}
|
||||
if (ask("Supress messages", 0)) {
|
||||
p->suppress = 1;
|
||||
}
|
||||
}
|
||||
if (!p->suppress)
|
||||
printf("Block #%d (%lu) %s. %s\n", blockcnt, blk,
|
||||
problem, clear_msg[p->fix]);
|
||||
if (p->fix) {
|
||||
*block_nr = 0;
|
||||
return BLOCK_CHANGED;
|
||||
@ -594,6 +700,9 @@ int process_block(ext2_filsys fs,
|
||||
}
|
||||
}
|
||||
|
||||
p->num_blocks++;
|
||||
if (blockcnt > 0)
|
||||
p->last_block = blockcnt;
|
||||
mark_block_used(fs, blk);
|
||||
|
||||
if (p->is_dir && (blockcnt >= 0)) {
|
||||
@ -611,21 +720,36 @@ int process_block(ext2_filsys fs,
|
||||
}
|
||||
|
||||
#if 0
|
||||
printf("process block, inode %d, block #%d is %d\n",
|
||||
printf("process block, inode %lu, block #%d is %lu\n",
|
||||
p->ino, blockcnt, blk);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bad_block_indirect(blk_t blk)
|
||||
{
|
||||
printf("Bad block %lu used as bad block indirect block?!?\n", blk);
|
||||
preenhalt();
|
||||
printf("\nThis inconsistency can not be fixed with "
|
||||
"e2fsck; to fix it, use\n"
|
||||
"""dumpe2fs -b"" to dump out the bad block "
|
||||
"list and ""e2fsck -L filename""\n"
|
||||
"to read it back in again.\n");
|
||||
if (ask("Continue", 0))
|
||||
return;
|
||||
fatal_error(0);
|
||||
}
|
||||
|
||||
int process_bad_block(ext2_filsys fs,
|
||||
blk_t *block_nr,
|
||||
int blockcnt,
|
||||
void *private)
|
||||
{
|
||||
struct process_block_struct *p;
|
||||
errcode_t retval;
|
||||
blk_t blk = *block_nr;
|
||||
int first_block;
|
||||
int i;
|
||||
|
||||
if (!blk)
|
||||
return 0;
|
||||
@ -634,12 +758,12 @@ int process_bad_block(ext2_filsys fs,
|
||||
if ((blk < fs->super->s_first_data_block) ||
|
||||
(blk >= fs->super->s_blocks_count)) {
|
||||
if (preen) {
|
||||
printf("Illegal block %ld in bad block inode\n", blk);
|
||||
printf("Illegal block %lu in bad block inode\n", blk);
|
||||
preenhalt();
|
||||
}
|
||||
if (p->fix == -1)
|
||||
p->fix = ask("Remove illegal block(s) in bad block inode", 1);
|
||||
printf("Illegal block %ld in bad block inode. %s\n", blk,
|
||||
printf("Illegal block %lu in bad block inode. %s\n", blk,
|
||||
clear_msg[p->fix]);
|
||||
if (p->fix) {
|
||||
*block_nr = 0;
|
||||
@ -651,11 +775,14 @@ int process_bad_block(ext2_filsys fs,
|
||||
}
|
||||
|
||||
if (blockcnt < 0) {
|
||||
mark_block_used(fs, blk);
|
||||
if (ext2fs_test_block_bitmap(block_found_map, blk))
|
||||
bad_block_indirect(blk);
|
||||
else
|
||||
mark_block_used(fs, blk);
|
||||
return 0;
|
||||
}
|
||||
#if 0
|
||||
printf ("DEBUG: Marking %d as bad.\n", blk);
|
||||
printf ("DEBUG: Marking %lu as bad.\n", blk);
|
||||
#endif
|
||||
fs_badblocks_count++;
|
||||
/*
|
||||
@ -664,40 +791,93 @@ int process_bad_block(ext2_filsys fs,
|
||||
* there's an overlap between the filesystem table blocks
|
||||
* (bitmaps and inode table) and the bad block list.
|
||||
*/
|
||||
if (!ext2fs_test_block_bitmap(fs, block_found_map, blk)) {
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map, blk);
|
||||
if (!ext2fs_test_block_bitmap(block_found_map, blk)) {
|
||||
ext2fs_mark_block_bitmap(block_found_map, blk);
|
||||
return 0;
|
||||
}
|
||||
if (!bad_fs_block_map) {
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, &bad_fs_block_map);
|
||||
if (retval) {
|
||||
com_err("ext2fs_allocate_block_bitmap", retval,
|
||||
"while allocating bad_fs_block_map");
|
||||
fatal_error(0);
|
||||
/*
|
||||
* Try to find the where the filesystem block was used...
|
||||
*/
|
||||
first_block = fs->super->s_first_data_block;
|
||||
|
||||
for (i = 0; i < fs->group_desc_count; i++ ) {
|
||||
if (blk == first_block) {
|
||||
if (i == 0) {
|
||||
printf("The primary superblock (%lu) is "
|
||||
"bad. Aiiieeee....\n", blk);
|
||||
fatal_error(0);
|
||||
}
|
||||
if (!preen)
|
||||
printf("Warning: Group %d's superblock "
|
||||
"(%lu) is bad.\n", i, blk);
|
||||
return 0;
|
||||
}
|
||||
if ((blk > first_block) &&
|
||||
(blk <= first_block + fs->desc_blocks)) {
|
||||
if (i == 0) {
|
||||
printf("Bad block %lu is in the primary "
|
||||
"group descriptors. Aiiieeee....\n",
|
||||
blk);
|
||||
fatal_error(0);
|
||||
}
|
||||
if (!preen)
|
||||
printf("Warning: Group %d's copy of the "
|
||||
"group descriptors has a bad "
|
||||
"block (%lu).\n", i, blk);
|
||||
return 0;
|
||||
}
|
||||
if (blk == fs->group_desc[i].bg_block_bitmap) {
|
||||
printf("Group %d's block bitmap (%lu) is bad. ",
|
||||
i, blk);
|
||||
if (ask("Relocate", 1)) {
|
||||
invalid_block_bitmap[i]++;
|
||||
invalid_bitmaps++;
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
return 0;
|
||||
}
|
||||
if (blk == fs->group_desc[i].bg_inode_bitmap) {
|
||||
printf("Group %d's inode bitmap (%lu) is bad. ",
|
||||
i, blk);
|
||||
if (ask("Relocate", 1)) {
|
||||
invalid_inode_bitmap[i]++;
|
||||
invalid_bitmaps++;
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
return 0;
|
||||
}
|
||||
if ((blk >= fs->group_desc[i].bg_inode_table) &&
|
||||
(blk < (fs->group_desc[i].bg_inode_table +
|
||||
fs->inode_blocks_per_group))) {
|
||||
printf("WARNING: Severe data loss possible!!!!\n");
|
||||
printf("Bad block %lu in group %d's inode table. ",
|
||||
blk, i);
|
||||
if (ask("Relocate", 1)) {
|
||||
invalid_inode_table[i]++;
|
||||
invalid_bitmaps++;
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
return 0;
|
||||
}
|
||||
first_block += fs->super->s_blocks_per_group;
|
||||
}
|
||||
ext2fs_mark_block_bitmap(fs, bad_fs_block_map, blk);
|
||||
/*
|
||||
* If we've gotten to this point, then the only
|
||||
* possibility is that the bad block inode meta data
|
||||
* is using a bad block.
|
||||
*/
|
||||
if ((blk == p->inode->i_block[EXT2_IND_BLOCK]) ||
|
||||
p->inode->i_block[EXT2_DIND_BLOCK]) {
|
||||
bad_block_indirect(blk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf("Programming error? block #%lu claimed for no reason "
|
||||
"in process_bad_block.\n", blk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine gets called at the end of pass 1 if bad blocks are
|
||||
* detected in the superblock, group descriptors, inode_bitmaps, or
|
||||
* block bitmaps. At this point, all of the blocks have been mapped
|
||||
* out, so we can try to allocate new block(s) to replace the bad
|
||||
* blocks.
|
||||
*/
|
||||
static void handle_fs_bad_blocks(ext2_filsys fs, char *block_buf)
|
||||
{
|
||||
errcode_t retval;
|
||||
|
||||
printf("Warning: Bad block(s) found in filesystem-reserved blocks.\n");
|
||||
|
||||
retval = ext2fs_block_iterate(fs, EXT2_BAD_INO, 0, block_buf,
|
||||
process_fs_bad_block, 0);
|
||||
}
|
||||
|
||||
static void new_table_block(ext2_filsys fs, blk_t first_block,
|
||||
static void new_table_block(ext2_filsys fs, blk_t first_block, int group,
|
||||
const char *name, int num, blk_t *new_block)
|
||||
{
|
||||
errcode_t retval;
|
||||
@ -722,99 +902,62 @@ static void new_table_block(ext2_filsys fs, blk_t first_block,
|
||||
return;
|
||||
}
|
||||
ext2fs_mark_super_dirty(fs);
|
||||
printf("Relocating group %d's %s ", group, name);
|
||||
if (old_block)
|
||||
printf("from %lu ", old_block);
|
||||
printf("to %lu...\n", *new_block);
|
||||
for (i = 0; i < num; i++) {
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map, (*new_block)+i);
|
||||
retval = io_channel_read_blk(fs->io, old_block + i,
|
||||
1, buf);
|
||||
if (retval)
|
||||
printf("Warning: could not read block %ld of %s: %s\n",
|
||||
old_block + i, name, error_message(retval));
|
||||
ext2fs_mark_block_bitmap(block_found_map, (*new_block)+i);
|
||||
if (old_block) {
|
||||
retval = io_channel_read_blk(fs->io, old_block + i,
|
||||
1, buf);
|
||||
if (retval)
|
||||
printf("Warning: could not read block %lu "
|
||||
"of %s: %s\n",
|
||||
old_block + i, name,
|
||||
error_message(retval));
|
||||
} else
|
||||
memset(buf, 0, fs->blocksize);
|
||||
|
||||
retval = io_channel_write_blk(fs->io, (*new_block) + i,
|
||||
1, buf);
|
||||
if (retval)
|
||||
printf("Warning: could not write block %ld for %s: %s\n",
|
||||
printf("Warning: could not write block %lu for %s: %s\n",
|
||||
(*new_block) + i, name, error_message(retval));
|
||||
/*
|
||||
* If this particular block is not marked as bad, then
|
||||
* clear its bit in the block_found map. Otherwise,
|
||||
* leave it set, since it is included in the bad
|
||||
* blocks inode.
|
||||
*/
|
||||
if (!ext2fs_test_block_bitmap(fs, bad_fs_block_map,
|
||||
old_block + i))
|
||||
ext2fs_unmark_block_bitmap(fs, block_found_map,
|
||||
old_block + i);
|
||||
/*
|
||||
* Clear the bitmap since this block has now been moved.
|
||||
*/
|
||||
ext2fs_unmark_block_bitmap(fs, bad_fs_block_map,
|
||||
old_block + i);
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function for handle_fs_bad_blocks()
|
||||
* This routine gets called at the end of pass 1 if bad blocks are
|
||||
* detected in the superblock, group descriptors, inode_bitmaps, or
|
||||
* block bitmaps. At this point, all of the blocks have been mapped
|
||||
* out, so we can try to allocate new block(s) to replace the bad
|
||||
* blocks.
|
||||
*/
|
||||
static int process_fs_bad_block(ext2_filsys fs, blk_t *block_nr,
|
||||
int blockcnt, void *private)
|
||||
static void handle_fs_bad_blocks(ext2_filsys fs)
|
||||
{
|
||||
int i;
|
||||
blk_t block = *block_nr;
|
||||
int first_block = fs->super->s_first_data_block;
|
||||
|
||||
/*
|
||||
* If this block isn't one that is marked as a bad block in
|
||||
* the filesystem tables, return
|
||||
*/
|
||||
if (!ext2fs_test_block_bitmap(fs, bad_fs_block_map, block))
|
||||
return 0;
|
||||
int i;
|
||||
int first_block = fs->super->s_first_data_block;
|
||||
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
if (block == first_block)
|
||||
printf("Bad block %ld in group %d's superblock.\n",
|
||||
block, i);
|
||||
if (block == fs->group_desc[i].bg_block_bitmap) {
|
||||
printf("Bad block %ld in group %d's block bitmap. ",
|
||||
block, i);
|
||||
if (ask("Relocate", 1)) {
|
||||
new_table_block(fs, first_block,
|
||||
"block bitmap", 1,
|
||||
if (invalid_block_bitmap[i]) {
|
||||
new_table_block(fs, first_block, i, "block bitmap", 1,
|
||||
&fs->group_desc[i].bg_block_bitmap);
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
if (block == fs->group_desc[i].bg_inode_bitmap) {
|
||||
printf("Bad block %ld in group %d's inode bitmap. ",
|
||||
block, i);
|
||||
if (ask("Relocate", 1)) {
|
||||
new_table_block(fs, first_block,
|
||||
"inode bitmap", 1,
|
||||
if (invalid_inode_bitmap[i]) {
|
||||
new_table_block(fs, first_block, i, "inode bitmap", 1,
|
||||
&fs->group_desc[i].bg_inode_bitmap);
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
if ((block >= fs->group_desc[i].bg_inode_table) &&
|
||||
(block < (fs->group_desc[i].bg_inode_table +
|
||||
fs->inode_blocks_per_group))) {
|
||||
printf("WARNING: Severe data loss possible!!!!\n");
|
||||
printf("Bad block %ld in group %d's inode table. ",
|
||||
block, i);
|
||||
if (ask("Relocate", 1)) {
|
||||
new_table_block(fs, first_block,
|
||||
"inode table",
|
||||
fs->inode_blocks_per_group,
|
||||
if (invalid_inode_table[i]) {
|
||||
new_table_block(fs, first_block, i, "inode table",
|
||||
fs->inode_blocks_per_group,
|
||||
&fs->group_desc[i].bg_inode_table);
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
restart_e2fsck++;
|
||||
}
|
||||
if ((block > first_block) &&
|
||||
(block <= first_block + fs->desc_blocks))
|
||||
printf("Bad block %ld in group %d's copy of the descriptors.\n",
|
||||
block, i);
|
||||
first_block += fs->super->s_blocks_per_group;
|
||||
}
|
||||
return 0;
|
||||
invalid_bitmaps = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -823,7 +966,7 @@ static int process_fs_bad_block(ext2_filsys fs, blk_t *block_nr,
|
||||
*/
|
||||
static void mark_table_blocks(ext2_filsys fs)
|
||||
{
|
||||
blk_t block;
|
||||
blk_t block, b;
|
||||
int i,j;
|
||||
|
||||
block = fs->super->s_first_data_block;
|
||||
@ -831,29 +974,80 @@ static void mark_table_blocks(ext2_filsys fs)
|
||||
/*
|
||||
* Mark block used for the block bitmap
|
||||
*/
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map,
|
||||
fs->group_desc[i].bg_block_bitmap);
|
||||
if (fs->group_desc[i].bg_block_bitmap) {
|
||||
if (ext2fs_test_block_bitmap(block_found_map,
|
||||
fs->group_desc[i].bg_block_bitmap)) {
|
||||
printf("Group %i's block bitmap at %lu "
|
||||
"conflicts with some other fs block.\n",
|
||||
i, fs->group_desc[i].bg_block_bitmap);
|
||||
preenhalt();
|
||||
if (ask("Relocate", 1)) {
|
||||
invalid_block_bitmap[i]++;
|
||||
invalid_bitmaps++;
|
||||
} else {
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
} else
|
||||
ext2fs_mark_block_bitmap(block_found_map,
|
||||
fs->group_desc[i].bg_block_bitmap);
|
||||
}
|
||||
/*
|
||||
* Mark block used for the inode bitmap
|
||||
*/
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map,
|
||||
fs->group_desc[i].bg_inode_bitmap);
|
||||
if (fs->group_desc[i].bg_inode_bitmap) {
|
||||
if (ext2fs_test_block_bitmap(block_found_map,
|
||||
fs->group_desc[i].bg_inode_bitmap)) {
|
||||
printf("Group %i's inode bitmap at %lu "
|
||||
"conflicts with some other fs block.\n",
|
||||
i, fs->group_desc[i].bg_inode_bitmap);
|
||||
preenhalt();
|
||||
if (ask("Relocate", 1)) {
|
||||
invalid_inode_bitmap[i]++;
|
||||
invalid_bitmaps++;
|
||||
} else {
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
} else
|
||||
ext2fs_mark_block_bitmap(block_found_map,
|
||||
fs->group_desc[i].bg_inode_bitmap);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark the blocks used for the inode table
|
||||
*/
|
||||
for (j = 0; j < fs->inode_blocks_per_group; j++)
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map,
|
||||
fs->group_desc[i].bg_inode_table + j);
|
||||
if (fs->group_desc[i].bg_inode_table) {
|
||||
for (j = 0, b = fs->group_desc[i].bg_inode_table;
|
||||
j < fs->inode_blocks_per_group;
|
||||
j++, b++) {
|
||||
if (ext2fs_test_block_bitmap(block_found_map,
|
||||
b)) {
|
||||
printf("Group %i's inode table at %lu "
|
||||
"conflicts with some other "
|
||||
"fs block.\n",
|
||||
i, b);
|
||||
preenhalt();
|
||||
if (ask("Relocate", 1)) {
|
||||
invalid_inode_table[i]++;
|
||||
invalid_bitmaps++;
|
||||
} else {
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
} else
|
||||
ext2fs_mark_block_bitmap(block_found_map,
|
||||
b);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark this group's copy of the superblock
|
||||
*/
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map, block);
|
||||
ext2fs_mark_block_bitmap(block_found_map, block);
|
||||
|
||||
/*
|
||||
* Mark this group's copy of the descriptors
|
||||
*/
|
||||
for (j = 0; j < fs->desc_blocks; j++)
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map,
|
||||
ext2fs_mark_block_bitmap(block_found_map,
|
||||
block + j + 1);
|
||||
block += fs->super->s_blocks_per_group;
|
||||
}
|
||||
@ -874,9 +1068,9 @@ static errcode_t pass1_get_blocks(ext2_filsys fs, ino_t ino, blk_t *blocks)
|
||||
blocks[i] = stashed_inode->i_block[i];
|
||||
return 0;
|
||||
}
|
||||
printf("INTERNAL ERROR: pass1_get_blocks: unexpected inode #%ld\n",
|
||||
printf("INTERNAL ERROR: pass1_get_blocks: unexpected inode #%lu\n",
|
||||
ino);
|
||||
printf("\t(was expecting %ld)\n", stashed_ino);
|
||||
printf("\t(was expecting %lu)\n", stashed_ino);
|
||||
exit(FSCK_ERROR);
|
||||
}
|
||||
|
||||
@ -887,8 +1081,8 @@ static errcode_t pass1_check_directory(ext2_filsys fs, ino_t ino)
|
||||
return ENOTDIR;
|
||||
return 0;
|
||||
}
|
||||
printf("INTERNAL ERROR: pass1_check_directory: unexpected inode #%ld\n",
|
||||
printf("INTERNAL ERROR: pass1_check_directory: unexpected inode #%lu\n",
|
||||
ino);
|
||||
printf("\t(was expecting %ld)\n", stashed_ino);
|
||||
printf("\t(was expecting %lu)\n", stashed_ino);
|
||||
exit(FSCK_ERROR);
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ static int dup_inode_count = 0;
|
||||
extern ino_t stashed_ino;
|
||||
extern struct ext2_inode *stashed_inode;
|
||||
|
||||
static char *inode_dup_map;
|
||||
static ext2fs_inode_bitmap inode_dup_map;
|
||||
|
||||
/*
|
||||
* Main procedure for handling duplicate blocks
|
||||
@ -112,7 +112,8 @@ void pass1_dupblocks(ext2_filsys fs, char *block_buf)
|
||||
struct dup_block *p, *q, *next_p, *next_q;
|
||||
struct dup_inode *r, *next_r;
|
||||
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, &inode_dup_map);
|
||||
retval = ext2fs_allocate_inode_bitmap(fs,
|
||||
"multiply claimed inode map", &inode_dup_map);
|
||||
if (retval) {
|
||||
com_err("ext2fs_allocate_inode_bitmap", retval,
|
||||
"while allocating inode_dup_map");
|
||||
@ -127,8 +128,8 @@ void pass1_dupblocks(ext2_filsys fs, char *block_buf)
|
||||
* Time to free all of the accumulated data structures that we
|
||||
* don't need anymore.
|
||||
*/
|
||||
free(inode_dup_map); inode_dup_map = 0;
|
||||
free(block_dup_map); block_dup_map = 0;
|
||||
ext2fs_free_inode_bitmap(inode_dup_map); inode_dup_map = 0;
|
||||
ext2fs_free_block_bitmap(block_dup_map); block_dup_map = 0;
|
||||
for (p = dup_blk; p; p = next_p) {
|
||||
next_p = p->next_block;
|
||||
for (q = p; q; q = next_q) {
|
||||
@ -177,7 +178,7 @@ void pass1b(ext2_filsys fs, char *block_buf)
|
||||
while (ino) {
|
||||
stashed_ino = ino;
|
||||
if ((ino != EXT2_BAD_INO) &&
|
||||
(!ext2fs_test_inode_bitmap(fs, inode_used_map, ino) ||
|
||||
(!ext2fs_test_inode_bitmap(inode_used_map, ino) ||
|
||||
!inode_has_valid_blocks(&inode)))
|
||||
goto next;
|
||||
|
||||
@ -230,17 +231,17 @@ int process_pass1b_block(ext2_filsys fs,
|
||||
return 0;
|
||||
p = (struct process_block_struct *) private;
|
||||
|
||||
if (ext2fs_test_block_bitmap(fs, block_dup_map, *block_nr)) {
|
||||
if (ext2fs_test_block_bitmap(block_dup_map, *block_nr)) {
|
||||
/* OK, this is a duplicate block */
|
||||
if (p->ino != EXT2_BAD_INO) {
|
||||
if (!p->dup_blocks)
|
||||
printf("Duplicate/bad block(s) in inode %ld:",
|
||||
printf("Duplicate/bad block(s) in inode %lu:",
|
||||
p->ino);
|
||||
printf(" %ld", *block_nr);
|
||||
printf(" %lu", *block_nr);
|
||||
}
|
||||
p->dup_blocks++;
|
||||
ext2fs_mark_block_bitmap(fs, block_dup_map, *block_nr);
|
||||
ext2fs_mark_inode_bitmap(fs, inode_dup_map, p->ino);
|
||||
ext2fs_mark_block_bitmap(block_dup_map, *block_nr);
|
||||
ext2fs_mark_inode_bitmap(inode_dup_map, p->ino);
|
||||
dp = allocate_memory(sizeof(struct dup_block),
|
||||
"duplicate block record");
|
||||
dp->block = *block_nr;
|
||||
@ -340,7 +341,7 @@ void pass1c(ext2_filsys fs, char *block_buf)
|
||||
((dir_blocks[i].blockcnt == 0) && (entry <= 2)))
|
||||
goto next;
|
||||
|
||||
if (!ext2fs_test_inode_bitmap(fs, inode_dup_map,
|
||||
if (!ext2fs_test_inode_bitmap(inode_dup_map,
|
||||
dirent->inode))
|
||||
goto next;
|
||||
|
||||
@ -369,7 +370,7 @@ void pass1c(ext2_filsys fs, char *block_buf)
|
||||
*/
|
||||
for (p = dup_ino; p; p = p->next) {
|
||||
if (!p->pathname) {
|
||||
sprintf(buf, "<Unknown inode #%ld>", p->ino);
|
||||
sprintf(buf, "<Unknown inode #%lu>", p->ino);
|
||||
p->pathname = malloc(strlen(buf)+1);
|
||||
if (!p->pathname) {
|
||||
fprintf(stderr, "pass1c: couldn't malloc "
|
||||
@ -440,7 +441,7 @@ static void pass1d(ext2_filsys fs, char *block_buf)
|
||||
}
|
||||
time_str = ctime(&p->mtime);
|
||||
time_str[24] = 0;
|
||||
printf("File %s (inode #%ld, mod time %s) \n",
|
||||
printf("File %s (inode #%lu, mod time %s) \n",
|
||||
p->pathname, p->ino, time_str);
|
||||
printf(" has %d duplicate blocks, shared with %d file%s:\n",
|
||||
p->num_dupblocks, shared_len,
|
||||
@ -453,7 +454,7 @@ static void pass1d(ext2_filsys fs, char *block_buf)
|
||||
continue;
|
||||
time_str = ctime(&s->mtime);
|
||||
time_str[24] = 0;
|
||||
printf("\t%s (inode #%ld, mod time %s)\n",
|
||||
printf("\t%s (inode #%lu, mod time %s)\n",
|
||||
s->pathname, s->ino, time_str);
|
||||
}
|
||||
if (file_ok) {
|
||||
@ -489,22 +490,22 @@ static int delete_file_block(ext2_filsys fs,
|
||||
if (!*block_nr)
|
||||
return 0;
|
||||
|
||||
if (ext2fs_test_block_bitmap(fs, block_dup_map, *block_nr)) {
|
||||
if (ext2fs_test_block_bitmap(block_dup_map, *block_nr)) {
|
||||
for (p = dup_blk; p; p = p->next_block)
|
||||
if (p->block == *block_nr)
|
||||
break;
|
||||
if (p) {
|
||||
p->num_bad--;
|
||||
if (p->num_bad == 1)
|
||||
ext2fs_unmark_block_bitmap(fs, block_dup_map,
|
||||
ext2fs_unmark_block_bitmap(block_dup_map,
|
||||
*block_nr);
|
||||
} else
|
||||
com_err("delete_file_block", 0,
|
||||
"internal error; can't find dup_blk for %d\n",
|
||||
*block_nr);
|
||||
} else {
|
||||
ext2fs_unmark_block_bitmap(fs, block_found_map, *block_nr);
|
||||
ext2fs_unmark_block_bitmap(fs, fs->block_map, *block_nr);
|
||||
ext2fs_unmark_block_bitmap(block_found_map, *block_nr);
|
||||
ext2fs_unmark_block_bitmap(fs->block_map, *block_nr);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -525,27 +526,17 @@ static void delete_file(ext2_filsys fs, struct dup_inode *dp, char* block_buf)
|
||||
com_err("delete_file", retval,
|
||||
"while calling ext2fs_block_iterate for inode %d",
|
||||
dp->ino);
|
||||
ext2fs_unmark_inode_bitmap(fs, inode_used_map, dp->ino);
|
||||
ext2fs_unmark_inode_bitmap(fs, inode_dir_map, dp->ino);
|
||||
ext2fs_unmark_inode_bitmap(inode_used_map, dp->ino);
|
||||
ext2fs_unmark_inode_bitmap(inode_dir_map, dp->ino);
|
||||
if (inode_bad_map)
|
||||
ext2fs_unmark_inode_bitmap(fs, inode_bad_map, dp->ino);
|
||||
ext2fs_unmark_inode_bitmap(fs, fs->inode_map, dp->ino);
|
||||
ext2fs_unmark_inode_bitmap(inode_bad_map, dp->ino);
|
||||
ext2fs_unmark_inode_bitmap(fs->inode_map, dp->ino);
|
||||
ext2fs_mark_ib_dirty(fs);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
retval = ext2fs_read_inode(fs, dp->ino, &inode);
|
||||
if (retval) {
|
||||
com_err("delete_file", retval, "while reading inode %d",
|
||||
dp->ino);
|
||||
return;
|
||||
}
|
||||
e2fsck_read_inode(fs, dp->ino, &inode, "delete_file");
|
||||
inode.i_links_count = 0;
|
||||
inode.i_dtime = time(0);
|
||||
retval = ext2fs_write_inode(fs, dp->ino, &inode);
|
||||
if (retval) {
|
||||
com_err("delete_file", retval, "while writing inode %d",
|
||||
dp->ino);
|
||||
return;
|
||||
}
|
||||
e2fsck_write_inode(fs, dp->ino, &inode, "delete_file");
|
||||
}
|
||||
|
||||
struct clone_struct {
|
||||
@ -566,7 +557,7 @@ static int clone_file_block(ext2_filsys fs,
|
||||
if (!*block_nr)
|
||||
return 0;
|
||||
|
||||
if (ext2fs_test_block_bitmap(fs, block_dup_map, *block_nr)) {
|
||||
if (ext2fs_test_block_bitmap(block_dup_map, *block_nr)) {
|
||||
for (p = dup_blk; p; p = p->next_block)
|
||||
if (p->block == *block_nr)
|
||||
break;
|
||||
@ -591,12 +582,12 @@ static int clone_file_block(ext2_filsys fs,
|
||||
}
|
||||
p->num_bad--;
|
||||
if (p->num_bad == 1)
|
||||
ext2fs_unmark_block_bitmap(fs, block_dup_map,
|
||||
ext2fs_unmark_block_bitmap(block_dup_map,
|
||||
*block_nr);
|
||||
*block_nr = new_block;
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map,
|
||||
ext2fs_mark_block_bitmap(block_found_map,
|
||||
new_block);
|
||||
ext2fs_mark_block_bitmap(fs, fs->block_map, new_block);
|
||||
ext2fs_mark_block_bitmap(fs->block_map, new_block);
|
||||
return BLOCK_CHANGED;
|
||||
} else
|
||||
com_err("clone_file_block", 0,
|
||||
|
123
e2fsck/pass2.c
123
e2fsck/pass2.c
@ -79,7 +79,7 @@ void pass2(ext2_filsys fs)
|
||||
free(buf);
|
||||
free(dir_blocks);
|
||||
if (inode_bad_map) {
|
||||
free(inode_bad_map);
|
||||
ext2fs_free_inode_bitmap(inode_bad_map);
|
||||
inode_bad_map = 0;
|
||||
}
|
||||
if (tflag > 1) {
|
||||
@ -103,7 +103,7 @@ static int check_dot(ext2_filsys fs,
|
||||
char name[BLOCK_SIZE];
|
||||
|
||||
if (!dirent->inode) {
|
||||
printf("Missing '.' in directory inode %ld.\n", ino);
|
||||
printf("Missing '.' in directory inode %lu.\n", ino);
|
||||
if (dirent->rec_len < 12)
|
||||
fatal_error("Cannot fix, insufficient space to add '.'");
|
||||
preenhalt();
|
||||
@ -122,13 +122,13 @@ static int check_dot(ext2_filsys fs,
|
||||
strncmp(dirent->name, ".", dirent->name_len)) {
|
||||
strncpy(name, dirent->name, dirent->name_len);
|
||||
name[dirent->name_len] = '\0';
|
||||
printf("Missing '.' in directory inode %ld.\n", ino);
|
||||
printf("Missing '.' in directory inode %lu.\n", ino);
|
||||
printf("Cannot fix, first entry in directory contains '%s'\n",
|
||||
name);
|
||||
exit(FSCK_ERROR);
|
||||
}
|
||||
if (dirent->inode != ino) {
|
||||
printf("Bad inode number for '.' in directory inode %ld.\n",
|
||||
printf("Bad inode number for '.' in directory inode %lu.\n",
|
||||
ino);
|
||||
preenhalt();
|
||||
if (ask("Fix", 1)) {
|
||||
@ -166,10 +166,10 @@ static int check_dotdot(ext2_filsys fs,
|
||||
struct dir_info *dir)
|
||||
{
|
||||
char name[BLOCK_SIZE];
|
||||
int ino = dir->ino;
|
||||
ino_t ino = dir->ino;
|
||||
|
||||
if (!dirent->inode) {
|
||||
printf("Missing '..' in directory inode %d.\n", ino);
|
||||
printf("Missing '..' in directory inode %lu.\n", ino);
|
||||
if (dirent->rec_len < 12)
|
||||
fatal_error("Cannot fix, insufficient space to add '..'");
|
||||
preenhalt();
|
||||
@ -192,7 +192,7 @@ static int check_dotdot(ext2_filsys fs,
|
||||
strncmp(dirent->name, "..", dirent->name_len)) {
|
||||
strncpy(name, dirent->name, dirent->name_len);
|
||||
name[dirent->name_len] = '\0';
|
||||
printf("Missing '..' in directory inode %d.\n", ino);
|
||||
printf("Missing '..' in directory inode %lu.\n", ino);
|
||||
printf("Cannot fix, first entry in directory contains %s\n",
|
||||
name);
|
||||
exit(FSCK_ERROR);
|
||||
@ -201,6 +201,8 @@ static int check_dotdot(ext2_filsys fs,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char unknown_pathname[] = "???";
|
||||
|
||||
/*
|
||||
* Check to make sure a directory entry doesn't contain any illegal
|
||||
* characters.
|
||||
@ -223,12 +225,13 @@ static int check_name(ext2_filsys fs,
|
||||
0, &pathname);
|
||||
if (retval) {
|
||||
com_err(program_name, retval, "while getting pathname in check_name");
|
||||
fatal_error(0);
|
||||
pathname = unknown_pathname;
|
||||
}
|
||||
printf ("Bad file name '%s' (contains '/' or "
|
||||
" null) in directory '%s'",
|
||||
pathname, name);
|
||||
free(pathname);
|
||||
" null) in directory '%s' (%lu)\n",
|
||||
name, pathname, dir_ino);
|
||||
if (pathname != unknown_pathname)
|
||||
free(pathname);
|
||||
preenhalt();
|
||||
fixup = ask("Replace '/' or null by '.'", 1);
|
||||
}
|
||||
@ -256,13 +259,12 @@ static int check_dir_block(ext2_filsys fs,
|
||||
int dot_state;
|
||||
blk_t block_nr = db->blk;
|
||||
ino_t ino = db->ino;
|
||||
static char unknown[] = "???";
|
||||
|
||||
/*
|
||||
* Make sure the inode is still in use (could have been
|
||||
* deleted in the duplicate/bad blocks pass.
|
||||
*/
|
||||
if (!(ext2fs_test_inode_bitmap(fs, inode_used_map, ino)))
|
||||
if (!(ext2fs_test_inode_bitmap(inode_used_map, ino)))
|
||||
return 0;
|
||||
|
||||
if (db->blockcnt)
|
||||
@ -271,7 +273,7 @@ static int check_dir_block(ext2_filsys fs,
|
||||
dot_state = 0;
|
||||
|
||||
#if 0
|
||||
printf("In process_dir_block block %d, #%d, inode %d\n", block_nr,
|
||||
printf("In process_dir_block block %lu, #%d, inode %lu\n", block_nr,
|
||||
db->blockcnt, ino);
|
||||
#endif
|
||||
|
||||
@ -287,7 +289,7 @@ static int check_dir_block(ext2_filsys fs,
|
||||
if (((offset + dirent->rec_len) > fs->blocksize) ||
|
||||
(dirent->rec_len < 8) ||
|
||||
((dirent->name_len+8) > dirent->rec_len)) {
|
||||
printf("Directory inode %ld, block %d, offset %d: directory corrupted\n",
|
||||
printf("Directory inode %lu, block %d, offset %d: directory corrupted\n",
|
||||
ino, db->blockcnt, offset);
|
||||
preenhalt();
|
||||
if (ask("Salvage", 1)) {
|
||||
@ -308,7 +310,7 @@ static int check_dir_block(ext2_filsys fs,
|
||||
} else if (dot_state == 2) {
|
||||
dir = get_dir_info(ino);
|
||||
if (!dir) {
|
||||
printf("Internal error: couldn't find dir_info for %ld\n",
|
||||
printf("Internal error: couldn't find dir_info for %lu\n",
|
||||
ino);
|
||||
fatal_error(0);
|
||||
}
|
||||
@ -317,10 +319,10 @@ static int check_dir_block(ext2_filsys fs,
|
||||
} else if (dirent->inode == ino) {
|
||||
retval = ext2fs_get_pathname(fs, ino, 0, &path1);
|
||||
if (retval)
|
||||
path1 = unknown;
|
||||
printf("Entry '%s' in %s (%ld) is a link to '.' ",
|
||||
path1 = unknown_pathname;
|
||||
printf("Entry '%s' in %s (%lu) is a link to '.' ",
|
||||
name, path1, ino);
|
||||
if (path1 != unknown)
|
||||
if (path1 != unknown_pathname)
|
||||
free(path1);
|
||||
preenhalt();
|
||||
if (ask("Clear", 1)) {
|
||||
@ -332,7 +334,7 @@ static int check_dir_block(ext2_filsys fs,
|
||||
goto next;
|
||||
|
||||
#if 0
|
||||
printf("Entry '%s', name_len %d, rec_len %d, inode %d... ",
|
||||
printf("Entry '%s', name_len %d, rec_len %d, inode %lu... ",
|
||||
name, dirent->name_len, dirent->rec_len, dirent->inode);
|
||||
#endif
|
||||
if (check_name(fs, dirent, ino, name))
|
||||
@ -346,10 +348,10 @@ static int check_dir_block(ext2_filsys fs,
|
||||
(dirent->inode > fs->super->s_inodes_count)) {
|
||||
retval = ext2fs_get_pathname(fs, ino, 0, &path1);
|
||||
if (retval)
|
||||
path1 = unknown;
|
||||
printf("Entry '%s' in %s (%ld) has bad inode #: %ld.\n",
|
||||
path1 = unknown_pathname;
|
||||
printf("Entry '%s' in %s (%lu) has bad inode #: %lu.\n",
|
||||
name, path1, ino, dirent->inode);
|
||||
if (path1 != unknown)
|
||||
if (path1 != unknown_pathname)
|
||||
free(path1);
|
||||
preenhalt();
|
||||
if (ask("Clear", 1)) {
|
||||
@ -363,14 +365,14 @@ static int check_dir_block(ext2_filsys fs,
|
||||
/*
|
||||
* If the inode is unusued, offer to clear it.
|
||||
*/
|
||||
if (!(ext2fs_test_inode_bitmap(fs, inode_used_map,
|
||||
if (!(ext2fs_test_inode_bitmap(inode_used_map,
|
||||
dirent->inode))) {
|
||||
retval = ext2fs_get_pathname(fs, ino, 0, &path1);
|
||||
if (retval)
|
||||
path1 = unknown;
|
||||
printf("Entry '%s' in %s (%ld) has deleted/unused inode %ld.\n",
|
||||
path1 = unknown_pathname;
|
||||
printf("Entry '%s' in %s (%lu) has deleted/unused inode %lu.\n",
|
||||
name, path1, ino, dirent->inode);
|
||||
if (path1 != unknown)
|
||||
if (path1 != unknown_pathname)
|
||||
free(path1);
|
||||
if (ask("Clear", 1)) {
|
||||
dirent->inode = 0;
|
||||
@ -387,7 +389,7 @@ static int check_dir_block(ext2_filsys fs,
|
||||
* pathname to the user.)
|
||||
*/
|
||||
if (inode_bad_map &&
|
||||
ext2fs_test_inode_bitmap(fs, inode_bad_map,
|
||||
ext2fs_test_inode_bitmap(inode_bad_map,
|
||||
dirent->inode)) {
|
||||
if (process_bad_inode(fs, ino, dirent->inode)) {
|
||||
dirent->inode = 0;
|
||||
@ -404,11 +406,11 @@ static int check_dir_block(ext2_filsys fs,
|
||||
* and ask the user if he/she wants to clear this one.
|
||||
*/
|
||||
if ((dot_state > 2) &&
|
||||
(ext2fs_test_inode_bitmap(fs, inode_dir_map,
|
||||
(ext2fs_test_inode_bitmap(inode_dir_map,
|
||||
dirent->inode))) {
|
||||
subdir = get_dir_info(dirent->inode);
|
||||
if (!subdir) {
|
||||
printf("INTERNAL ERROR: missing dir %ld\n",
|
||||
printf("INTERNAL ERROR: missing dir %lu\n",
|
||||
dirent->inode);
|
||||
fatal_error(0);
|
||||
}
|
||||
@ -416,19 +418,19 @@ static int check_dir_block(ext2_filsys fs,
|
||||
retval = ext2fs_get_pathname(fs, ino,
|
||||
0, &path1);
|
||||
if (retval)
|
||||
path1 = unknown;
|
||||
path1 = unknown_pathname;
|
||||
retval = ext2fs_get_pathname(fs,
|
||||
subdir->parent,
|
||||
dirent->inode,
|
||||
&path2);
|
||||
if (retval)
|
||||
path2 = unknown;
|
||||
printf("Entry '%s' in %s (%ld) is a link to directory %s (%ld).\n",
|
||||
path2 = unknown_pathname;
|
||||
printf("Entry '%s' in %s (%lu) is a link to directory %s (%lu).\n",
|
||||
name, path1, ino, path2,
|
||||
dirent->inode);
|
||||
if (path1 != unknown)
|
||||
if (path1 != unknown_pathname)
|
||||
free(path1);
|
||||
if (path2 != unknown)
|
||||
if (path2 != unknown_pathname)
|
||||
free(path2);
|
||||
if (ask("Clear", 1)) {
|
||||
dirent->inode = 0;
|
||||
@ -477,8 +479,8 @@ static int deallocate_inode_block(ext2_filsys fs,
|
||||
{
|
||||
if (!*block_nr)
|
||||
return 0;
|
||||
ext2fs_unmark_block_bitmap(fs, block_found_map, *block_nr);
|
||||
ext2fs_unmark_block_bitmap(fs, fs->block_map, *block_nr);
|
||||
ext2fs_unmark_block_bitmap(block_found_map, *block_nr);
|
||||
ext2fs_unmark_block_bitmap(fs->block_map, *block_nr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -491,29 +493,20 @@ static void deallocate_inode(ext2_filsys fs, ino_t ino,
|
||||
errcode_t retval;
|
||||
struct ext2_inode inode;
|
||||
|
||||
retval = ext2fs_read_inode(fs, ino, &inode);
|
||||
if (retval) {
|
||||
com_err("deallocate_inode", retval, "while reading inode %d",
|
||||
ino);
|
||||
return;
|
||||
}
|
||||
e2fsck_read_inode(fs, ino, &inode, "deallocate_inode");
|
||||
inode.i_links_count = 0;
|
||||
inode.i_dtime = time(0);
|
||||
retval = ext2fs_write_inode(fs, ino, &inode);
|
||||
if (retval) {
|
||||
com_err("deallocate_inode", retval, "while writing inode %d",
|
||||
ino);
|
||||
return;
|
||||
}
|
||||
e2fsck_write_inode(fs, ino, &inode, "deallocate_inode");
|
||||
|
||||
/*
|
||||
* Fix up the bitmaps...
|
||||
*/
|
||||
read_bitmaps(fs);
|
||||
ext2fs_unmark_inode_bitmap(fs, inode_used_map, ino);
|
||||
ext2fs_unmark_inode_bitmap(fs, inode_dir_map, ino);
|
||||
ext2fs_unmark_inode_bitmap(inode_used_map, ino);
|
||||
ext2fs_unmark_inode_bitmap(inode_dir_map, ino);
|
||||
if (inode_bad_map)
|
||||
ext2fs_unmark_inode_bitmap(fs, inode_bad_map, ino);
|
||||
ext2fs_unmark_inode_bitmap(fs, fs->inode_map, ino);
|
||||
ext2fs_unmark_inode_bitmap(inode_bad_map, ino);
|
||||
ext2fs_unmark_inode_bitmap(fs->inode_map, ino);
|
||||
ext2fs_mark_ib_dirty(fs);
|
||||
|
||||
if (!inode_has_valid_blocks(&inode))
|
||||
@ -540,7 +533,7 @@ static void check_for_zero_long(ext2_filsys fs, ino_t ino, char *pathname,
|
||||
char prompt[80];
|
||||
|
||||
if (*val) {
|
||||
printf("%s for inode %ld (%s) is %ld, should be zero.\n",
|
||||
printf("%s for inode %lu (%s) is %lu, should be zero.\n",
|
||||
name, ino, pathname, *val);
|
||||
preenhalt();
|
||||
sprintf(prompt, "Clear %s", name);
|
||||
@ -559,7 +552,7 @@ static void check_for_zero_char(ext2_filsys fs, ino_t ino, char *pathname,
|
||||
char prompt[80];
|
||||
|
||||
if (*val) {
|
||||
printf("%s for inode %ld (%s) is %d, should be zero.\n",
|
||||
printf("%s for inode %lu (%s) is %d, should be zero.\n",
|
||||
name, ino, pathname, *val);
|
||||
preenhalt();
|
||||
sprintf(prompt, "Clear %s", name);
|
||||
@ -580,12 +573,7 @@ static int process_bad_inode(ext2_filsys fs, ino_t dir, ino_t ino)
|
||||
int inode_modified = 0;
|
||||
char *pathname;
|
||||
|
||||
retval = ext2fs_read_inode(fs, ino, &inode);
|
||||
if (retval) {
|
||||
com_err("process_bad_inode", retval, "while reading inode %d",
|
||||
ino);
|
||||
return 0;
|
||||
}
|
||||
e2fsck_read_inode(fs, ino, &inode, "process_bad_inode");
|
||||
retval = ext2fs_get_pathname(fs, dir, ino, &pathname);
|
||||
if (retval) {
|
||||
com_err("process_bad_inode", retval,
|
||||
@ -597,7 +585,7 @@ static int process_bad_inode(ext2_filsys fs, ino_t dir, ino_t ino)
|
||||
!S_ISCHR(inode.i_mode) && !S_ISBLK(inode.i_mode) &&
|
||||
!S_ISLNK(inode.i_mode) && !S_ISFIFO(inode.i_mode) &&
|
||||
!(S_ISSOCK(inode.i_mode))) {
|
||||
printf("Inode %ld (%s) has a bad mode (0%o).\n",
|
||||
printf("Inode %lu (%s) has a bad mode (0%o).\n",
|
||||
ino, pathname, inode.i_mode);
|
||||
preenhalt();
|
||||
if (ask("Clear", 1)) {
|
||||
@ -617,15 +605,8 @@ static int process_bad_inode(ext2_filsys fs, ino_t dir, ino_t ino)
|
||||
check_for_zero_long(fs, ino, pathname, "i_dir_acl", &inode.i_dir_acl,
|
||||
&inode_modified);
|
||||
free(pathname);
|
||||
if (inode_modified) {
|
||||
retval = ext2fs_write_inode(fs, ino, &inode);
|
||||
if (retval) {
|
||||
com_err("process_bad_inode", retval,
|
||||
"while writing inode %d",
|
||||
ino);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (inode_modified)
|
||||
e2fsck_write_inode(fs, ino, &inode, "process_bad_inode");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -38,14 +38,14 @@ static void check_root(ext2_filsys fs, ino_t root_ino);
|
||||
static void check_directory(ext2_filsys fs, ino_t dir);
|
||||
static ino_t get_lost_and_found(ext2_filsys fs);
|
||||
static void fix_dotdot(ext2_filsys fs, struct dir_info *dir, ino_t parent);
|
||||
static int adjust_inode_count(ext2_filsys fs, ino_t ino, int adj);
|
||||
static errcode_t adjust_inode_count(ext2_filsys fs, ino_t ino, int adj);
|
||||
static errcode_t expand_directory(ext2_filsys fs, ino_t dir);
|
||||
|
||||
static ino_t lost_and_found = 0;
|
||||
static int bad_lost_and_found = 0;
|
||||
|
||||
static char *inode_loop_detect;
|
||||
static char *inode_done_map;
|
||||
static ext2fs_inode_bitmap inode_loop_detect;
|
||||
static ext2fs_inode_bitmap inode_done_map;
|
||||
|
||||
void pass3(ext2_filsys fs)
|
||||
{
|
||||
@ -65,13 +65,16 @@ void pass3(ext2_filsys fs)
|
||||
/*
|
||||
* Allocate some bitmaps to do loop detection.
|
||||
*/
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, &inode_loop_detect);
|
||||
retval = ext2fs_allocate_inode_bitmap(fs,
|
||||
"inode loop detection bitmap",
|
||||
&inode_loop_detect);
|
||||
if (retval) {
|
||||
com_err("ext2fs_allocate_inode_bitmap", retval,
|
||||
"while allocating inode_loop_detect");
|
||||
fatal_error(0);
|
||||
}
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, &inode_done_map);
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, "inode done bitmap",
|
||||
&inode_done_map);
|
||||
if (retval) {
|
||||
com_err("ext2fs_allocate_inode_bitmap", retval,
|
||||
"while allocating inode_done_map");
|
||||
@ -83,16 +86,16 @@ void pass3(ext2_filsys fs)
|
||||
}
|
||||
|
||||
check_root(fs, EXT2_ROOT_INO);
|
||||
ext2fs_mark_inode_bitmap(fs, inode_done_map, EXT2_ROOT_INO);
|
||||
ext2fs_mark_inode_bitmap(inode_done_map, EXT2_ROOT_INO);
|
||||
|
||||
for (i=1; i <= fs->super->s_inodes_count; i++) {
|
||||
if (ext2fs_test_inode_bitmap(fs, inode_dir_map, i))
|
||||
if (ext2fs_test_inode_bitmap(inode_dir_map, i))
|
||||
check_directory(fs, i);
|
||||
}
|
||||
|
||||
free_dir_info(fs);
|
||||
free(inode_loop_detect);
|
||||
free(inode_done_map);
|
||||
ext2fs_free_inode_bitmap(inode_loop_detect);
|
||||
ext2fs_free_inode_bitmap(inode_done_map);
|
||||
if (tflag > 1) {
|
||||
printf("Pass 3: ");
|
||||
print_resource_track(&rtrack);
|
||||
@ -111,13 +114,13 @@ void check_root(ext2_filsys fs, ino_t root_ino)
|
||||
char * block;
|
||||
struct dir_info *dir;
|
||||
|
||||
if (ext2fs_test_inode_bitmap(fs, inode_used_map, root_ino)) {
|
||||
if (ext2fs_test_inode_bitmap(inode_used_map, root_ino)) {
|
||||
/*
|
||||
* If the root inode is a directory, die here. The
|
||||
* user must have answered 'no' in pass1 when we
|
||||
* offered to clear it.
|
||||
*/
|
||||
if (!(ext2fs_test_inode_bitmap(fs, inode_dir_map, root_ino)))
|
||||
if (!(ext2fs_test_inode_bitmap(inode_dir_map, root_ino)))
|
||||
fatal_error("Root inode not directory");
|
||||
|
||||
/*
|
||||
@ -148,8 +151,8 @@ void check_root(ext2_filsys fs, ino_t root_ino)
|
||||
"while trying to create root directory");
|
||||
fatal_error(0);
|
||||
}
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map, blk);
|
||||
ext2fs_mark_block_bitmap(fs, fs->block_map, blk);
|
||||
ext2fs_mark_block_bitmap(block_found_map, blk);
|
||||
ext2fs_mark_block_bitmap(fs->block_map, blk);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
|
||||
/*
|
||||
@ -199,9 +202,9 @@ void check_root(ext2_filsys fs, ino_t root_ino)
|
||||
inode_count[EXT2_ROOT_INO] = 2;
|
||||
inode_link_info[EXT2_ROOT_INO] = 2;
|
||||
|
||||
ext2fs_mark_inode_bitmap(fs, inode_used_map, EXT2_ROOT_INO);
|
||||
ext2fs_mark_inode_bitmap(fs, inode_dir_map, EXT2_ROOT_INO);
|
||||
ext2fs_mark_inode_bitmap(fs, fs->inode_map, EXT2_ROOT_INO);
|
||||
ext2fs_mark_inode_bitmap(inode_used_map, EXT2_ROOT_INO);
|
||||
ext2fs_mark_inode_bitmap(inode_dir_map, EXT2_ROOT_INO);
|
||||
ext2fs_mark_inode_bitmap(fs->inode_map, EXT2_ROOT_INO);
|
||||
ext2fs_mark_ib_dirty(fs);
|
||||
}
|
||||
|
||||
@ -223,12 +226,12 @@ static void check_directory(ext2_filsys fs, ino_t ino)
|
||||
|
||||
dir = get_dir_info(ino);
|
||||
if (!dir) {
|
||||
printf("Internal error: couldn't find dir_info for %ld\n",
|
||||
printf("Internal error: couldn't find dir_info for %lu\n",
|
||||
ino);
|
||||
fatal_error(0);
|
||||
}
|
||||
|
||||
memset(inode_loop_detect, 0, (fs->super->s_inodes_count / 8) + 1);
|
||||
ext2fs_clear_inode_bitmap(inode_loop_detect);
|
||||
p = dir;
|
||||
while (p) {
|
||||
/*
|
||||
@ -238,7 +241,7 @@ static void check_directory(ext2_filsys fs, ino_t ino)
|
||||
* already told us he doesn't want us to reconnect the
|
||||
* disconnected subtree.
|
||||
*/
|
||||
if (ext2fs_test_inode_bitmap(fs, inode_done_map, p->ino))
|
||||
if (ext2fs_test_inode_bitmap(inode_done_map, p->ino))
|
||||
goto check_dot_dot;
|
||||
/*
|
||||
* Mark this inode as being "done"; by the time we
|
||||
@ -247,17 +250,17 @@ static void check_directory(ext2_filsys fs, ino_t ino)
|
||||
* or we will have offered to reconnect this to
|
||||
* lost+found.
|
||||
*/
|
||||
ext2fs_mark_inode_bitmap(fs, inode_done_map, p->ino);
|
||||
ext2fs_mark_inode_bitmap(inode_done_map, p->ino);
|
||||
/*
|
||||
* If this directory doesn't have a parent, or we've
|
||||
* seen the parent once already, then offer to
|
||||
* reparent it to lost+found
|
||||
*/
|
||||
if (!p->parent ||
|
||||
(ext2fs_test_inode_bitmap(fs, inode_loop_detect,
|
||||
(ext2fs_test_inode_bitmap(inode_loop_detect,
|
||||
p->parent)))
|
||||
break;
|
||||
ext2fs_mark_inode_bitmap(fs, inode_loop_detect,
|
||||
ext2fs_mark_inode_bitmap(inode_loop_detect,
|
||||
p->parent);
|
||||
p = get_dir_info(p->parent);
|
||||
}
|
||||
@ -269,7 +272,7 @@ static void check_directory(ext2_filsys fs, ino_t ino)
|
||||
if (retval)
|
||||
path1 = unknown;
|
||||
|
||||
printf("Unconnected directory inode %li (%s)\n", p->ino, path1);
|
||||
printf("Unconnected directory inode %lu (%s)\n", p->ino, path1);
|
||||
if (path1 != unknown)
|
||||
free(path1);
|
||||
preenhalt();
|
||||
@ -301,7 +304,7 @@ check_dot_dot:
|
||||
if (retval)
|
||||
path3 = unknown;
|
||||
|
||||
printf("'..' in %s (%ld) is %s (%ld), should be %s (%ld).\n",
|
||||
printf("'..' in %s (%lu) is %s (%lu), should be %s (%lu).\n",
|
||||
path1, ino, path2, dir->dotdot,
|
||||
path3, dir->parent);
|
||||
if (path1 != unknown)
|
||||
@ -359,8 +362,8 @@ ino_t get_lost_and_found(ext2_filsys fs)
|
||||
"while trying to create /lost+found directory");
|
||||
return 0;
|
||||
}
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map, blk);
|
||||
ext2fs_mark_block_bitmap(fs, fs->block_map, blk);
|
||||
ext2fs_mark_block_bitmap(block_found_map, blk);
|
||||
ext2fs_mark_block_bitmap(fs->block_map, blk);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
|
||||
/*
|
||||
@ -373,9 +376,9 @@ ino_t get_lost_and_found(ext2_filsys fs)
|
||||
"while trying to create /lost+found directory");
|
||||
return 0;
|
||||
}
|
||||
ext2fs_mark_inode_bitmap(fs, inode_used_map, ino);
|
||||
ext2fs_mark_inode_bitmap(fs, inode_dir_map, ino);
|
||||
ext2fs_mark_inode_bitmap(fs, fs->inode_map, ino);
|
||||
ext2fs_mark_inode_bitmap(inode_used_map, ino);
|
||||
ext2fs_mark_inode_bitmap(inode_dir_map, ino);
|
||||
ext2fs_mark_inode_bitmap(fs->inode_map, ino);
|
||||
ext2fs_mark_ib_dirty(fs);
|
||||
|
||||
/*
|
||||
@ -433,7 +436,7 @@ ino_t get_lost_and_found(ext2_filsys fs)
|
||||
inode_count[ino] = 2;
|
||||
inode_link_info[ino] = 2;
|
||||
#if 0
|
||||
printf("/lost+found created; inode #%d\n", ino);
|
||||
printf("/lost+found created; inode #%lu\n", ino);
|
||||
#endif
|
||||
return ino;
|
||||
}
|
||||
@ -459,7 +462,7 @@ int reconnect_file(ext2_filsys fs, ino_t inode)
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(name, "#%ld", inode);
|
||||
sprintf(name, "#%lu", inode);
|
||||
retval = ext2fs_link(fs, lost_and_found, name, inode, 0);
|
||||
if (retval == EXT2_ET_DIR_NO_SPACE) {
|
||||
if (!ask("No room in /lost+found; expand /lost+found", 1))
|
||||
@ -473,7 +476,7 @@ int reconnect_file(ext2_filsys fs, ino_t inode)
|
||||
retval = ext2fs_link(fs, lost_and_found, name, inode, 0);
|
||||
}
|
||||
if (retval) {
|
||||
printf("Could not reconnect %ld: %s\n", inode,
|
||||
printf("Could not reconnect %lu: %s\n", inode,
|
||||
error_message(retval));
|
||||
return 1;
|
||||
}
|
||||
@ -486,7 +489,7 @@ int reconnect_file(ext2_filsys fs, ino_t inode)
|
||||
/*
|
||||
* Utility routine to adjust the inode counts on an inode.
|
||||
*/
|
||||
static int adjust_inode_count(ext2_filsys fs, ino_t ino, int adj)
|
||||
static errcode_t adjust_inode_count(ext2_filsys fs, ino_t ino, int adj)
|
||||
{
|
||||
errcode_t retval;
|
||||
struct ext2_inode inode;
|
||||
@ -499,7 +502,7 @@ static int adjust_inode_count(ext2_filsys fs, ino_t ino, int adj)
|
||||
return retval;
|
||||
|
||||
#if 0
|
||||
printf("Adjusting link count for inode %d by %d (from %d)\n", ino, adj,
|
||||
printf("Adjusting link count for inode %lu by %d (from %d)\n", ino, adj,
|
||||
inode.i_links_count);
|
||||
#endif
|
||||
|
||||
@ -539,11 +542,11 @@ static int fix_dotdot_proc(struct ext2_dir_entry *dirent,
|
||||
|
||||
retval = adjust_inode_count(fp->fs, dirent->inode, -1);
|
||||
if (retval)
|
||||
printf("Error while adjusting inode count on inode %ld\n",
|
||||
printf("Error while adjusting inode count on inode %lu\n",
|
||||
dirent->inode);
|
||||
retval = adjust_inode_count(fp->fs, fp->parent, 1);
|
||||
if (retval)
|
||||
printf("Error while adjusting inode count on inode %ld\n",
|
||||
printf("Error while adjusting inode count on inode %lu\n",
|
||||
fp->parent);
|
||||
|
||||
dirent->inode = fp->parent;
|
||||
@ -562,13 +565,13 @@ static void fix_dotdot(ext2_filsys fs, struct dir_info *dir, ino_t parent)
|
||||
fp.done = 0;
|
||||
|
||||
#if 0
|
||||
printf("Fixing '..' of inode %d to be %d...\n", dir->ino, parent);
|
||||
printf("Fixing '..' of inode %lu to be %lu...\n", dir->ino, parent);
|
||||
#endif
|
||||
|
||||
retval = ext2fs_dir_iterate(fs, dir->ino, DIRENT_FLAG_INCLUDE_EMPTY,
|
||||
0, fix_dotdot_proc, &fp);
|
||||
if (retval || !fp.done) {
|
||||
printf("Couldn't fix parent of inode %ld: %s\n\n",
|
||||
printf("Couldn't fix parent of inode %lu: %s\n\n",
|
||||
dir->ino, retval ? error_message(retval) :
|
||||
"Couldn't find parent direntory entry");
|
||||
ext2fs_unmark_valid(fs);
|
||||
@ -630,8 +633,8 @@ static int expand_dir_proc(ext2_filsys fs,
|
||||
}
|
||||
free(block);
|
||||
*blocknr = new_blk;
|
||||
ext2fs_mark_block_bitmap(fs, block_found_map, new_blk);
|
||||
ext2fs_mark_block_bitmap(fs, fs->block_map, new_blk);
|
||||
ext2fs_mark_block_bitmap(block_found_map, new_blk);
|
||||
ext2fs_mark_block_bitmap(fs->block_map, new_blk);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
if (es->done)
|
||||
return (BLOCK_CHANGED | BLOCK_ABORT);
|
||||
@ -673,9 +676,7 @@ static errcode_t expand_directory(ext2_filsys fs, ino_t dir)
|
||||
inode.i_size += fs->blocksize;
|
||||
inode.i_blocks += fs->blocksize / 512;
|
||||
|
||||
retval = ext2fs_write_inode(fs, dir, &inode);
|
||||
if (retval)
|
||||
return retval;
|
||||
e2fsck_write_inode(fs, dir, &inode, "expand_directory");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
void pass4(ext2_filsys fs)
|
||||
{
|
||||
int i;
|
||||
ino_t i;
|
||||
struct ext2_inode inode;
|
||||
struct resource_track rtrack;
|
||||
|
||||
@ -21,19 +21,19 @@ void pass4(ext2_filsys fs)
|
||||
#endif
|
||||
|
||||
if (!preen)
|
||||
printf("Pass 4: Check reference counts.\n");
|
||||
printf("Pass 4: Checking reference counts\n");
|
||||
for (i=1; i <= fs->super->s_inodes_count; i++) {
|
||||
if (i == EXT2_BAD_INO ||
|
||||
(i > EXT2_ROOT_INO && i < EXT2_FIRST_INO))
|
||||
continue;
|
||||
if (!(ext2fs_test_inode_bitmap(fs, inode_used_map, i)))
|
||||
if (!(ext2fs_test_inode_bitmap(inode_used_map, i)))
|
||||
continue;
|
||||
if (inode_count[i] == 0) {
|
||||
/*
|
||||
* Inode isn't attached to the filesystem;
|
||||
* prompt to reconnect.
|
||||
*/
|
||||
printf("Unattached inode %d\n", i);
|
||||
printf("Unattached inode %lu\n", i);
|
||||
preenhalt();
|
||||
if (ask("Connect to /lost+found", 1)) {
|
||||
if (reconnect_file(fs, i))
|
||||
@ -42,20 +42,20 @@ void pass4(ext2_filsys fs)
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
if (inode_count[i] != inode_link_info[i]) {
|
||||
ext2fs_read_inode(fs, i, &inode);
|
||||
e2fsck_read_inode(fs, i, &inode, "pass4");
|
||||
if (inode_link_info[i] != inode.i_links_count) {
|
||||
printf("WARNING: PROGRAMMING BUG IN E2FSCK!\n");
|
||||
printf("inode_link_info[%d] is %d, "
|
||||
printf("inode_link_info[%d] is %lu, "
|
||||
"inode.i_links_count is %d. "
|
||||
"They should be the same!\n",
|
||||
i, inode_link_info[i],
|
||||
inode.i_links_count);
|
||||
}
|
||||
printf("Inode %d has ref count %d, expecting %d.\n",
|
||||
printf("Inode %lu has ref count %d, expecting %d.\n",
|
||||
i, inode.i_links_count, inode_count[i]);
|
||||
if (ask("Set i_nlinks to count", 1)) {
|
||||
inode.i_links_count = inode_count[i];
|
||||
ext2fs_write_inode(fs, i, &inode);
|
||||
e2fsck_write_inode(fs, i, &inode, "pass4");
|
||||
} else
|
||||
ext2fs_unmark_valid(fs);
|
||||
}
|
||||
|
148
e2fsck/pass5.c
148
e2fsck/pass5.c
@ -29,7 +29,7 @@ void pass5(ext2_filsys fs)
|
||||
init_resource_track(&rtrack);
|
||||
|
||||
if (!preen)
|
||||
printf("Pass 5: Checking group summary information.\n");
|
||||
printf("Pass 5: Checking group summary information\n");
|
||||
|
||||
read_bitmaps(fs);
|
||||
|
||||
@ -38,9 +38,9 @@ void pass5(ext2_filsys fs)
|
||||
check_inode_end(fs);
|
||||
check_block_end(fs);
|
||||
|
||||
free(inode_used_map);
|
||||
free(inode_dir_map);
|
||||
free(block_found_map);
|
||||
ext2fs_free_inode_bitmap(inode_used_map);
|
||||
ext2fs_free_inode_bitmap(inode_dir_map);
|
||||
ext2fs_free_block_bitmap(block_found_map);
|
||||
|
||||
if (tflag > 1) {
|
||||
printf("Pass 5: ");
|
||||
@ -50,7 +50,7 @@ void pass5(ext2_filsys fs)
|
||||
|
||||
static void check_block_bitmaps(ext2_filsys fs)
|
||||
{
|
||||
int i;
|
||||
blk_t i;
|
||||
int *free_array;
|
||||
int group = 0;
|
||||
int blocks = 0;
|
||||
@ -65,15 +65,15 @@ static void check_block_bitmaps(ext2_filsys fs)
|
||||
for (i = fs->super->s_first_data_block;
|
||||
i < fs->super->s_blocks_count;
|
||||
i++) {
|
||||
actual = ext2fs_test_block_bitmap(fs, block_found_map, i);
|
||||
bitmap = ext2fs_test_block_bitmap(fs, fs->block_map, i);
|
||||
actual = ext2fs_test_block_bitmap(block_found_map, i);
|
||||
bitmap = ext2fs_test_block_bitmap(fs->block_map, i);
|
||||
|
||||
if (actual == bitmap)
|
||||
goto do_counts;
|
||||
|
||||
if (do_fix < 0)
|
||||
do_fix = ask(fix_question, 1);
|
||||
if (print_header) {
|
||||
if (!preen && print_header) {
|
||||
printf(print_header);
|
||||
print_header = 0;
|
||||
}
|
||||
@ -81,17 +81,19 @@ static void check_block_bitmaps(ext2_filsys fs)
|
||||
/*
|
||||
* Block not used, but marked in use in the bitmap.
|
||||
*/
|
||||
printf(" -%d", i);
|
||||
if (!preen)
|
||||
printf(" -%lu", i);
|
||||
if (do_fix)
|
||||
ext2fs_unmark_block_bitmap(fs, fs->block_map,
|
||||
ext2fs_unmark_block_bitmap(fs->block_map,
|
||||
i);
|
||||
} else {
|
||||
/*
|
||||
* Block used, but not marked in use in the bitmap.
|
||||
*/
|
||||
printf(" +%d", i);
|
||||
if (!preen)
|
||||
printf(" +%lu", i);
|
||||
if (do_fix)
|
||||
ext2fs_mark_block_bitmap(fs, fs->block_map,
|
||||
ext2fs_mark_block_bitmap(fs->block_map,
|
||||
i);
|
||||
}
|
||||
if (do_fix) {
|
||||
@ -120,9 +122,11 @@ static void check_block_bitmaps(ext2_filsys fs)
|
||||
if (free_array[i] != fs->group_desc[i].bg_free_blocks_count) {
|
||||
if (do_fix < 0)
|
||||
do_fix = ask(fix_question, 1);
|
||||
printf("Free blocks count wrong for group %d (%d, counted=%d). %s\n",
|
||||
i, fs->group_desc[i].bg_free_blocks_count,
|
||||
free_array[i], fix_msg[do_fix]);
|
||||
if (!preen)
|
||||
printf("Free blocks count wrong for "
|
||||
"group %lu (%u, counted=%d). %s\n", i,
|
||||
fs->group_desc[i].bg_free_blocks_count,
|
||||
free_array[i], fix_msg[do_fix]);
|
||||
if (do_fix) {
|
||||
fs->group_desc[i].bg_free_blocks_count =
|
||||
free_array[i];
|
||||
@ -134,9 +138,11 @@ static void check_block_bitmaps(ext2_filsys fs)
|
||||
if (free_blocks != fs->super->s_free_blocks_count) {
|
||||
if (do_fix < 0)
|
||||
do_fix = ask(fix_question, 1);
|
||||
printf("Free blocks count wrong (%ld, counted=%d). %s\n",
|
||||
fs->super->s_free_blocks_count, free_blocks,
|
||||
fix_msg[do_fix]);
|
||||
if (!preen)
|
||||
printf("Free blocks count wrong "
|
||||
"(%lu, counted=%d). %s\n",
|
||||
fs->super->s_free_blocks_count, free_blocks,
|
||||
fix_msg[do_fix]);
|
||||
if (do_fix) {
|
||||
fs->super->s_free_blocks_count = free_blocks;
|
||||
ext2fs_mark_super_dirty(fs);
|
||||
@ -147,7 +153,7 @@ static void check_block_bitmaps(ext2_filsys fs)
|
||||
|
||||
static void check_inode_bitmaps(ext2_filsys fs)
|
||||
{
|
||||
int i;
|
||||
ino_t i;
|
||||
int free_inodes = 0;
|
||||
int group_free = 0;
|
||||
int dirs_count = 0;
|
||||
@ -165,15 +171,15 @@ static void check_inode_bitmaps(ext2_filsys fs)
|
||||
"directory count array");
|
||||
|
||||
for (i = 1; i <= fs->super->s_inodes_count; i++) {
|
||||
actual = ext2fs_test_inode_bitmap(fs, inode_used_map, i);
|
||||
bitmap = ext2fs_test_inode_bitmap(fs, fs->inode_map, i);
|
||||
actual = ext2fs_test_inode_bitmap(inode_used_map, i);
|
||||
bitmap = ext2fs_test_inode_bitmap(fs->inode_map, i);
|
||||
|
||||
if (actual == bitmap)
|
||||
goto do_counts;
|
||||
|
||||
if (do_fix < 0)
|
||||
do_fix = ask(fix_question, 1);
|
||||
if (print_header) {
|
||||
if (!preen && print_header) {
|
||||
printf(print_header);
|
||||
print_header = 0;
|
||||
}
|
||||
@ -181,17 +187,18 @@ static void check_inode_bitmaps(ext2_filsys fs)
|
||||
/*
|
||||
* Inode wasn't used, but marked in bitmap
|
||||
*/
|
||||
printf(" -%d", i);
|
||||
if (!preen)
|
||||
printf(" -%lu", i);
|
||||
if (do_fix)
|
||||
ext2fs_unmark_inode_bitmap(fs, fs->inode_map,
|
||||
i);
|
||||
ext2fs_unmark_inode_bitmap(fs->inode_map, i);
|
||||
} else if (actual && !bitmap) {
|
||||
/*
|
||||
* Inode used, but not in bitmap
|
||||
*/
|
||||
printf (" +%d", i);
|
||||
if (!preen)
|
||||
printf (" +%lu", i);
|
||||
if (do_fix)
|
||||
ext2fs_mark_inode_bitmap(fs, fs->inode_map, i);
|
||||
ext2fs_mark_inode_bitmap(fs->inode_map, i);
|
||||
}
|
||||
if (do_fix) {
|
||||
ext2fs_mark_ib_dirty(fs);
|
||||
@ -204,7 +211,7 @@ do_counts:
|
||||
group_free++;
|
||||
free_inodes++;
|
||||
} else {
|
||||
if (ext2fs_test_inode_bitmap(fs, inode_dir_map, i))
|
||||
if (ext2fs_test_inode_bitmap(inode_dir_map, i))
|
||||
dirs_count++;
|
||||
}
|
||||
inodes++;
|
||||
@ -225,9 +232,11 @@ do_counts:
|
||||
if (free_array[i] != fs->group_desc[i].bg_free_inodes_count) {
|
||||
if (do_fix < 0)
|
||||
do_fix = ask(fix_question, 1);
|
||||
printf ("Free inodes count wrong for group #%d (%d, counted=%d). %s\n",
|
||||
i, fs->group_desc[i].bg_free_inodes_count,
|
||||
free_array[i], fix_msg[do_fix]);
|
||||
if (!preen)
|
||||
printf ("Free inodes count wrong for "
|
||||
"group #%lu (%u, counted=%d). %s\n", i,
|
||||
fs->group_desc[i].bg_free_inodes_count,
|
||||
free_array[i], fix_msg[do_fix]);
|
||||
if (do_fix) {
|
||||
fs->group_desc[i].bg_free_inodes_count =
|
||||
free_array[i];
|
||||
@ -238,9 +247,11 @@ do_counts:
|
||||
if (dir_array[i] != fs->group_desc[i].bg_used_dirs_count) {
|
||||
if (do_fix < 0)
|
||||
do_fix = ask(fix_question, 1);
|
||||
printf ("Directories count wrong for group #%d (%d, counted=%d). %s\n",
|
||||
i, fs->group_desc[i].bg_used_dirs_count,
|
||||
dir_array[i], fix_msg[do_fix]);
|
||||
if (!preen)
|
||||
printf ("Directories count wrong for "
|
||||
"group #%lu (%u, counted=%d). %s\n", i,
|
||||
fs->group_desc[i].bg_used_dirs_count,
|
||||
dir_array[i], fix_msg[do_fix]);
|
||||
if (do_fix) {
|
||||
fs->group_desc[i].bg_used_dirs_count =
|
||||
dir_array[i];
|
||||
@ -252,9 +263,11 @@ do_counts:
|
||||
if (free_inodes != fs->super->s_free_inodes_count) {
|
||||
if (do_fix < 0)
|
||||
do_fix = ask(fix_question, 1);
|
||||
printf("Free inodes count wrong (%ld, counted=%d). %s\n",
|
||||
fs->super->s_free_inodes_count, free_inodes,
|
||||
fix_msg[do_fix]);
|
||||
if (!preen)
|
||||
printf("Free inodes count wrong "
|
||||
"(%lu, counted=%d). %s\n",
|
||||
fs->super->s_free_inodes_count, free_inodes,
|
||||
fix_msg[do_fix]);
|
||||
if (do_fix) {
|
||||
fs->super->s_free_inodes_count = free_inodes;
|
||||
ext2fs_mark_super_dirty(fs);
|
||||
@ -265,23 +278,26 @@ do_counts:
|
||||
|
||||
static void check_inode_end(ext2_filsys fs)
|
||||
{
|
||||
ino_t end;
|
||||
ino_t save_inodes_count = fs->super->s_inodes_count;
|
||||
ino_t i;
|
||||
ino_t end, save_inodes_count, i;
|
||||
errcode_t retval;
|
||||
|
||||
end = EXT2_INODES_PER_GROUP(fs->super) * fs->group_desc_count;
|
||||
retval = ext2fs_fudge_inode_bitmap_end(fs->inode_map, end,
|
||||
&save_inodes_count);
|
||||
if (retval) {
|
||||
com_err("check_inode_end", retval,
|
||||
"while trying to fudge end of inode bitmap");
|
||||
fatal_error(0);
|
||||
}
|
||||
if (save_inodes_count == end)
|
||||
return;
|
||||
|
||||
fs->super->s_inodes_count = end;
|
||||
|
||||
for (i = save_inodes_count + 1; i <= end; i++) {
|
||||
if (!ext2fs_test_inode_bitmap(fs, fs->inode_map, i)) {
|
||||
if (!ext2fs_test_inode_bitmap(fs->inode_map, i)) {
|
||||
printf("Padding at end of inode bitmap is not set. ");
|
||||
if (ask("Fix", 1)) {
|
||||
for (i = save_inodes_count + 1; i <= end; i++)
|
||||
ext2fs_mark_inode_bitmap(fs,
|
||||
fs->inode_map,
|
||||
ext2fs_mark_inode_bitmap(fs->inode_map,
|
||||
i);
|
||||
ext2fs_mark_ib_dirty(fs);
|
||||
} else
|
||||
@ -290,31 +306,39 @@ static void check_inode_end(ext2_filsys fs)
|
||||
}
|
||||
}
|
||||
|
||||
fs->super->s_inodes_count = save_inodes_count;
|
||||
retval = ext2fs_fudge_inode_bitmap_end(fs->inode_map,
|
||||
save_inodes_count, 0);
|
||||
if (retval) {
|
||||
com_err("check_inode_end", retval,
|
||||
"while trying to fudge end of inode bitmap back");
|
||||
fatal_error(0);
|
||||
}
|
||||
}
|
||||
|
||||
static void check_block_end(ext2_filsys fs)
|
||||
{
|
||||
blk_t end;
|
||||
blk_t save_blocks_count = fs->super->s_blocks_count;
|
||||
blk_t i;
|
||||
|
||||
end = fs->super->s_first_data_block +
|
||||
(EXT2_BLOCKS_PER_GROUP(fs->super) * fs->group_desc_count);
|
||||
blk_t end, save_blocks_count, i;
|
||||
errcode_t retval;
|
||||
|
||||
end = fs->block_map->start +
|
||||
(EXT2_BLOCKS_PER_GROUP(fs->super) * fs->group_desc_count) - 1;
|
||||
retval = ext2fs_fudge_block_bitmap_end(fs->block_map, end,
|
||||
&save_blocks_count);
|
||||
if (retval) {
|
||||
com_err("check_block_end", retval,
|
||||
"while trying to fudge end of block bitmap");
|
||||
fatal_error(0);
|
||||
}
|
||||
if (save_blocks_count == end)
|
||||
return;
|
||||
|
||||
fs->super->s_blocks_count = end;
|
||||
|
||||
for (i = save_blocks_count; i < end; i++) {
|
||||
if (!ext2fs_test_block_bitmap(fs, fs->block_map, i)) {
|
||||
for (i = save_blocks_count + 1; i <= end; i++) {
|
||||
if (!ext2fs_test_block_bitmap(fs->block_map, i)) {
|
||||
printf("Padding at end of block bitmap is not set. ");
|
||||
|
||||
if (ask("Fix", 1)) {
|
||||
for (i = save_blocks_count + 1; i < end; i++)
|
||||
ext2fs_mark_block_bitmap(fs,
|
||||
fs->block_map,
|
||||
ext2fs_mark_block_bitmap(fs->block_map,
|
||||
i);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
} else
|
||||
@ -323,6 +347,12 @@ static void check_block_end(ext2_filsys fs)
|
||||
}
|
||||
}
|
||||
|
||||
fs->super->s_blocks_count = save_blocks_count;
|
||||
retval = ext2fs_fudge_block_bitmap_end(fs->block_map,
|
||||
save_blocks_count, 0);
|
||||
if (retval) {
|
||||
com_err("check_block_end", retval,
|
||||
"while trying to fudge end of block bitmap back");
|
||||
fatal_error(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
139
e2fsck/scantest.c
Normal file
139
e2fsck/scantest.c
Normal file
@ -0,0 +1,139 @@
|
||||
/*
|
||||
* scantest.c - test the speed of the inode scan routine
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <ctype.h>
|
||||
#include <termios.h>
|
||||
#include <time.h>
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
#include <mntent.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <malloc.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include "et/com_err.h"
|
||||
#include "../version.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs/ext2fs.h"
|
||||
|
||||
|
||||
extern int isatty(int);
|
||||
|
||||
const char * device_name = NULL;
|
||||
|
||||
/*
|
||||
* This structure is used for keeping track of how much resources have
|
||||
* been used for a particular pass of e2fsck.
|
||||
*/
|
||||
struct resource_track {
|
||||
struct timeval time_start;
|
||||
struct timeval user_start;
|
||||
struct timeval system_start;
|
||||
void *brk_start;
|
||||
};
|
||||
|
||||
struct resource_track global_rtrack;
|
||||
|
||||
void init_resource_track(struct resource_track *track)
|
||||
{
|
||||
struct rusage r;
|
||||
|
||||
track->brk_start = sbrk(0);
|
||||
gettimeofday(&track->time_start, 0);
|
||||
getrusage(RUSAGE_SELF, &r);
|
||||
track->user_start = r.ru_utime;
|
||||
track->system_start = r.ru_stime;
|
||||
}
|
||||
|
||||
static __inline__ float timeval_subtract(struct timeval *tv1,
|
||||
struct timeval *tv2)
|
||||
{
|
||||
return ((tv1->tv_sec - tv2->tv_sec) +
|
||||
((float) (tv1->tv_usec - tv2->tv_usec)) / 1000000);
|
||||
}
|
||||
|
||||
void print_resource_track(struct resource_track *track)
|
||||
{
|
||||
struct rusage r;
|
||||
struct timeval time_end;
|
||||
|
||||
gettimeofday(&time_end, 0);
|
||||
getrusage(RUSAGE_SELF, &r);
|
||||
|
||||
printf("Memory used: %d, elapsed time: %6.3f/%6.3f/%6.3f\n",
|
||||
(int) (((char *) sbrk(0)) - ((char *) track->brk_start)),
|
||||
timeval_subtract(&time_end, &track->time_start),
|
||||
timeval_subtract(&r.ru_utime, &track->user_start),
|
||||
timeval_subtract(&r.ru_stime, &track->system_start));
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
errcode_t retval = 0;
|
||||
int exit_value = 0;
|
||||
int i;
|
||||
ext2_filsys fs;
|
||||
ext2_inode_scan scan;
|
||||
ino_t ino;
|
||||
struct ext2_inode inode;
|
||||
|
||||
printf("size of inode=%d\n", sizeof(inode));
|
||||
|
||||
device_name = "/dev/hda3";
|
||||
|
||||
init_resource_track(&global_rtrack);
|
||||
|
||||
retval = ext2fs_open(device_name, 0,
|
||||
0, 0, unix_io_manager, &fs);
|
||||
if (retval) {
|
||||
com_err(argv[0], retval, "while trying to open %s",
|
||||
device_name);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
retval = ext2fs_open_inode_scan(fs, 0, &scan);
|
||||
if (retval) {
|
||||
com_err(argv[0], retval, "while opening inode scan");
|
||||
exit(1);
|
||||
}
|
||||
retval = ext2fs_get_next_inode(scan, &ino, &inode);
|
||||
if (retval) {
|
||||
com_err(argv[0], retval, "while starting inode scan");
|
||||
exit(1);
|
||||
}
|
||||
while (ino) {
|
||||
if (!inode.i_links_count)
|
||||
goto next;
|
||||
printf("%lu\n", inode.i_blocks);
|
||||
next:
|
||||
retval = ext2fs_get_next_inode(scan, &ino, &inode);
|
||||
if (retval) {
|
||||
com_err(argv[0], retval,
|
||||
"while doing inode scan");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ext2fs_close(fs);
|
||||
|
||||
print_resource_track(&global_rtrack);
|
||||
|
||||
return exit_value;
|
||||
}
|
@ -105,28 +105,21 @@ void read_bitmaps(ext2_filsys fs)
|
||||
{
|
||||
errcode_t retval;
|
||||
|
||||
if (!fs->inode_map) {
|
||||
ehandler_operation("reading inode bitmaps");
|
||||
retval = ext2fs_read_inode_bitmap(fs);
|
||||
ehandler_operation(0);
|
||||
if (retval) {
|
||||
com_err(program_name, retval,
|
||||
"while retrying to read inode bitmaps for %s",
|
||||
device_name);
|
||||
fatal_error(0);
|
||||
}
|
||||
if (invalid_bitmaps) {
|
||||
com_err(program_name, 0,
|
||||
"read_bitmaps: illegal bitmap block(s) for %s",
|
||||
device_name);
|
||||
fatal_error(0);
|
||||
}
|
||||
|
||||
if (!fs->block_map) {
|
||||
ehandler_operation("reading block bitmaps");
|
||||
retval = ext2fs_read_block_bitmap(fs);
|
||||
ehandler_operation(0);
|
||||
if (retval) {
|
||||
com_err(program_name, retval,
|
||||
"while retrying to read block bitmaps for %s",
|
||||
device_name);
|
||||
fatal_error(0);
|
||||
}
|
||||
|
||||
ehandler_operation("reading inode and block bitmaps");
|
||||
retval = ext2fs_read_bitmaps(fs);
|
||||
ehandler_operation(0);
|
||||
if (retval) {
|
||||
com_err(program_name, retval,
|
||||
"while retrying to read bitmaps for %s",
|
||||
device_name);
|
||||
fatal_error(0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,6 +194,32 @@ void print_resource_track(struct resource_track *track)
|
||||
timeval_subtract(&r.ru_stime, &track->system_start));
|
||||
}
|
||||
|
||||
void e2fsck_read_inode(ext2_filsys fs, unsigned long ino,
|
||||
struct ext2_inode * inode, const char *proc)
|
||||
{
|
||||
int retval;
|
||||
|
||||
retval = ext2fs_read_inode(fs, ino, inode);
|
||||
if (retval) {
|
||||
com_err("ext2fs_read_inode", retval,
|
||||
"while reading inode %ld in %s", ino, proc);
|
||||
fatal_error(0);
|
||||
}
|
||||
}
|
||||
|
||||
extern void e2fsck_write_inode(ext2_filsys fs, unsigned long ino,
|
||||
struct ext2_inode * inode, const char *proc)
|
||||
{
|
||||
int retval;
|
||||
|
||||
retval = ext2fs_write_inode(fs, ino, inode);
|
||||
if (retval) {
|
||||
com_err("ext2fs_write_inode", retval,
|
||||
"while writing inode %ld in %s", ino, proc);
|
||||
fatal_error(0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This function returns 1 if the inode's block entries actually
|
||||
* contain block entries.
|
||||
|
4
install-utils/ChangeLog
Normal file
4
install-utils/ChangeLog
Normal file
@ -0,0 +1,4 @@
|
||||
Sat Mar 11 18:26:33 1995 Theodore Y. Ts'o <tytso@localhost>
|
||||
|
||||
* compile_manpages: Include an exit 0 at the end because some
|
||||
implementations of man exit with a status of 1.
|
18
install-utils/compile_manpages
Normal file
18
install-utils/compile_manpages
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
MAN8="debugfs badblocks e2fsck mke2fs dumpe2fs mklost+found \
|
||||
fsck tune2fs"
|
||||
MAN1="lsattr chattr"
|
||||
|
||||
for i in $MAN8
|
||||
do
|
||||
man -S 8 $i > /dev/null
|
||||
done
|
||||
|
||||
|
||||
for i in $MAN1
|
||||
do
|
||||
man -S 1 $i > /dev/null
|
||||
done
|
||||
|
||||
exit 0
|
78
install-utils/convfstab
Normal file
78
install-utils/convfstab
Normal file
@ -0,0 +1,78 @@
|
||||
#!/bin/sh
|
||||
# Make /etc/fstab standard compliant.
|
||||
# M.Weller (eowmob@exp-math.uni-essen.de) 13.11.1994.
|
||||
# This script is public domain. Still if only slightly
|
||||
# modified a credit to me might be nice.
|
||||
|
||||
ROOT_PASS=1 # Pass for root file system
|
||||
NON_ROOT_PASS=2 # Pass for non root file systems
|
||||
DEF_FLAGS="defaults" # Default filesysflags
|
||||
DEF_DUMP=0 # Default dumpfreq.
|
||||
|
||||
while read LINE
|
||||
do
|
||||
set -- $LINE
|
||||
if [ $# != 0 ]
|
||||
then
|
||||
case $1 in
|
||||
\#* | !* )
|
||||
echo "$LINE"
|
||||
# Actually there are no comments allowed in /etc/fstab
|
||||
echo "Warning: comment in /etc/fstab detected." >&2
|
||||
echo "Please remove it by hand." >&2
|
||||
;;
|
||||
* )
|
||||
if [ $# -gt 6 -o $# -lt 3 ]
|
||||
then
|
||||
echo "Don't have a clue about \"$LINE\"." >&2
|
||||
echo "$LINE"
|
||||
else
|
||||
case $2 in
|
||||
/ )
|
||||
PASS=$ROOT_PASS
|
||||
;;
|
||||
none )
|
||||
PASS=0
|
||||
;;
|
||||
* )
|
||||
PASS=$NON_ROOT_PASS
|
||||
;;
|
||||
esac
|
||||
DUMP=$DEF_DUMP
|
||||
case $3 in
|
||||
ignore | iso9660 | msdos | hpfs | sysv | \
|
||||
xenix | coherent | nfs | proc | sw | swap )
|
||||
DUMP=0;
|
||||
PASS=0;
|
||||
;;
|
||||
esac
|
||||
case $# in
|
||||
3 )
|
||||
echo "$LINE $DEF_FLAGS $DUMP $PASS"
|
||||
;;
|
||||
4 )
|
||||
echo "$LINE $DUMP $PASS"
|
||||
;;
|
||||
5 )
|
||||
echo "$LINE $PASS"
|
||||
;;
|
||||
6)
|
||||
echo "$LINE"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "Warning: One empty line removed." >&2
|
||||
fi
|
||||
done </etc/fstab >/tmp/newfstab.$$
|
||||
mv -f /etc/fstab /etc/fstab.bak
|
||||
mv -f /tmp/newfstab.$$ /etc/fstab
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
echo "Installation of patched /etc/fstab failed."
|
||||
echo "It would have been:"
|
||||
cat /tmp/newfstab.$$
|
||||
rm -f /tmp/newfstab.$$
|
||||
fi
|
21
install-utils/remove_preformat_manpages
Normal file
21
install-utils/remove_preformat_manpages
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
PREFORMAT_ROOT=/usr/man/preformat
|
||||
COMPILED_ROOT=/usr/man
|
||||
|
||||
MAN8="debugfs.8 badblocks.8 e2fsck.8 mke2fs.8 dumpe2fs.8 mklost+found.8 \
|
||||
fsck.8 tune2fs.8"
|
||||
MAN1="lsattr.1 chattr.1"
|
||||
|
||||
for i in $MAN8
|
||||
do
|
||||
rm -f $PREFORMAT_ROOT/cat8/$i $COMPILED_ROOT/cat8/$i \
|
||||
$PREFORMAT_ROOT/cat8/$i.gz $COMPILED_ROOT/cat8/$i.gz
|
||||
done
|
||||
|
||||
|
||||
for i in $MAN1
|
||||
do
|
||||
rm -f $PREFORMAT_ROOT/cat1/$i $COMPILED_ROOT/cat1/$i \
|
||||
$PREFORMAT_ROOT/cat1/$i.gz $COMPILED_ROOT/cat1/$i.gz
|
||||
done
|
70
lib/Makefile.dll-lib
Normal file
70
lib/Makefile.dll-lib
Normal file
@ -0,0 +1,70 @@
|
||||
#
|
||||
# This is a Makefile stub which handles the creation of Linux DLL-style shared
|
||||
# libraries.
|
||||
#
|
||||
# In order to use this stub, the following makefile variables must be defined.
|
||||
#
|
||||
# DLL_ADDRESS = 0x80000000
|
||||
# DLL_JUMPSIZE = 0x1000
|
||||
# DLL_GOTSIZE = 0x1000
|
||||
# DLL_VERSION = 1.0
|
||||
# DLL_IMAGE = libce
|
||||
# DLL_STUB = libcom_err
|
||||
# DLL_MYDIR = et
|
||||
# DLL_INSTALL_DIR = $(SHLIBDIR)
|
||||
#
|
||||
|
||||
all:: image stubs
|
||||
|
||||
#
|
||||
# This is a horrible hack to try to find libgcc.a --- the DLL documentation
|
||||
# states that you should just be able to do -lgcc, but modern gcc
|
||||
# installation packages don't install /usr/lib/libgcc.a --- as well they
|
||||
# shouldn't since libgcc.a can be gcc version dependent.
|
||||
# If this hack doesn't work, try replacing it with a hardcoded path to
|
||||
# libgcc.a, or -lgcc.
|
||||
#
|
||||
#DLL_LIBGCC ="`$(CC) -v 2>&1 | head -1 | \
|
||||
# sed -e 's;[^/]*;;' -e 's/specs/libgcc.a/'`"
|
||||
DLL_LIBGCC ="`$(CC) --print-libgcc-file-name`"
|
||||
|
||||
image: $(DLL_IMAGE).so.$(DLL_VERSION)
|
||||
|
||||
stubs: $(DLL_STUB).sa $(OBJS)
|
||||
|
||||
$(DLL_IMAGE).so.$(DLL_VERSION): $(OBJS)
|
||||
(cd jump; export JUMP_DIR=`pwd`; \
|
||||
$(DLL_BIN)/mkimage -l $(DLL_IMAGE) -v $(DLL_VERSION) \
|
||||
-a $(DLL_ADDRESS) -j $(DLL_JUMPSIZE) -g $(DLL_GOTSIZE) -- \
|
||||
$(OBJS) -lc $(DLL_LIBS) $(DLL_LIBGCC) -lc)
|
||||
mv jump/$(DLL_IMAGE).so.$(DLL_VERSION) .
|
||||
|
||||
$(DLL_STUB).sa:
|
||||
(cd jump; export JUMP_DIR=`pwd`; \
|
||||
$(DLL_BIN)/mkstubs -l $(DLL_IMAGE) -v $(DLL_VERSION) \
|
||||
-a $(DLL_ADDRESS) -j $(DLL_JUMPSIZE) -g $(DLL_GOTSIZE) \
|
||||
-- $(DLL_STUB))
|
||||
mv jump/$(DLL_STUB).sa .
|
||||
@$(RM) ../$@
|
||||
@$(LN) $(DLL_MYDIR)/$@ ../$@
|
||||
|
||||
install:: $(DLL_IMAGE).so.$(DLL_VERSION)
|
||||
$(INSTALLBIN) $(DLL_IMAGE).so.$(DLL_VERSION) \
|
||||
$(DLL_INSTALL_DIR)/$(DLL_IMAGE).so.$(DLL_VERSION)
|
||||
-ldconfig
|
||||
|
||||
install-libs:: $(DLL_STUB).sa
|
||||
$(INSTALLLIB) $(DLL_STUB).sa $(LIBDIR)/$(DLL_STUB).sa
|
||||
$(CHMOD) 644 $(LIBDIR)/$(DLL_STUB).sa
|
||||
$(RANLIB) $(LIBDIR)/$(DLL_STUB).sa
|
||||
$(CHMOD) $(LIBMODE) $(LIBDIR)/$(DLL_STUB).sa
|
||||
|
||||
install-tree:: $(DLL_IMAGE).so.$(DLL_VERSION)
|
||||
rm -f ../../shlibs/$(DLL_IMAGE).so.$(DLL_VERSION)
|
||||
cp $(DLL_IMAGE).so.$(DLL_VERSION) ../../shlibs
|
||||
strip ../../shlibs/$(DLL_IMAGE).so.$(DLL_VERSION)
|
||||
chmod 555 ../../shlibs/$(DLL_IMAGE).so.$(DLL_VERSION)
|
||||
|
||||
clean::
|
||||
(cd jump; $(RM) *~ *.o *.s jump.log size.nm)
|
||||
$(RM) ../$(DLL_STUB).sa $(DLL_STUB).sa $(DLL_IMAGE).so.$(DLL_VERSION)
|
113
lib/e2p/.depend
113
lib/e2p/.depend
@ -1,77 +1,86 @@
|
||||
fgetflags.o : fgetflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/linux/errno.h /usr/include/fcntl.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/sys/ioctl.h \
|
||||
/usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/asm/types.h /usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
/usr/include/linux/dirent.h /usr/include/posix1_lim.h /usr/include/stdio.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h
|
||||
fgetversion.o : fgetversion.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/linux/errno.h /usr/include/fcntl.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/sys/ioctl.h \
|
||||
/usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/asm/types.h /usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
/usr/include/linux/dirent.h /usr/include/posix1_lim.h /usr/include/stdio.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h
|
||||
fsetflags.o : fsetflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/linux/errno.h /usr/include/fcntl.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/sys/ioctl.h \
|
||||
/usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/asm/types.h /usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
/usr/include/linux/dirent.h /usr/include/posix1_lim.h /usr/include/stdio.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h
|
||||
fsetversion.o : fsetversion.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/linux/errno.h /usr/include/fcntl.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/sys/ioctl.h \
|
||||
/usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/asm/types.h /usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \
|
||||
/usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
/usr/include/linux/dirent.h /usr/include/posix1_lim.h /usr/include/stdio.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h
|
||||
getflags.o : getflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/linux/errno.h /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \
|
||||
/usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/linux/termios.h \
|
||||
/usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/gnu/types.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
/usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \
|
||||
/usr/include/linux/termios.h /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h \
|
||||
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
getversion.o : getversion.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/linux/errno.h /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \
|
||||
/usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/linux/termios.h \
|
||||
/usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/gnu/types.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
/usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \
|
||||
/usr/include/linux/termios.h /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h \
|
||||
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
iod.o : iod.c /usr/include/dirent.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h e2p.h /usr/include/stdio.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/linux/ext2_fs.h
|
||||
ls.o : ls.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/time.h /usr/include/linux/ext2_fs.h \
|
||||
e2p.h /usr/include/dirent.h /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h \
|
||||
e2p.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h
|
||||
ls.o : ls.c /usr/include/grp.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/types.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/pwd.h /usr/include/time.h \
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \
|
||||
/usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h /usr/include/posix1_lim.h
|
||||
pe.o : pe.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h e2p.h \
|
||||
/usr/include/dirent.h /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h /usr/include/linux/types.h \
|
||||
/usr/include/asm/types.h e2p.h /usr/include/dirent.h /usr/include/gnu/types.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h
|
||||
pf.o : pf.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h e2p.h \
|
||||
/usr/include/dirent.h /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h /usr/include/linux/types.h \
|
||||
/usr/include/asm/types.h e2p.h /usr/include/dirent.h /usr/include/gnu/types.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h
|
||||
ps.o : ps.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h e2p.h \
|
||||
/usr/include/dirent.h /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h /usr/include/linux/types.h \
|
||||
/usr/include/asm/types.h e2p.h /usr/include/dirent.h /usr/include/gnu/types.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h
|
||||
setflags.o : setflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/linux/errno.h /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \
|
||||
/usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/linux/termios.h \
|
||||
/usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/gnu/types.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
/usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \
|
||||
/usr/include/linux/termios.h /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h \
|
||||
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
setversion.o : setversion.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/linux/errno.h /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \
|
||||
/usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/linux/termios.h \
|
||||
/usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/gnu/types.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/dirent.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
/usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \
|
||||
/usr/include/linux/termios.h /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h \
|
||||
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
|
||||
|
15
lib/e2p/ChangeLog
Normal file
15
lib/e2p/ChangeLog
Normal file
@ -0,0 +1,15 @@
|
||||
Mon Nov 7 21:59:12 1994 Remy Card <card@bbj>
|
||||
|
||||
* ls.c (list_super): List the new fields s_def_resuid and
|
||||
s_def_resgid.
|
||||
|
||||
(print_user): New function which prints the uid and the user name.
|
||||
|
||||
(print_group): New function which prints the gid and the group name.
|
||||
|
||||
Wed Aug 17 21:50:39 1994 Remy Card (card@bbj)
|
||||
|
||||
* pf.c (print_flags): New attributes are recognized and a long
|
||||
format can be used.
|
||||
|
||||
|
@ -5,14 +5,14 @@
|
||||
# This file can be redistributed under the terms of the GNU General
|
||||
# Public License
|
||||
|
||||
all::
|
||||
|
||||
include ../../MCONFIG
|
||||
|
||||
CFLAGS_NO= $(WFLAGS) -I..
|
||||
CFLAGS= $(OPT) $(CFLAGS_NO)
|
||||
LDFLAGS= $(OPT)
|
||||
|
||||
ARCHIVE=ar r
|
||||
RANLIB=ranlib
|
||||
RM=rm -f
|
||||
MV=mv
|
||||
LN=ln -s
|
||||
@ -21,12 +21,35 @@ OBJS= fgetflags.o fsetflags.o fgetversion.o fsetversion.o \
|
||||
getflags.o getversion.o iod.o ls.o pe.o pf.o ps.o \
|
||||
setflags.o setversion.o
|
||||
|
||||
ifdef BUILD_DLL_SHLIBS
|
||||
DLL_ADDRESS = 0x66980000
|
||||
DLL_JUMPSIZE = 0x1000
|
||||
DLL_GOTSIZE = 0x1000
|
||||
DLL_VERSION = 1.0
|
||||
DLL_IMAGE = libe2p
|
||||
DLL_STUB = libe2p
|
||||
DLL_MYDIR = e2p
|
||||
DLL_INSTALL_DIR = $(SHLIBDIR)
|
||||
|
||||
include ../Makefile.dll-lib
|
||||
endif
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $*.c
|
||||
ifdef BUILD_PROFILE_LIBS
|
||||
$(CC) $(CFLAGS_NO) -pg -o profiled/$*.o -c $*.c
|
||||
endif
|
||||
ifdef BUILD_DLL_SHLIBS
|
||||
(export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \
|
||||
-o jump/$*.o -c $*.c)
|
||||
endif
|
||||
# $(CC) $(CFLAGS_NO) -checker -g -o checker/$*.o -c $*.c
|
||||
|
||||
all: libe2p.a libe2p_p.a
|
||||
all:: libe2p.a
|
||||
|
||||
ifdef BUILD_PROFILE_LIBS
|
||||
all:: libe2p_p.a
|
||||
endif
|
||||
|
||||
libe2p.a: $(OBJS)
|
||||
$(RM) $@.bak
|
||||
@ -52,12 +75,21 @@ libe2p_chk.a: $(OBJS)
|
||||
$(RM) ../$@
|
||||
$(LN) e2p/$@ ../$@
|
||||
|
||||
install:
|
||||
install::
|
||||
|
||||
clean:
|
||||
install-libs::
|
||||
$(INSTALLLIB) libe2p.a $(LIBDIR)/libe2p.a
|
||||
$(CHMOD) 644 $(LIBDIR)/libe2p.a
|
||||
$(RANLIB) $(LIBDIR)/libe2p.a
|
||||
$(CHMOD) $(LIBMODE) $(LIBDIR)/libe2p.a
|
||||
|
||||
install-tree::
|
||||
|
||||
clean::
|
||||
rm -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/*
|
||||
rm -f ../libe2p.a ../libe2p_p.a
|
||||
|
||||
really-clean: clean
|
||||
really-clean:: clean
|
||||
rm -f .depend
|
||||
|
||||
dep depend .depend:
|
||||
|
@ -14,7 +14,7 @@ int iterate_on_dir (const char * dir_name,
|
||||
void * private);
|
||||
void list_super (struct ext2_super_block * s);
|
||||
void print_fs_errors (FILE * f, unsigned short errors);
|
||||
void print_flags (FILE * f, unsigned long flags);
|
||||
void print_flags (FILE * f, unsigned long flags, int long_format);
|
||||
void print_fs_state (FILE * f, unsigned short state);
|
||||
int setflags (int fd, unsigned long flags);
|
||||
int setversion (int fd, unsigned long version);
|
||||
|
13
lib/e2p/jump/jump.funcs
Normal file
13
lib/e2p/jump/jump.funcs
Normal file
@ -0,0 +1,13 @@
|
||||
00000000 T _fgetflags libe2p jump/fgetflags
|
||||
00000000 T _fsetflags libe2p jump/fsetflags
|
||||
00000000 T _fgetversion libe2p jump/fgetversion
|
||||
00000000 T _fsetversion libe2p jump/fsetversion
|
||||
00000000 T _getflags libe2p jump/getflags
|
||||
00000000 T _getversion libe2p jump/getversion
|
||||
00000000 T _iterate_on_dir libe2p jump/iod
|
||||
00000000 T _list_super libe2p jump/ls
|
||||
00000000 T _print_fs_errors libe2p jump/pe
|
||||
00000000 T _print_flags libe2p jump/pf
|
||||
00000000 T _print_fs_state libe2p jump/ps
|
||||
00000000 T _setflags libe2p jump/setflags
|
||||
00000000 T _setversion libe2p jump/setversion
|
164
lib/e2p/jump/jump.import
Normal file
164
lib/e2p/jump/jump.import
Normal file
@ -0,0 +1,164 @@
|
||||
/usr/lib/libc.sa(__libc.o):00001000 a __GOT_SIZE
|
||||
/usr/lib/libc.sa(__libc.o):6008f0b0 A _AL
|
||||
/usr/lib/libc.sa(__libc.o):6008f198 A _AL_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f060 A _AM
|
||||
/usr/lib/libc.sa(__libc.o):6008f0b4 A _BC
|
||||
/usr/lib/libc.sa(__libc.o):6008f064 A _BS
|
||||
/usr/lib/libc.sa(__libc.o):6008f0bc A _BT
|
||||
/usr/lib/libc.sa(__libc.o):6008f068 A _CA
|
||||
/usr/lib/libc.sa(__libc.o):6008f0c0 A _CD
|
||||
/usr/lib/libc.sa(__libc.o):6008f0c4 A _CE
|
||||
/usr/lib/libc.sa(__libc.o):6008f0c8 A _CL
|
||||
/usr/lib/libc.sa(__libc.o):6008f0cc A _CM
|
||||
/usr/lib/libc.sa(__libc.o):6008f048 A _COLS
|
||||
/usr/lib/libc.sa(__libc.o):6008f0d0 A _CR
|
||||
/usr/lib/libc.sa(__libc.o):6008f0d4 A _CS
|
||||
/usr/lib/libc.sa(__libc.o):6008f06c A _DA
|
||||
/usr/lib/libc.sa(__libc.o):6008f070 A _DB
|
||||
/usr/lib/libc.sa(__libc.o):6008f0d8 A _DC
|
||||
/usr/lib/libc.sa(__libc.o):6008f0dc A _DL
|
||||
/usr/lib/libc.sa(__libc.o):6008f19c A _DL_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f0e0 A _DM
|
||||
/usr/lib/libc.sa(__libc.o):6008f0e4 A _DO
|
||||
/usr/lib/libc.sa(__libc.o):6008f1a4 A _DOWN_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f03c A _Def_term
|
||||
/usr/lib/libc.sa(__libc.o):6008f0e8 A _ED
|
||||
/usr/lib/libc.sa(__libc.o):6008f0ec A _EI
|
||||
/usr/lib/libc.sa(__libc.o):6008f074 A _EO
|
||||
/usr/lib/libc.sa(__libc.o):6008f1b8 A _GT
|
||||
/usr/lib/libc.sa(__libc.o):6008f078 A _HC
|
||||
/usr/lib/libc.sa(__libc.o):6008f118 A _HO
|
||||
/usr/lib/libc.sa(__libc.o):6008f07c A _HZ
|
||||
/usr/lib/libc.sa(__libc.o):6008f11c A _IC
|
||||
/usr/lib/libc.sa(__libc.o):6008f120 A _IM
|
||||
/usr/lib/libc.sa(__libc.o):6008f080 A _IN
|
||||
/usr/lib/libc.sa(__libc.o):6008f124 A _IP
|
||||
/usr/lib/libc.sa(__libc.o):6008f0f0 A _K0
|
||||
/usr/lib/libc.sa(__libc.o):6008f0f4 A _K1
|
||||
/usr/lib/libc.sa(__libc.o):6008f0f8 A _K2
|
||||
/usr/lib/libc.sa(__libc.o):6008f0fc A _K3
|
||||
/usr/lib/libc.sa(__libc.o):6008f100 A _K4
|
||||
/usr/lib/libc.sa(__libc.o):6008f104 A _K5
|
||||
/usr/lib/libc.sa(__libc.o):6008f108 A _K6
|
||||
/usr/lib/libc.sa(__libc.o):6008f10c A _K7
|
||||
/usr/lib/libc.sa(__libc.o):6008f110 A _K8
|
||||
/usr/lib/libc.sa(__libc.o):6008f114 A _K9
|
||||
/usr/lib/libc.sa(__libc.o):6008f128 A _KD
|
||||
/usr/lib/libc.sa(__libc.o):6008f12c A _KE
|
||||
/usr/lib/libc.sa(__libc.o):6008f130 A _KH
|
||||
/usr/lib/libc.sa(__libc.o):6008f134 A _KL
|
||||
/usr/lib/libc.sa(__libc.o):6008f138 A _KR
|
||||
/usr/lib/libc.sa(__libc.o):6008f13c A _KS
|
||||
/usr/lib/libc.sa(__libc.o):6008f140 A _KU
|
||||
/usr/lib/libc.sa(__libc.o):6008f1a8 A _LEFT_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f044 A _LINES
|
||||
/usr/lib/libc.sa(__libc.o):6008f144 A _LL
|
||||
/usr/lib/libc.sa(__libc.o):6008f148 A _MA
|
||||
/usr/lib/libc.sa(__libc.o):6008f300 A _MCAppPath
|
||||
/usr/lib/libc.sa(__libc.o):6008f084 A _MI
|
||||
/usr/lib/libc.sa(__libc.o):6008f088 A _MS
|
||||
/usr/lib/libc.sa(__libc.o):6008f030 A _My_term
|
||||
/usr/lib/libc.sa(__libc.o):6008f08c A _NC
|
||||
/usr/lib/libc.sa(__libc.o):6008f14c A _ND
|
||||
/usr/lib/libc.sa(__libc.o):6008f150 A _NL
|
||||
/usr/lib/libc.sa(__libc.o):6008f1bc A _NONL
|
||||
/usr/lib/libc.sa(__libc.o):6008f090 A _NS
|
||||
/usr/lib/libc.sa(__libc.o):6008f094 A _OS
|
||||
/usr/lib/libc.sa(__libc.o):6008f1b0 A _PC
|
||||
/usr/lib/libc.sa(__libc.o):6008f154 A _RC
|
||||
/usr/lib/libc.sa(__libc.o):6008f1ac A _RIGHT_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f158 A _SC
|
||||
/usr/lib/libc.sa(__libc.o):6008f15c A _SE
|
||||
/usr/lib/libc.sa(__libc.o):6008f160 A _SF
|
||||
/usr/lib/libc.sa(__libc.o):6008f164 A _SO
|
||||
/usr/lib/libc.sa(__libc.o):6008f168 A _SR
|
||||
/usr/lib/libc.sa(__libc.o):6008f16c A _TA
|
||||
/usr/lib/libc.sa(__libc.o):6008f170 A _TE
|
||||
/usr/lib/libc.sa(__libc.o):6008f174 A _TI
|
||||
/usr/lib/libc.sa(__libc.o):6008f178 A _UC
|
||||
/usr/lib/libc.sa(__libc.o):6008f17c A _UE
|
||||
/usr/lib/libc.sa(__libc.o):6008f098 A _UL
|
||||
/usr/lib/libc.sa(__libc.o):6008f180 A _UP
|
||||
/usr/lib/libc.sa(__libc.o):6008f1c0 A _UPPERCASE
|
||||
/usr/lib/libc.sa(__libc.o):6008f1a0 A _UP_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f188 A _US
|
||||
/usr/lib/libc.sa(__libc.o):6008f18c A _VB
|
||||
/usr/lib/libc.sa(__libc.o):6008f194 A _VE
|
||||
/usr/lib/libc.sa(__libc.o):6008f190 A _VS
|
||||
/usr/lib/libc.sa(__libc.o):6008f09c A _XB
|
||||
/usr/lib/libc.sa(__libc.o):6008f0a0 A _XN
|
||||
/usr/lib/libc.sa(__libc.o):6008f0a8 A _XS
|
||||
/usr/lib/libc.sa(__libc.o):6008f0a4 A _XT
|
||||
/usr/lib/libc.sa(__libc.o):6008f0ac A _XX
|
||||
/usr/lib/libc.sa(__libc.o):6008f2a4 A __IO_file_jumps
|
||||
/usr/lib/libc.sa(__libc.o):6008f1f4 A __IO_list_all
|
||||
/usr/lib/libc.sa(__libc.o):6008f2a8 A __IO_proc_jumps
|
||||
/usr/lib/libc.sa(__libc.o):6008f1ec A __IO_stderr_
|
||||
/usr/lib/libc.sa(__libc.o):6008f1e4 A __IO_stdin_
|
||||
/usr/lib/libc.sa(__libc.o):6008f1e8 A __IO_stdout_
|
||||
/usr/lib/libc.sa(__libc.o):6008f2ac A __IO_str_jumps
|
||||
/usr/lib/libc.sa(__libc.o):6008f214 A ____brk_addr
|
||||
/usr/lib/libc.sa(__libc.o):6008f01c A ___ctype_b
|
||||
/usr/lib/libc.sa(__libc.o):6008f020 A ___ctype_tolower
|
||||
/usr/lib/libc.sa(__libc.o):6008f024 A ___ctype_toupper
|
||||
/usr/lib/libc.sa(__libc.o):6008f1fc A ___environ
|
||||
/usr/lib/libc.sa(__libc.o):6008f250 A ___exit_funcs
|
||||
/usr/lib/libc.sa(__libc.o):6008f2f0 A ___glob_closedir_hook
|
||||
/usr/lib/libc.sa(__libc.o):6008f2f4 A ___glob_opendir_hook
|
||||
/usr/lib/libc.sa(__libc.o):6008f2f8 A ___glob_readdir_hook
|
||||
/usr/lib/libc.sa(__libc.o):6008f278 A ___ttyname
|
||||
/usr/lib/libc.sa(__libc.o):6008f238 A __collate_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f23c A __ctype_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f028 A __echoit
|
||||
/usr/lib/libc.sa(__libc.o):6008f034 A __endwin
|
||||
/usr/lib/libc.sa(__libc.o):6008f288 A __gdbm_fetch_val
|
||||
/usr/lib/libc.sa(__libc.o):6008f280 A __gdbm_file
|
||||
/usr/lib/libc.sa(__libc.o):6008f284 A __gdbm_memory
|
||||
/usr/lib/libc.sa(__libc.o):6008f240 A __monetary_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f234 A __null_auth
|
||||
/usr/lib/libc.sa(__libc.o):6008f244 A __numeric_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f2ec A __obstack
|
||||
/usr/lib/libc.sa(__libc.o):6008f1c8 A __pfast
|
||||
/usr/lib/libc.sa(__libc.o):6008f02c A __rawmode
|
||||
/usr/lib/libc.sa(__libc.o):6008f1dc A __res
|
||||
/usr/lib/libc.sa(__libc.o):6008f04c A __res_iflg
|
||||
/usr/lib/libc.sa(__libc.o):6008f050 A __res_lflg
|
||||
/usr/lib/libc.sa(__libc.o):6008f270 A __res_opcodes
|
||||
/usr/lib/libc.sa(__libc.o):6008f274 A __res_resultcodes
|
||||
/usr/lib/libc.sa(__libc.o):6008f248 A __response_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f2fc A __sigintr
|
||||
/usr/lib/libc.sa(__libc.o):6008f00c A __sys_errlist
|
||||
/usr/lib/libc.sa(__libc.o):6008f010 A __sys_nerr
|
||||
/usr/lib/libc.sa(__libc.o):6008f014 A __sys_siglist
|
||||
/usr/lib/libc.sa(__libc.o):6008f24c A __time_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f05c A __tty
|
||||
/usr/lib/libc.sa(__libc.o):6008f040 A __tty_ch
|
||||
/usr/lib/libc.sa(__libc.o):6008f1cc A __unctrl
|
||||
/usr/lib/libc.sa(__libc.o):6008f27c A __win
|
||||
/usr/lib/libc.sa(__libc.o):6008f058 A _curscr
|
||||
/usr/lib/libc.sa(__libc.o):6008f228 A _daylight
|
||||
/usr/lib/libc.sa(__libc.o):6008f200 A _errno
|
||||
/usr/lib/libc.sa(__libc.o):6008f1d0 A _gdbm_errno
|
||||
/usr/lib/libc.sa(__libc.o):6008f28c A _gdbm_version
|
||||
/usr/lib/libc.sa(__libc.o):6008f008 A _h_errlist
|
||||
/usr/lib/libc.sa(__libc.o):6008f1d8 A _h_errno
|
||||
/usr/lib/libc.sa(__libc.o):6008f2a0 A _h_nerr
|
||||
/usr/lib/libc.sa(__libc.o):6008f1c4 A _normtty
|
||||
/usr/lib/libc.sa(__libc.o):6008f204 A _optarg
|
||||
/usr/lib/libc.sa(__libc.o):6008f20c A _opterr
|
||||
/usr/lib/libc.sa(__libc.o):6008f208 A _optind
|
||||
/usr/lib/libc.sa(__libc.o):6008f2e4 A _optopt
|
||||
/usr/lib/libc.sa(__libc.o):6008f218 A _ospeed
|
||||
/usr/lib/libc.sa(__libc.o):6008f26c A _re_max_failures
|
||||
/usr/lib/libc.sa(__libc.o):6008f210 A _re_syntax_options
|
||||
/usr/lib/libc.sa(__libc.o):6008f1e0 A _rexecoptions
|
||||
/usr/lib/libc.sa(__libc.o):6008f230 A _rpc_createerr
|
||||
/usr/lib/libc.sa(__libc.o):6008f25c A _stderr
|
||||
/usr/lib/libc.sa(__libc.o):6008f254 A _stdin
|
||||
/usr/lib/libc.sa(__libc.o):6008f258 A _stdout
|
||||
/usr/lib/libc.sa(__libc.o):6008f054 A _stdscr
|
||||
/usr/lib/libc.sa(__libc.o):6008f2e8 A _svc_fdset
|
||||
/usr/lib/libc.sa(__libc.o):6008f224 A _timezone
|
||||
/usr/lib/libc.sa(__libc.o):6008f21c A _tputs_baud_rate
|
||||
/usr/lib/libc.sa(__libc.o):6008f038 A _ttytype
|
||||
/usr/lib/libc.sa(__libc.o):6008f220 A _tzname
|
6
lib/e2p/jump/jump.params
Normal file
6
lib/e2p/jump/jump.params
Normal file
@ -0,0 +1,6 @@
|
||||
Name=libe2p
|
||||
Text=0x66980000
|
||||
Data=0x00000000
|
||||
Jump=0x00001000
|
||||
GOT=0x00001000
|
||||
Version=1.0.0
|
1
lib/e2p/jump/jump.undefs
Normal file
1
lib/e2p/jump/jump.undefs
Normal file
@ -0,0 +1 @@
|
||||
66983040 D __NEEDS_SHRLIB_libc_4
|
33
lib/e2p/ls.c
33
lib/e2p/ls.c
@ -9,13 +9,40 @@
|
||||
* Public License
|
||||
*/
|
||||
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "e2p.h"
|
||||
|
||||
static void print_user (unsigned short uid)
|
||||
{
|
||||
struct passwd *pw;
|
||||
|
||||
printf ("%u ", uid);
|
||||
pw = getpwuid (uid);
|
||||
if (pw == NULL)
|
||||
printf ("(user unknown)\n");
|
||||
else
|
||||
printf ("(user %s)\n", pw->pw_name);
|
||||
}
|
||||
|
||||
static void print_group (unsigned short gid)
|
||||
{
|
||||
struct group *gr;
|
||||
|
||||
printf ("%u ", gid);
|
||||
gr = getgrgid (gid);
|
||||
if (gr == NULL)
|
||||
printf ("(group unknown)\n");
|
||||
else
|
||||
printf ("(group %s)\n", gr->gr_name);
|
||||
}
|
||||
|
||||
void list_super (struct ext2_super_block * s)
|
||||
{
|
||||
printf ("Filesystem magic number: 0x%04X\n", s->s_magic);
|
||||
@ -49,4 +76,10 @@ void list_super (struct ext2_super_block * s)
|
||||
next = s->s_lastcheck + s->s_checkinterval;
|
||||
printf ("Next check after: %s", ctime (&next));
|
||||
}
|
||||
#ifdef EXT2_DEF_RESUID
|
||||
printf ("Reserved blocks uid: ");
|
||||
print_user (s->s_def_resuid);
|
||||
printf ("Reserved blocks gid: ");
|
||||
print_group (s->s_def_resuid);
|
||||
#endif
|
||||
}
|
||||
|
79
lib/e2p/pf.c
79
lib/e2p/pf.c
@ -19,22 +19,69 @@
|
||||
|
||||
#include "e2p.h"
|
||||
|
||||
void print_flags (FILE * f, unsigned long flags)
|
||||
static const unsigned long flags_array[] = {
|
||||
EXT2_SECRM_FL,
|
||||
EXT2_UNRM_FL,
|
||||
EXT2_COMPR_FL,
|
||||
EXT2_SYNC_FL,
|
||||
#ifdef EXT2_IMMUTABLE_FL
|
||||
EXT2_IMMUTABLE_FL,
|
||||
#endif
|
||||
#ifdef EXT2_APPEND_FL
|
||||
EXT2_APPEND_FL,
|
||||
#endif
|
||||
#ifdef EXT2_NODUMP_FL
|
||||
EXT2_NODUMP_FL,
|
||||
#endif
|
||||
0};
|
||||
|
||||
static const char * short_flags[] = {
|
||||
"s",
|
||||
"u",
|
||||
"c",
|
||||
"S",
|
||||
#ifdef EXT2_IMMUTABLE_FL
|
||||
"i",
|
||||
#endif
|
||||
#ifdef EXT2_APPEND_FL
|
||||
"a",
|
||||
#endif
|
||||
#ifdef EXT2_NODUMP_FL
|
||||
"d",
|
||||
#endif
|
||||
NULL};
|
||||
|
||||
static const char * long_flags[] = {
|
||||
"Secure_Deletion, ",
|
||||
"Undelete, ",
|
||||
"Compressed_File, ",
|
||||
"Synchronous_Updates, ",
|
||||
#ifdef EXT2_IMMUTABLE_FL
|
||||
"Immutable, ",
|
||||
#endif
|
||||
#ifdef EXT2_NODUMP_FL
|
||||
"Append_Only, ",
|
||||
#endif
|
||||
#ifdef EXT2_NODUMP_FL
|
||||
"No_Dump, ",
|
||||
#endif
|
||||
NULL};
|
||||
|
||||
void print_flags (FILE * f, unsigned long flags, int long_format)
|
||||
{
|
||||
if (flags & EXT2_SYNC_FL)
|
||||
fprintf (f, "S");
|
||||
int i;
|
||||
const char ** flags_names;
|
||||
|
||||
if (long_format)
|
||||
flags_names = long_flags;
|
||||
else
|
||||
fprintf (f, "-");
|
||||
if (flags & EXT2_COMPR_FL)
|
||||
fprintf (f, "c");
|
||||
else
|
||||
fprintf (f, "-");
|
||||
if (flags & EXT2_SECRM_FL)
|
||||
fprintf (f, "s");
|
||||
else
|
||||
fprintf (f, "-");
|
||||
if (flags & EXT2_UNRM_FL)
|
||||
fprintf (f, "u");
|
||||
else
|
||||
fprintf (f, "-");
|
||||
flags_names = short_flags;
|
||||
|
||||
for (i = 0; flags_array[i] != 0; i++)
|
||||
{
|
||||
if (flags & flags_array[i])
|
||||
fprintf (f, flags_names[i]);
|
||||
else
|
||||
fprintf (f, "-");
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,17 @@
|
||||
com_err.o : com_err.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h mit-sipb-copyright.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
error_table.h internal.h /usr/include/errno.h /usr/include/linux/errno.h com_err.h
|
||||
/usr/include/libio.h /usr/include/_G_config.h com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
mit-sipb-copyright.h error_table.h internal.h /usr/include/errno.h /usr/include/linux/errno.h
|
||||
error_message.o : error_message.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h error_table.h mit-sipb-copyright.h \
|
||||
internal.h /usr/include/errno.h /usr/include/linux/errno.h
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h error_table.h mit-sipb-copyright.h \
|
||||
internal.h
|
||||
et_name.o : et_name.c error_table.h mit-sipb-copyright.h internal.h /usr/include/errno.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h /usr/include/linux/errno.h
|
||||
init_et.o : init_et.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h error_table.h mit-sipb-copyright.h
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/include/stdlib.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
error_table.h mit-sipb-copyright.h
|
||||
vfprintf.o : vfprintf.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/varargs.h
|
||||
|
9
lib/et/ChangeLog
Normal file
9
lib/et/ChangeLog
Normal file
@ -0,0 +1,9 @@
|
||||
Mon Nov 7 21:17:48 1994 Remy Card <card@bbj>
|
||||
|
||||
* Makefile: Added a dummy install target in case shared libraries
|
||||
are not built.
|
||||
|
||||
Thu Sep 8 22:33:33 1994 (tytso@rsx-11)
|
||||
|
||||
* com_err.c (default_com_err_proc): Reversed order of \n\r to make
|
||||
jik happy.
|
@ -1,29 +1,57 @@
|
||||
#
|
||||
# Makefile for lib/et
|
||||
#
|
||||
|
||||
all:: compile_et libcom_err.a
|
||||
|
||||
include ../../MCONFIG
|
||||
|
||||
ARCHIVE=ar r
|
||||
RANLIB=ranlib
|
||||
RM=rm -f
|
||||
MV=mv
|
||||
LN=ln -s
|
||||
TAGS=etags
|
||||
|
||||
CFLAGS_NO=
|
||||
CFLAGS= $(CFLAGS_NO) $(OPT)
|
||||
|
||||
OBJS= error_message.o et_name.o init_et.o com_err.o
|
||||
SRCS = error_message.c et_name.c init_et.c com_err.c
|
||||
|
||||
HFILES= com_err.h
|
||||
|
||||
ifdef BUILD_PROFILE_LIBS
|
||||
all:: libcom_err_p.a
|
||||
endif
|
||||
|
||||
ifdef BUILD_DLL_SHLIBS
|
||||
DLL_ADDRESS = 0x66800000
|
||||
DLL_JUMPSIZE = 0x1000
|
||||
DLL_GOTSIZE = 0x1000
|
||||
DLL_VERSION = 1.0
|
||||
DLL_IMAGE = libet
|
||||
DLL_STUB = libcom_err
|
||||
DLL_MYDIR = et
|
||||
DLL_INSTALL_DIR = $(SHLIBDIR)
|
||||
|
||||
include ../Makefile.dll-lib
|
||||
endif
|
||||
|
||||
RM=rm -f
|
||||
MV=mv
|
||||
LN=ln -s
|
||||
TAGS=etags
|
||||
|
||||
DEFS= -DHAS_STDLIB_H
|
||||
|
||||
CFLAGS_NO= $(WFLAGS) $(DEFS)
|
||||
CFLAGS= $(CFLAGS_NO) $(OPT)
|
||||
|
||||
#
|
||||
# what to build...
|
||||
#
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $*.c
|
||||
ifdef BUILD_PROFILE_LIBS
|
||||
$(CC) $(CFLAGS_NO) -g -pg -o profiled/$*.o -c $*.c
|
||||
endif
|
||||
ifdef BUILD_DLL_SHLIBS
|
||||
(export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \
|
||||
-o jump/$*.o -c $*.c)
|
||||
endif
|
||||
|
||||
all: compile_et libcom_err.a libcom_err_p.a
|
||||
|
||||
compile_et: compile_et.sh
|
||||
./config_script compile_et.sh $(AWK) > compile_et
|
||||
@ -45,27 +73,32 @@ libcom_err_p.a: $(OBJS)
|
||||
$(RM) ../$@
|
||||
$(LN) et/$@ ../$@
|
||||
|
||||
clean:
|
||||
clean::
|
||||
$(RM) compile_et libcom_err.a libcom_err_p.a
|
||||
$(RM) $(OBJS) profiled/*
|
||||
$(RM) *~ \#* *.bak *.otl *.aux *.toc *.PS *.dvi *.ps TAGS *.ln
|
||||
$(RM) ../libcom_err.a ../libcom_err_p.a
|
||||
|
||||
really-clean: clean
|
||||
really-clean:: clean
|
||||
$(RM) .depend
|
||||
|
||||
install:: libcom_err.a
|
||||
$(INSTALLLIB) libcom_err.a $(DESTDIR)$(LIBDIR)/libcom_err.a
|
||||
$(CHMOD) 644 $(DESTDIR)$(LIBDIR)/libcom_err.a
|
||||
$(RANLIB) $(DESTDIR)$(LIBDIR)/libcom_err.a
|
||||
$(CHMOD) $(LIBMODE) $(DESTDIR)$(LIBDIR)/libcom_err.a
|
||||
install-libs:: libcom_err.a
|
||||
$(INSTALLLIB) libcom_err.a $(LIBDIR)/libcom_err.a
|
||||
$(CHMOD) 644 $(LIBDIR)/libcom_err.a
|
||||
$(RANLIB) $(LIBDIR)/libcom_err.a
|
||||
$(CHMOD) $(LIBMODE) $(LIBDIR)/libcom_err.a
|
||||
|
||||
install:: $(HFILES)
|
||||
@rm -rf ${DESTDIR}$(INCLDIR)/et
|
||||
@mkdir ${DESTDIR}$(INCLDIR)/et
|
||||
install-libs:: $(HFILES)
|
||||
@rm -rf $(INCLDIR)/et
|
||||
@mkdir $(INCLDIR)/et
|
||||
for i in $(HFILES); do \
|
||||
$(INSTALLINC) $$i ${DESTDIR}$(INCLDIR)/et/$$i; \
|
||||
$(INSTALLINC) $$i $(INCLDIR)/et/$$i; \
|
||||
done
|
||||
|
||||
install-tree::
|
||||
|
||||
install::
|
||||
|
||||
##
|
||||
|
||||
com_err.ps : com_err.dvi
|
||||
|
@ -5,42 +5,24 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "com_err.h"
|
||||
#include "mit-sipb-copyright.h"
|
||||
#include "error_table.h"
|
||||
#include "internal.h"
|
||||
|
||||
#if __STDC__ || defined(STDARG_PROTOTYPES)
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#if !defined(__STDC__) && !defined(STDARG_PROTOTYPES)
|
||||
#include <varargs.h>
|
||||
#define VARARGS
|
||||
#endif
|
||||
|
||||
#include "error_table.h"
|
||||
#include "internal.h"
|
||||
|
||||
#ifdef notdef
|
||||
/*
|
||||
* Protect us from header version (externally visible) of com_err, so
|
||||
* we can survive in a <varargs.h> environment. I think.
|
||||
*/
|
||||
#define com_err com_err_external
|
||||
#include "com_err.h"
|
||||
#undef com_err
|
||||
#else
|
||||
#include "com_err.h"
|
||||
#endif
|
||||
|
||||
#if ! lint
|
||||
static const char rcsid[] =
|
||||
"$Header$";
|
||||
#endif /* ! lint */
|
||||
|
||||
static void
|
||||
#ifdef __STDC__
|
||||
default_com_err_proc (const char *whoami, long code, const char *fmt, va_list args)
|
||||
default_com_err_proc (const char *whoami, errcode_t code, const
|
||||
char *fmt, va_list args)
|
||||
#else
|
||||
default_com_err_proc (whoami, code, fmt, args)
|
||||
const char *whoami;
|
||||
long code;
|
||||
errcode_t code;
|
||||
const char *fmt;
|
||||
va_list args;
|
||||
#endif
|
||||
@ -56,32 +38,37 @@ static void
|
||||
if (fmt) {
|
||||
vfprintf (stderr, fmt, args);
|
||||
}
|
||||
putc('\n', stderr);
|
||||
/* should do this only on a tty in raw mode */
|
||||
putc('\r', stderr);
|
||||
putc('\n', stderr);
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
#ifdef __STDC__
|
||||
typedef void (*errf) (const char *, long, const char *, va_list);
|
||||
typedef void (*errf) (const char *, errcode_t, const char *, va_list);
|
||||
#else
|
||||
typedef void (*errf) ();
|
||||
#endif
|
||||
|
||||
errf com_err_hook = default_com_err_proc;
|
||||
|
||||
#ifdef __STDC__
|
||||
void com_err_va (const char *whoami, errcode_t code, const char *fmt,
|
||||
va_list args)
|
||||
#else
|
||||
void com_err_va (whoami, code, fmt, args)
|
||||
const char *whoami;
|
||||
long code;
|
||||
errcode_t code;
|
||||
const char *fmt;
|
||||
va_list args;
|
||||
#endif
|
||||
{
|
||||
(*com_err_hook) (whoami, code, fmt, args);
|
||||
}
|
||||
|
||||
#ifndef VARARGS
|
||||
void com_err (const char *whoami,
|
||||
long code,
|
||||
errcode_t code,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
#else
|
||||
@ -89,7 +76,7 @@ void com_err (va_alist)
|
||||
va_dcl
|
||||
{
|
||||
const char *whoami, *fmt;
|
||||
long code;
|
||||
errcode_t code;
|
||||
#endif
|
||||
va_list pvar;
|
||||
|
||||
@ -98,7 +85,7 @@ void com_err (va_alist)
|
||||
#ifdef VARARGS
|
||||
va_start (pvar);
|
||||
whoami = va_arg (pvar, const char *);
|
||||
code = va_arg (pvar, long);
|
||||
code = va_arg (pvar, errcode_t);
|
||||
fmt = va_arg (pvar, const char *);
|
||||
#else
|
||||
va_start(pvar, fmt);
|
||||
|
@ -13,25 +13,27 @@
|
||||
typedef long errcode_t;
|
||||
|
||||
#ifdef __STDC__
|
||||
#ifndef __HIGHC__ /* gives us STDC but not stdarg */
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
/* ANSI C -- use prototypes etc */
|
||||
void com_err (const char *, long, const char *, ...);
|
||||
void com_err_va (const char *whoami, errcode_t code, const char *fmt,
|
||||
va_list args);
|
||||
char const *error_message (long);
|
||||
void (*com_err_hook) (const char *, long, const char *, va_list);
|
||||
extern void (*com_err_hook) (const char *, long, const char *, va_list);
|
||||
void (*set_com_err_hook (void (*) (const char *, long, const char *, va_list)))
|
||||
(const char *, long, const char *, va_list);
|
||||
void (*reset_com_err_hook (void)) (const char *, long, const char *, va_list);
|
||||
int init_error_table(const char * const *msgs, int base, int count);
|
||||
#else
|
||||
/* no prototypes */
|
||||
void com_err ();
|
||||
void com_err_va ();
|
||||
char *error_message ();
|
||||
void (*com_err_hook) ();
|
||||
extern void (*com_err_hook) ();
|
||||
void (*set_com_err_hook ()) ();
|
||||
void (*reset_com_err_hook ()) ();
|
||||
int init_error_table();
|
||||
#endif
|
||||
|
||||
#define __COM_ERR_H
|
||||
|
@ -11,21 +11,23 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "com_err.h"
|
||||
#include "error_table.h"
|
||||
#include "mit-sipb-copyright.h"
|
||||
#include "internal.h"
|
||||
|
||||
static const char rcsid[] =
|
||||
"$Header$";
|
||||
static const char copyright[] =
|
||||
"Copyright 1986, 1987, 1988 by the Student Information Processing Board\nand the department of Information Systems\nof the Massachusetts Institute of Technology";
|
||||
|
||||
static char buffer[25];
|
||||
|
||||
struct et_list * _et_list = (struct et_list *) NULL;
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
const char * error_message (errcode_t code)
|
||||
#else
|
||||
const char * error_message (code)
|
||||
long code;
|
||||
errcode_t code;
|
||||
#endif
|
||||
{
|
||||
int offset;
|
||||
struct et_list *et;
|
||||
@ -36,10 +38,18 @@ long code;
|
||||
offset = code & ((1<<ERRCODE_RANGE)-1);
|
||||
table_num = code - offset;
|
||||
if (!table_num) {
|
||||
#ifdef HAS_SYS_ERRLIST
|
||||
if (offset < sys_nerr)
|
||||
return(sys_errlist[offset]);
|
||||
else
|
||||
goto oops;
|
||||
#else
|
||||
cp = strerror(offset);
|
||||
if (cp)
|
||||
return(cp);
|
||||
else
|
||||
goto oops;
|
||||
#endif
|
||||
}
|
||||
for (et = _et_list; et; et = et->next) {
|
||||
if (et->table->base == table_num) {
|
||||
|
@ -10,7 +10,7 @@
|
||||
#ifndef __STDC__
|
||||
#define const
|
||||
#endif
|
||||
extern int errno;
|
||||
|
||||
struct error_table {
|
||||
char const * const * msgs;
|
||||
long base;
|
||||
@ -25,6 +25,11 @@ extern struct et_list * _et_list;
|
||||
#define ERRCODE_RANGE 8 /* # of bits to shift table number */
|
||||
#define BITS_PER_CHAR 6 /* # bits to shift per character in name */
|
||||
|
||||
#ifdef __STDC__
|
||||
extern const char *error_table_name(int num);
|
||||
#else
|
||||
extern const char *error_table_name();
|
||||
#endif
|
||||
|
||||
#define _ET_H
|
||||
#endif
|
||||
|
@ -8,13 +8,6 @@
|
||||
#include "mit-sipb-copyright.h"
|
||||
#include "internal.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char copyright[] =
|
||||
"Copyright 1987,1988 by Student Information Processing Board, Massachusetts Institute of Technology";
|
||||
static const char rcsid_et_name_c[] =
|
||||
"$Header$";
|
||||
#endif
|
||||
|
||||
static const char char_set[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
|
||||
|
||||
|
@ -10,6 +10,11 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAS_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include "com_err.h"
|
||||
#include "error_table.h"
|
||||
#include "mit-sipb-copyright.h"
|
||||
|
||||
@ -17,13 +22,6 @@
|
||||
#define const
|
||||
#endif
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid_init_et_c[] =
|
||||
"$Header$";
|
||||
#endif
|
||||
|
||||
extern char *malloc(), *realloc();
|
||||
|
||||
struct foobar {
|
||||
struct et_list etl;
|
||||
struct error_table et;
|
||||
@ -31,10 +29,14 @@ struct foobar {
|
||||
|
||||
extern struct et_list * _et_list;
|
||||
|
||||
#ifdef __STDC__
|
||||
int init_error_table(const char * const *msgs, int base, int count)
|
||||
#else
|
||||
int init_error_table(msgs, base, count)
|
||||
const char * const * msgs;
|
||||
int base;
|
||||
int count;
|
||||
#endif
|
||||
{
|
||||
struct foobar * new_et;
|
||||
|
||||
@ -43,7 +45,7 @@ int init_error_table(msgs, base, count)
|
||||
|
||||
new_et = (struct foobar *) malloc(sizeof(struct foobar));
|
||||
if (!new_et)
|
||||
return errno; /* oops */
|
||||
return ENOMEM; /* oops */
|
||||
new_et->etl.table = &new_et->et;
|
||||
new_et->et.msgs = msgs;
|
||||
new_et->et.base = base;
|
||||
|
6
lib/et/jump/jump.funcs
Normal file
6
lib/et/jump/jump.funcs
Normal file
@ -0,0 +1,6 @@
|
||||
00000000 T _error_message libcom_err jump/error_message
|
||||
00000000 T _init_error_table libcom_err jump/init_et
|
||||
00000000 T _com_err_va libcom_err jump/com_err
|
||||
00000000 T _com_err libcom_err jump/com_err
|
||||
00000000 T _set_com_err_hook libcom_err jump/com_err
|
||||
00000000 T _reset_com_err_hook libcom_err jump/com_err
|
1
lib/et/jump/jump.ignore
Normal file
1
lib/et/jump/jump.ignore
Normal file
@ -0,0 +1 @@
|
||||
00000000 T _error_table_name libxyzzy jump/et_name
|
164
lib/et/jump/jump.import
Normal file
164
lib/et/jump/jump.import
Normal file
@ -0,0 +1,164 @@
|
||||
/usr/lib/libc.sa(__libc.o):00001000 a __GOT_SIZE
|
||||
/usr/lib/libc.sa(__libc.o):6008f0b0 A _AL
|
||||
/usr/lib/libc.sa(__libc.o):6008f198 A _AL_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f060 A _AM
|
||||
/usr/lib/libc.sa(__libc.o):6008f0b4 A _BC
|
||||
/usr/lib/libc.sa(__libc.o):6008f064 A _BS
|
||||
/usr/lib/libc.sa(__libc.o):6008f0bc A _BT
|
||||
/usr/lib/libc.sa(__libc.o):6008f068 A _CA
|
||||
/usr/lib/libc.sa(__libc.o):6008f0c0 A _CD
|
||||
/usr/lib/libc.sa(__libc.o):6008f0c4 A _CE
|
||||
/usr/lib/libc.sa(__libc.o):6008f0c8 A _CL
|
||||
/usr/lib/libc.sa(__libc.o):6008f0cc A _CM
|
||||
/usr/lib/libc.sa(__libc.o):6008f048 A _COLS
|
||||
/usr/lib/libc.sa(__libc.o):6008f0d0 A _CR
|
||||
/usr/lib/libc.sa(__libc.o):6008f0d4 A _CS
|
||||
/usr/lib/libc.sa(__libc.o):6008f06c A _DA
|
||||
/usr/lib/libc.sa(__libc.o):6008f070 A _DB
|
||||
/usr/lib/libc.sa(__libc.o):6008f0d8 A _DC
|
||||
/usr/lib/libc.sa(__libc.o):6008f0dc A _DL
|
||||
/usr/lib/libc.sa(__libc.o):6008f19c A _DL_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f0e0 A _DM
|
||||
/usr/lib/libc.sa(__libc.o):6008f0e4 A _DO
|
||||
/usr/lib/libc.sa(__libc.o):6008f1a4 A _DOWN_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f03c A _Def_term
|
||||
/usr/lib/libc.sa(__libc.o):6008f0e8 A _ED
|
||||
/usr/lib/libc.sa(__libc.o):6008f0ec A _EI
|
||||
/usr/lib/libc.sa(__libc.o):6008f074 A _EO
|
||||
/usr/lib/libc.sa(__libc.o):6008f1b8 A _GT
|
||||
/usr/lib/libc.sa(__libc.o):6008f078 A _HC
|
||||
/usr/lib/libc.sa(__libc.o):6008f118 A _HO
|
||||
/usr/lib/libc.sa(__libc.o):6008f07c A _HZ
|
||||
/usr/lib/libc.sa(__libc.o):6008f11c A _IC
|
||||
/usr/lib/libc.sa(__libc.o):6008f120 A _IM
|
||||
/usr/lib/libc.sa(__libc.o):6008f080 A _IN
|
||||
/usr/lib/libc.sa(__libc.o):6008f124 A _IP
|
||||
/usr/lib/libc.sa(__libc.o):6008f0f0 A _K0
|
||||
/usr/lib/libc.sa(__libc.o):6008f0f4 A _K1
|
||||
/usr/lib/libc.sa(__libc.o):6008f0f8 A _K2
|
||||
/usr/lib/libc.sa(__libc.o):6008f0fc A _K3
|
||||
/usr/lib/libc.sa(__libc.o):6008f100 A _K4
|
||||
/usr/lib/libc.sa(__libc.o):6008f104 A _K5
|
||||
/usr/lib/libc.sa(__libc.o):6008f108 A _K6
|
||||
/usr/lib/libc.sa(__libc.o):6008f10c A _K7
|
||||
/usr/lib/libc.sa(__libc.o):6008f110 A _K8
|
||||
/usr/lib/libc.sa(__libc.o):6008f114 A _K9
|
||||
/usr/lib/libc.sa(__libc.o):6008f128 A _KD
|
||||
/usr/lib/libc.sa(__libc.o):6008f12c A _KE
|
||||
/usr/lib/libc.sa(__libc.o):6008f130 A _KH
|
||||
/usr/lib/libc.sa(__libc.o):6008f134 A _KL
|
||||
/usr/lib/libc.sa(__libc.o):6008f138 A _KR
|
||||
/usr/lib/libc.sa(__libc.o):6008f13c A _KS
|
||||
/usr/lib/libc.sa(__libc.o):6008f140 A _KU
|
||||
/usr/lib/libc.sa(__libc.o):6008f1a8 A _LEFT_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f044 A _LINES
|
||||
/usr/lib/libc.sa(__libc.o):6008f144 A _LL
|
||||
/usr/lib/libc.sa(__libc.o):6008f148 A _MA
|
||||
/usr/lib/libc.sa(__libc.o):6008f300 A _MCAppPath
|
||||
/usr/lib/libc.sa(__libc.o):6008f084 A _MI
|
||||
/usr/lib/libc.sa(__libc.o):6008f088 A _MS
|
||||
/usr/lib/libc.sa(__libc.o):6008f030 A _My_term
|
||||
/usr/lib/libc.sa(__libc.o):6008f08c A _NC
|
||||
/usr/lib/libc.sa(__libc.o):6008f14c A _ND
|
||||
/usr/lib/libc.sa(__libc.o):6008f150 A _NL
|
||||
/usr/lib/libc.sa(__libc.o):6008f1bc A _NONL
|
||||
/usr/lib/libc.sa(__libc.o):6008f090 A _NS
|
||||
/usr/lib/libc.sa(__libc.o):6008f094 A _OS
|
||||
/usr/lib/libc.sa(__libc.o):6008f1b0 A _PC
|
||||
/usr/lib/libc.sa(__libc.o):6008f154 A _RC
|
||||
/usr/lib/libc.sa(__libc.o):6008f1ac A _RIGHT_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f158 A _SC
|
||||
/usr/lib/libc.sa(__libc.o):6008f15c A _SE
|
||||
/usr/lib/libc.sa(__libc.o):6008f160 A _SF
|
||||
/usr/lib/libc.sa(__libc.o):6008f164 A _SO
|
||||
/usr/lib/libc.sa(__libc.o):6008f168 A _SR
|
||||
/usr/lib/libc.sa(__libc.o):6008f16c A _TA
|
||||
/usr/lib/libc.sa(__libc.o):6008f170 A _TE
|
||||
/usr/lib/libc.sa(__libc.o):6008f174 A _TI
|
||||
/usr/lib/libc.sa(__libc.o):6008f178 A _UC
|
||||
/usr/lib/libc.sa(__libc.o):6008f17c A _UE
|
||||
/usr/lib/libc.sa(__libc.o):6008f098 A _UL
|
||||
/usr/lib/libc.sa(__libc.o):6008f180 A _UP
|
||||
/usr/lib/libc.sa(__libc.o):6008f1c0 A _UPPERCASE
|
||||
/usr/lib/libc.sa(__libc.o):6008f1a0 A _UP_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f188 A _US
|
||||
/usr/lib/libc.sa(__libc.o):6008f18c A _VB
|
||||
/usr/lib/libc.sa(__libc.o):6008f194 A _VE
|
||||
/usr/lib/libc.sa(__libc.o):6008f190 A _VS
|
||||
/usr/lib/libc.sa(__libc.o):6008f09c A _XB
|
||||
/usr/lib/libc.sa(__libc.o):6008f0a0 A _XN
|
||||
/usr/lib/libc.sa(__libc.o):6008f0a8 A _XS
|
||||
/usr/lib/libc.sa(__libc.o):6008f0a4 A _XT
|
||||
/usr/lib/libc.sa(__libc.o):6008f0ac A _XX
|
||||
/usr/lib/libc.sa(__libc.o):6008f2a4 A __IO_file_jumps
|
||||
/usr/lib/libc.sa(__libc.o):6008f1f4 A __IO_list_all
|
||||
/usr/lib/libc.sa(__libc.o):6008f2a8 A __IO_proc_jumps
|
||||
/usr/lib/libc.sa(__libc.o):6008f1ec A __IO_stderr_
|
||||
/usr/lib/libc.sa(__libc.o):6008f1e4 A __IO_stdin_
|
||||
/usr/lib/libc.sa(__libc.o):6008f1e8 A __IO_stdout_
|
||||
/usr/lib/libc.sa(__libc.o):6008f2ac A __IO_str_jumps
|
||||
/usr/lib/libc.sa(__libc.o):6008f214 A ____brk_addr
|
||||
/usr/lib/libc.sa(__libc.o):6008f01c A ___ctype_b
|
||||
/usr/lib/libc.sa(__libc.o):6008f020 A ___ctype_tolower
|
||||
/usr/lib/libc.sa(__libc.o):6008f024 A ___ctype_toupper
|
||||
/usr/lib/libc.sa(__libc.o):6008f1fc A ___environ
|
||||
/usr/lib/libc.sa(__libc.o):6008f250 A ___exit_funcs
|
||||
/usr/lib/libc.sa(__libc.o):6008f2f0 A ___glob_closedir_hook
|
||||
/usr/lib/libc.sa(__libc.o):6008f2f4 A ___glob_opendir_hook
|
||||
/usr/lib/libc.sa(__libc.o):6008f2f8 A ___glob_readdir_hook
|
||||
/usr/lib/libc.sa(__libc.o):6008f278 A ___ttyname
|
||||
/usr/lib/libc.sa(__libc.o):6008f238 A __collate_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f23c A __ctype_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f028 A __echoit
|
||||
/usr/lib/libc.sa(__libc.o):6008f034 A __endwin
|
||||
/usr/lib/libc.sa(__libc.o):6008f288 A __gdbm_fetch_val
|
||||
/usr/lib/libc.sa(__libc.o):6008f280 A __gdbm_file
|
||||
/usr/lib/libc.sa(__libc.o):6008f284 A __gdbm_memory
|
||||
/usr/lib/libc.sa(__libc.o):6008f240 A __monetary_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f234 A __null_auth
|
||||
/usr/lib/libc.sa(__libc.o):6008f244 A __numeric_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f2ec A __obstack
|
||||
/usr/lib/libc.sa(__libc.o):6008f1c8 A __pfast
|
||||
/usr/lib/libc.sa(__libc.o):6008f02c A __rawmode
|
||||
/usr/lib/libc.sa(__libc.o):6008f1dc A __res
|
||||
/usr/lib/libc.sa(__libc.o):6008f04c A __res_iflg
|
||||
/usr/lib/libc.sa(__libc.o):6008f050 A __res_lflg
|
||||
/usr/lib/libc.sa(__libc.o):6008f270 A __res_opcodes
|
||||
/usr/lib/libc.sa(__libc.o):6008f274 A __res_resultcodes
|
||||
/usr/lib/libc.sa(__libc.o):6008f248 A __response_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f2fc A __sigintr
|
||||
/usr/lib/libc.sa(__libc.o):6008f00c A __sys_errlist
|
||||
/usr/lib/libc.sa(__libc.o):6008f010 A __sys_nerr
|
||||
/usr/lib/libc.sa(__libc.o):6008f014 A __sys_siglist
|
||||
/usr/lib/libc.sa(__libc.o):6008f24c A __time_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f05c A __tty
|
||||
/usr/lib/libc.sa(__libc.o):6008f040 A __tty_ch
|
||||
/usr/lib/libc.sa(__libc.o):6008f1cc A __unctrl
|
||||
/usr/lib/libc.sa(__libc.o):6008f27c A __win
|
||||
/usr/lib/libc.sa(__libc.o):6008f058 A _curscr
|
||||
/usr/lib/libc.sa(__libc.o):6008f228 A _daylight
|
||||
/usr/lib/libc.sa(__libc.o):6008f200 A _errno
|
||||
/usr/lib/libc.sa(__libc.o):6008f1d0 A _gdbm_errno
|
||||
/usr/lib/libc.sa(__libc.o):6008f28c A _gdbm_version
|
||||
/usr/lib/libc.sa(__libc.o):6008f008 A _h_errlist
|
||||
/usr/lib/libc.sa(__libc.o):6008f1d8 A _h_errno
|
||||
/usr/lib/libc.sa(__libc.o):6008f2a0 A _h_nerr
|
||||
/usr/lib/libc.sa(__libc.o):6008f1c4 A _normtty
|
||||
/usr/lib/libc.sa(__libc.o):6008f204 A _optarg
|
||||
/usr/lib/libc.sa(__libc.o):6008f20c A _opterr
|
||||
/usr/lib/libc.sa(__libc.o):6008f208 A _optind
|
||||
/usr/lib/libc.sa(__libc.o):6008f2e4 A _optopt
|
||||
/usr/lib/libc.sa(__libc.o):6008f218 A _ospeed
|
||||
/usr/lib/libc.sa(__libc.o):6008f26c A _re_max_failures
|
||||
/usr/lib/libc.sa(__libc.o):6008f210 A _re_syntax_options
|
||||
/usr/lib/libc.sa(__libc.o):6008f1e0 A _rexecoptions
|
||||
/usr/lib/libc.sa(__libc.o):6008f230 A _rpc_createerr
|
||||
/usr/lib/libc.sa(__libc.o):6008f25c A _stderr
|
||||
/usr/lib/libc.sa(__libc.o):6008f254 A _stdin
|
||||
/usr/lib/libc.sa(__libc.o):6008f258 A _stdout
|
||||
/usr/lib/libc.sa(__libc.o):6008f054 A _stdscr
|
||||
/usr/lib/libc.sa(__libc.o):6008f2e8 A _svc_fdset
|
||||
/usr/lib/libc.sa(__libc.o):6008f224 A _timezone
|
||||
/usr/lib/libc.sa(__libc.o):6008f21c A _tputs_baud_rate
|
||||
/usr/lib/libc.sa(__libc.o):6008f038 A _ttytype
|
||||
/usr/lib/libc.sa(__libc.o):6008f220 A _tzname
|
6
lib/et/jump/jump.params
Normal file
6
lib/et/jump/jump.params
Normal file
@ -0,0 +1,6 @@
|
||||
Name=libet
|
||||
Text=0x66800000
|
||||
Data=0x00000000
|
||||
Jump=0x00001000
|
||||
GOT=0x00001000
|
||||
Version=1.0.0
|
1
lib/et/jump/jump.undefs
Normal file
1
lib/et/jump/jump.undefs
Normal file
@ -0,0 +1 @@
|
||||
66804000 D __NEEDS_SHRLIB_libc_4
|
2
lib/et/jump/jump.vars
Normal file
2
lib/et/jump/jump.vars
Normal file
@ -0,0 +1,2 @@
|
||||
00000004 D __et_list libcom_err jump/error_message
|
||||
00000004 D _com_err_hook libcom_err jump/com_err
|
@ -1,350 +1,198 @@
|
||||
alloc.o : alloc.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \
|
||||
/usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h \
|
||||
/usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
badblocks.o : badblocks.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
bb_inode.o : bb_inode.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
bitmaps.o : bitmaps.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
bitops.o : bitops.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
|
||||
/usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
|
||||
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
|
||||
/usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
|
||||
/usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
|
||||
/usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
|
||||
/usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
|
||||
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
|
||||
/usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
bitops.o : bitops.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/asm/types.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
block.o : block.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
|
||||
/usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
|
||||
/usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
check_desc.o : check_desc.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
closefs.o : closefs.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/time.h /usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
|
||||
/usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
|
||||
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
|
||||
/usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
|
||||
/usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
|
||||
/usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
|
||||
/usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
|
||||
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
|
||||
/usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \
|
||||
/usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/time.h /usr/include/linux/ext2_fs.h ext2fs.h \
|
||||
../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h \
|
||||
../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
expanddir.o : expanddir.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
|
||||
/usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
|
||||
/usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
ext2_err.o : ext2_err.c
|
||||
freefs.o : freefs.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
|
||||
/usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
|
||||
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
|
||||
/usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
|
||||
/usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
|
||||
/usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
|
||||
/usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
|
||||
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
|
||||
/usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
/usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \
|
||||
/usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
get_pathname.o : get_pathname.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
|
||||
/usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
|
||||
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
|
||||
/usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
|
||||
/usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
|
||||
/usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
|
||||
/usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
|
||||
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
|
||||
/usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h \
|
||||
/usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
initialize.o : initialize.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
inline.o : inline.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
inode.o : inode.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/sys/stat.h /usr/include/linux/stat.h \
|
||||
/usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
|
||||
/usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
|
||||
/usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
|
||||
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
|
||||
/usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
|
||||
/usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
|
||||
/usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
|
||||
/usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
|
||||
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
|
||||
/usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
link.o : link.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
|
||||
/usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
|
||||
/usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
llseek.o : llseek.c /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \
|
||||
/usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/linux/errno.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/linux/unistd.h /usr/include/asm/unistd.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h
|
||||
mkdir.o : mkdir.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
namei.o : namei.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
|
||||
/usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
|
||||
/usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
newdir.o : newdir.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
|
||||
/usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
|
||||
/usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
openfs.o : openfs.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
read_bb.o : read_bb.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
|
||||
/usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
|
||||
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
|
||||
/usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
|
||||
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
|
||||
/usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
|
||||
/usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
|
||||
/usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
|
||||
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
|
||||
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
|
||||
/usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \
|
||||
../ext2fs/bitops.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
read_bb_file.o : read_bb_file.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
||||
/usr/include/gnu/types.h /usr/include/sys/types.h /usr/include/linux/types.h \
|
||||
/usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h /usr/include/sys/stat.h \
|
||||
/usr/include/linux/stat.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
|
||||
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
|
||||
/usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
|
||||
/usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
|
||||
/usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
|
||||
/usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
|
||||
/usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
|
||||
/usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
|
||||
/usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
|
||||
/usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h \
|
||||
/usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/fcntl.h \
|
||||
/usr/include/linux/fcntl.h /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h \
|
||||
/usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
rw_bitmaps.o : rw_bitmaps.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \
|
||||
ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h
|
||||
unix_io.o : unix_io.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \
|
||||
/usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \
|
||||
/usr/include/linux/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
|
||||
/usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h ../et/com_err.h \
|
||||
/usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ext2_err.h io.h
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \
|
||||
/usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \
|
||||
/usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/linux/stat.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
|
||||
ext2_err.h io.h
|
||||
|
155
lib/ext2fs/ChangeLog
Normal file
155
lib/ext2fs/ChangeLog
Normal file
@ -0,0 +1,155 @@
|
||||
Sat Mar 11 14:07:11 1995 Theodore Y. Ts'o <tytso@localhost>
|
||||
|
||||
* llseek.c (ext2_llseek): Added error checking to the llseek()
|
||||
compat code to protect against overflow. This only
|
||||
applies to 1.0 and early 1.1 kernels, which don't support
|
||||
the llseek() system call.
|
||||
|
||||
Thu Nov 24 16:29:00 1994 Theodore Y. Ts'o (tytso@rt-11)
|
||||
|
||||
* unix_io.c (unix_open): Initialize the read_error and write_error
|
||||
io_channel pointers to be null.
|
||||
|
||||
* bb_inode.c (clear_bad_block_proc): If an illegal block number is
|
||||
found, clear it but don't try to update the filesystem
|
||||
accounting information, since that's hopeless anyway.
|
||||
|
||||
* block.c (bloblock_iterate_ind, bloblock_iterate_dind,
|
||||
bloblock_iterate_tind): Check to see if the indirect blocks are
|
||||
valid before trying to read them.
|
||||
|
||||
* ext2_err.et (EXT2_ET_BAD_IND_BLOCK, EX2_ET_BAD_DIND_BLOCK,
|
||||
EXT2_ET_BAD_TIND_BLOCK): Add new error codes.
|
||||
|
||||
* bitops.h (ext2fs_mark_block_bitmap, ext2fs_unmark_block_bitmap,
|
||||
ext2fs_test_block_bitmap, ext2fs_mark_inode_bitmap,
|
||||
ext2fs_unmark_inode_bitmap, ext2fs_test_inode_bitmap): If an
|
||||
illegal block or inode number is passed in, return instead
|
||||
of trying to test, set, or clear the bit.
|
||||
|
||||
Mon Nov 7 21:32:33 1994 Remy Card <card@bbj>
|
||||
|
||||
* Makefile: Added a dummy install target in case shared libraries
|
||||
are not built.
|
||||
|
||||
Mon Oct 24 14:11:44 1994 (tytso@rsx-11)
|
||||
|
||||
* bitmaps.c (ext2fs_allocate_block_bitmap): Fix calculation of how
|
||||
the real last block of the bitmap should be calculated.
|
||||
|
||||
Wed Sep 7 10:05:36 1994 (tytso@rsx-11)
|
||||
|
||||
* bitmaps.c (ext2fs_fudge_inode_bitmap_end,
|
||||
ext2fs_fudge_block_bitmap_end, ext2fs_clear_inode_bitmap,
|
||||
ext2fs_clear_block_bitmap, ext2fs_free_inode_bitmap,
|
||||
ext2fs_free_block_bitmap): Add magic number checking for
|
||||
the inode and block bitmaps.
|
||||
|
||||
* bitmaps.c (ext2fs_allocate_block_bitmap): Fix to set the correct
|
||||
magic number for a block bitmap instead of an inode bitmap.
|
||||
|
||||
* inode.c (ext2fs_close_inode_scan, ext2fs_get_next_inode): Add
|
||||
magic number checking for the inode_scan structure.
|
||||
|
||||
* badblocks.c (badblocks_list_free, badblocks_list_add,
|
||||
badblocks_list_test, badblocks_list_iterate_begin,
|
||||
badblocks_list_iterate, badblocks_list_iterate_end): Add
|
||||
magic number checking for the badblocks_list and
|
||||
badblocks_iterate structures.
|
||||
|
||||
* ext2_err.et (EXT2_ET_MAGIC_UNIX_IO_CHANNEL):
|
||||
* unix_io.c (unix_open, unix_close, unix_set_blksize, unix_read_blk,
|
||||
unix_write_blk, unix_flush): Add magic number checking
|
||||
both for io_channel structure and unix_private_data
|
||||
structure.
|
||||
|
||||
* openfs.c (ext2fs_open): Add check for io_manager structure's
|
||||
magic number.
|
||||
|
||||
* rw_bitmaps.c (ext2fs_write_inode_bitmap, ext2fs_write_block_bitmap,
|
||||
ext2fs_read_inode_bitmap, ext2fs_read_block_bitmap,
|
||||
ext2fs_read_bitmaps, ext2fs_write_bitmaps):
|
||||
* read_bb.c (ext2fs_read_bb_inode):
|
||||
* read_bb_file.c (ext2fs_read_bb_FILE):
|
||||
* newdir.c (ext2fs_new_dir_block):
|
||||
* namei.c (ext2fs_dir_iterate, ext2fs_lookup, ext2fs_namei):
|
||||
* link.c (ext2fs_link, ext2fs_unlink):
|
||||
* inode.c (ext2fs_open_inode_scan, ext2fs_read_inode,
|
||||
ext2fs_write_inode, ext2fs_get_blocks,
|
||||
ext2fs_check_directory):
|
||||
* get_pathname.c (ext2fs_get_pathname):
|
||||
* expanddir.c (ext2fs_expand_dir):
|
||||
* block.c (ext2fs_block_iterate):
|
||||
* bitmaps.c (ext2fs_allocate_inode_bitmap,
|
||||
ext2fs_allocate_block_bitmap):
|
||||
* bb_inode.c (ext2fs_update_bb_inode):
|
||||
* alloc.c (ext2fs_new_inode,ext2fs_new_block,ext2fs_get_free_blocks):
|
||||
* check_desc.c (ext2fs_check_desc):
|
||||
* closefs.c (ext2fs_close, ext2fs_flush):
|
||||
* freefs.c (ext2fs_free): Add check for ext2_filsys magic number.
|
||||
|
||||
* Makefile:
|
||||
* ext2fs.h:
|
||||
* openfs.c:
|
||||
* check_desc.c (ext2fs_check_desc): Move ext2fs_check_desc from
|
||||
openfs.c into its own file.
|
||||
|
||||
* ext2fs.h (EXT2_CHECK_MAGIC): Added macro for checking for
|
||||
structure magic numbers.
|
||||
|
||||
* closefs.c (ext2fs_flush): Folded in Remy Card's changes to clear
|
||||
the EXT2_VALID_FS flag in the backup superblock blocks, so that if
|
||||
someone uses the -b option to specify the use of the backup
|
||||
superblock --- this usually means that the main superblock is
|
||||
toast. :-)
|
||||
|
||||
* ext2fs.h:
|
||||
* ext2_err.et (EXT2_ET_REV_TOO_HIGH):
|
||||
* openfs.c (ext2fs_open): Folded in Remy Card's changes to add a
|
||||
revision level to the superblock.
|
||||
|
||||
Sun Aug 21 00:50:08 1994 Theodore Y. Ts'o (tytso@rt-11)
|
||||
|
||||
* ext2fs.h:
|
||||
* bitmaps.c:
|
||||
* bitops.c
|
||||
* bitops.h:
|
||||
* openfs.c:
|
||||
* initialize.c: Completely revamped the inode and block bitmap
|
||||
structures, so that they can be better chance of being extensible
|
||||
in a shared library. They are now their own type, instead of
|
||||
being a char *. Also, the function signatures of
|
||||
ext2fs_test_block_bitmap, ext2fs_mark_block_bitmap,
|
||||
ext2fs_unmark_block_bitmap, ext2fs_test_inode_bitmap,
|
||||
ext2fs_mark_inode_bitmap, and ext2fs_unmark_inode_bitmap were
|
||||
changed to eliminate the ext2_filsys argument, since it is no
|
||||
longer necessary.
|
||||
|
||||
Wed Aug 17 21:46:44 1994 Remy Card (card@bbj)
|
||||
|
||||
* unix_io.c (unix_read_blk and unix_write_blk): use the llseek
|
||||
system call if available.
|
||||
|
||||
* llseek.c: new file. This is the stub calling the llseek system
|
||||
call which allows supports for 2GB+ file systems.
|
||||
|
||||
* initialize.c (ext2fs_initialize): Ext2fs_initialize now stores
|
||||
the creator operating system.
|
||||
|
||||
Wed Aug 17 10:03:24 1994 Theodore Y. Ts'o (tytso@rt-11)
|
||||
|
||||
* initialize.c (ext2fs_initialize): Ext2fs_initialize now sets up
|
||||
the group descriptor statistics in addition to everything else.
|
||||
This relieves mke2fs of the responsibility of doing it.
|
||||
|
||||
* bitops.c, bitops.h: Add assembly inline functions for the 68000.
|
||||
Added a new #define, _EXT2_HAVE_ASM_BITOPS_ to control whether or
|
||||
not the generic C function equivalents should be included or not.
|
||||
|
||||
* openfs.c (ext2fs_open): If a superblock is specified, then use
|
||||
the backup group descriptors that go along with this superblock,
|
||||
instead of using the primary group descriptors. This allows
|
||||
e2fsck to recover filesystems where the primary group descriptors
|
||||
have been trashed.
|
||||
|
||||
|
54
lib/ext2fs/MAKELOG
Normal file
54
lib/ext2fs/MAKELOG
Normal file
@ -0,0 +1,54 @@
|
||||
gcc -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -I.. -c bitmaps.c
|
||||
In file included from ext2fs.h:22,
|
||||
from bitmaps.c:20:
|
||||
../ext2fs/io.h:12: warning: ANSI C does not support `long long'
|
||||
../ext2fs/bitops.h: In function `ext2fs_mark_block_bitmap':
|
||||
In file included from ext2fs.h:112,
|
||||
from bitmaps.c:20:
|
||||
../ext2fs/bitops.h:145: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type
|
||||
../ext2fs/bitops.h: In function `ext2fs_unmark_block_bitmap':
|
||||
../ext2fs/bitops.h:154: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type
|
||||
../ext2fs/bitops.h: At top level:
|
||||
../ext2fs/bitops.h:160: conflicting types for `ext2fs_test_block_bitmap'
|
||||
../ext2fs/bitops.h:31: previous declaration of `ext2fs_test_block_bitmap'
|
||||
../ext2fs/bitops.h: In function `ext2fs_test_block_bitmap':
|
||||
../ext2fs/bitops.h:163: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type
|
||||
../ext2fs/bitops.h: In function `ext2fs_mark_inode_bitmap':
|
||||
../ext2fs/bitops.h:172: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type
|
||||
../ext2fs/bitops.h: In function `ext2fs_unmark_inode_bitmap':
|
||||
../ext2fs/bitops.h:181: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type
|
||||
../ext2fs/bitops.h: At top level:
|
||||
../ext2fs/bitops.h:187: conflicting types for `ext2fs_test_inode_bitmap'
|
||||
../ext2fs/bitops.h:36: previous declaration of `ext2fs_test_inode_bitmap'
|
||||
../ext2fs/bitops.h: In function `ext2fs_test_inode_bitmap':
|
||||
../ext2fs/bitops.h:190: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type
|
||||
bitmaps.c: In function `ext2fs_read_inode_bitmap':
|
||||
bitmaps.c:108: warning: implicit declaration of function `ext2fs_free_inode_bitmap'
|
||||
bitmaps.c:109: structure has no member named `device'
|
||||
bitmaps.c:110: structure has no member named `device'
|
||||
bitmaps.c:110: warning: format argument is not a pointer (arg 3)
|
||||
bitmaps.c:103: warning: `nbytes' may be used uninitialized in this function
|
||||
bitmaps.c: In function `ext2fs_read_block_bitmap':
|
||||
bitmaps.c:154: warning: implicit declaration of function `ext2fs_free_block_bitmap'
|
||||
bitmaps.c:155: structure has no member named `device'
|
||||
bitmaps.c:156: structure has no member named `device'
|
||||
bitmaps.c:156: warning: format argument is not a pointer (arg 3)
|
||||
bitmaps.c:149: warning: `nbytes' may be used uninitialized in this function
|
||||
bitmaps.c: In function `ext2fs_allocate_inode_bitmap':
|
||||
bitmaps.c:194: warning: `map' may be used uninitialized in this function
|
||||
bitmaps.c: In function `ext2fs_allocate_block_bitmap':
|
||||
bitmaps.c:235: warning: `map' may be used uninitialized in this function
|
||||
bitmaps.c: At top level:
|
||||
bitmaps.c:272: warning: no previous prototype for `ext2fs_free_inode_bitmap'
|
||||
bitmaps.c:272: warning: type mismatch with previous external decl
|
||||
bitmaps.c:108: warning: previous external decl of `ext2fs_free_inode_bitmap'
|
||||
bitmaps.c:272: warning: type mismatch with previous implicit declaration
|
||||
bitmaps.c:108: warning: previous implicit declaration of `ext2fs_free_inode_bitmap'
|
||||
bitmaps.c:272: warning: `ext2fs_free_inode_bitmap' was previously implicitly declared to return `int'
|
||||
bitmaps.c:286: warning: no previous prototype for `ext2fs_free_block_bitmap'
|
||||
bitmaps.c:286: warning: type mismatch with previous external decl
|
||||
bitmaps.c:154: warning: previous external decl of `ext2fs_free_block_bitmap'
|
||||
bitmaps.c:286: warning: type mismatch with previous implicit declaration
|
||||
bitmaps.c:154: warning: previous implicit declaration of `ext2fs_free_block_bitmap'
|
||||
bitmaps.c:286: warning: `ext2fs_free_block_bitmap' was previously implicitly declared to return `int'
|
||||
make: *** [bitmaps.o] Error 1
|
@ -1,32 +1,54 @@
|
||||
all:: libext2fs.a
|
||||
|
||||
include ../../MCONFIG
|
||||
|
||||
OBJS= ext2_err.o openfs.o freefs.o closefs.o bitmaps.o rw_bitmaps.o inode.o \
|
||||
unix_io.o block.o namei.o newdir.o mkdir.o check_desc.o \
|
||||
get_pathname.o bitops.o link.o alloc.o expanddir.o inline.o \
|
||||
initialize.o badblocks.o read_bb.o bb_inode.o read_bb_file.o llseek.o
|
||||
|
||||
HFILES= bitops.h ext2_err.h ext2fs.h io.h
|
||||
|
||||
ifdef BUILD_PROFILE_LIBS
|
||||
all:: libext2fs_p.a
|
||||
endif
|
||||
|
||||
ifdef BUILD_DLL_SHLIBS
|
||||
DLL_ADDRESS = 0x66900000
|
||||
DLL_JUMPSIZE = 0x1000
|
||||
DLL_GOTSIZE = 0x1000
|
||||
DLL_VERSION = 1.0
|
||||
DLL_IMAGE = libe2fs
|
||||
DLL_STUB = libext2fs
|
||||
DLL_LIBS = -L../.. -lcom_err
|
||||
DLL_MYDIR = ext2fs
|
||||
DLL_INSTALL_DIR = $(SHLIBDIR)
|
||||
|
||||
include ../Makefile.dll-lib
|
||||
endif
|
||||
|
||||
COMPILE_ET=../et/compile_et
|
||||
|
||||
CFLAGS_NO= $(WFLAGS) -I..
|
||||
CFLAGS= $(OPT) $(CFLAGS_NO)
|
||||
LDFLAGS= $(OPT)
|
||||
|
||||
ARCHIVE=ar r
|
||||
RANLIB=ranlib
|
||||
RM=rm -f
|
||||
MV=mv
|
||||
LN=ln -s
|
||||
|
||||
OBJS= ext2_err.o openfs.o freefs.o closefs.o bitmaps.o inode.o unix_io.o \
|
||||
block.o namei.o newdir.o mkdir.o \
|
||||
get_pathname.o bitops.o link.o alloc.o expanddir.o inline.o \
|
||||
initialize.o badblocks.o read_bb.o bb_inode.o read_bb_file.o
|
||||
|
||||
HFILES= bitops.h ext2_err.h ext2fs.h io.h
|
||||
|
||||
DISTFILES= Makefile *.c *.h image
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $*.c
|
||||
ifdef BUILD_PROFILE_LIBS
|
||||
$(CC) $(CFLAGS_NO) -pg -o profiled/$*.o -c $*.c
|
||||
endif
|
||||
# $(CC) $(CFLAGS_NO) -checker -g -o checker/$*.o -c $*.c
|
||||
|
||||
all: libext2fs.a libext2fs_p.a
|
||||
ifdef BUILD_DLL_SHLIBS
|
||||
(export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \
|
||||
-o jump/$*.o -c $*.c)
|
||||
endif
|
||||
|
||||
libext2fs.a: $(OBJS)
|
||||
$(RM) $@.bak
|
||||
@ -55,23 +77,28 @@ libext2fs_chk.a: $(OBJS)
|
||||
ext2_err.c ext2_err.h: ext2_err.et
|
||||
$(COMPILE_ET) ext2_err.et
|
||||
|
||||
install:: all
|
||||
$(INSTALLLIB) libext2fs.a ${DESTDIR}$(LIBDIR)/libext2fs.a
|
||||
$(CHMOD) 644 ${DESTDIR}$(LIBDIR)/libext2fs.a
|
||||
$(RANLIB) ${DESTDIR}$(LIBDIR)/libext2fs.a
|
||||
$(CHMOD) $(LIBMODE) ${DESTDIR}$(LIBDIR)/libext2fs.a
|
||||
install-libs:: all
|
||||
$(INSTALLLIB) libext2fs.a $(LIBDIR)/libext2fs.a
|
||||
$(CHMOD) 644 $(LIBDIR)/libext2fs.a
|
||||
$(RANLIB) $(LIBDIR)/libext2fs.a
|
||||
$(CHMOD) $(LIBMODE) $(LIBDIR)/libext2fs.a
|
||||
|
||||
install:: $(HFILES)
|
||||
@rm -rf ${DESTDIR}$(INCLDIR)/ext2fs
|
||||
@mkdir ${DESTDIR}$(INCLDIR)/ext2fs
|
||||
install-libs:: $(HFILES)
|
||||
@rm -rf $(INCLDIR)/ext2fs
|
||||
@mkdir $(INCLDIR)/ext2fs
|
||||
for i in $(HFILES); do \
|
||||
$(INSTALLINC) $$i ${DESTDIR}$(INCLDIR)/ext2fs/$$i; \
|
||||
$(INSTALLINC) $$i $(INCLDIR)/ext2fs/$$i; \
|
||||
done
|
||||
|
||||
clean:
|
||||
rm -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/*
|
||||
install-tree::
|
||||
|
||||
really-clean: clean
|
||||
install::
|
||||
|
||||
clean::
|
||||
rm -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/*
|
||||
rm -f ../libext2fs.a ../libext2fs_p.a ../libext2fs_chk.a
|
||||
|
||||
really-clean:: clean
|
||||
rm -f .depend ext2_err.c ext2_err.h
|
||||
|
||||
dep depend .depend: ext2_err.h
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -23,13 +22,15 @@
|
||||
*
|
||||
* Should have a special policy for directories.
|
||||
*/
|
||||
errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode, char *map,
|
||||
ino_t *ret)
|
||||
errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode,
|
||||
ext2fs_inode_bitmap map, ino_t *ret)
|
||||
{
|
||||
int dir_group = 0;
|
||||
ino_t i;
|
||||
ino_t start_inode;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!map)
|
||||
map = fs->inode_map;
|
||||
if (!map)
|
||||
@ -44,14 +45,14 @@ errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode, char *map,
|
||||
i = EXT2_FIRST_INO;
|
||||
|
||||
do {
|
||||
if (!ext2fs_test_inode_bitmap(fs, map, i))
|
||||
if (!ext2fs_test_inode_bitmap(map, i))
|
||||
break;
|
||||
i++;
|
||||
if (i > fs->super->s_inodes_count)
|
||||
i = EXT2_FIRST_INO;
|
||||
} while (i != start_inode);
|
||||
|
||||
if (ext2fs_test_inode_bitmap(fs, map, i))
|
||||
if (ext2fs_test_inode_bitmap(map, i))
|
||||
return ENOSPC;
|
||||
*ret = i;
|
||||
return 0;
|
||||
@ -61,10 +62,13 @@ errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode, char *map,
|
||||
* Stupid algorithm --- we now just search forward starting from the
|
||||
* goal. Should put in a smarter one someday....
|
||||
*/
|
||||
errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal, char *map, blk_t *ret)
|
||||
errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal,
|
||||
ext2fs_block_bitmap map, blk_t *ret)
|
||||
{
|
||||
blk_t i = goal;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!map)
|
||||
map = fs->block_map;
|
||||
if (!map)
|
||||
@ -72,7 +76,7 @@ errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal, char *map, blk_t *ret)
|
||||
if (!i)
|
||||
i = fs->super->s_first_data_block;
|
||||
do {
|
||||
if (!ext2fs_test_block_bitmap(fs, map, i)) {
|
||||
if (!ext2fs_test_block_bitmap(map, i)) {
|
||||
*ret = i;
|
||||
return 0;
|
||||
}
|
||||
@ -83,24 +87,27 @@ errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal, char *map, blk_t *ret)
|
||||
return ENOSPC;
|
||||
}
|
||||
|
||||
static int check_blocks_free(ext2_filsys fs, char *map, blk_t blk, int num)
|
||||
static int check_blocks_free(ext2_filsys fs, ext2fs_block_bitmap map,
|
||||
blk_t blk, int num)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i < num; i++) {
|
||||
if ((blk+i) > fs->super->s_blocks_count)
|
||||
return 0;
|
||||
if (ext2fs_test_block_bitmap(fs, map, blk+i))
|
||||
if (ext2fs_test_block_bitmap(map, blk+i))
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start, blk_t finish,
|
||||
int num, char *map, blk_t *ret)
|
||||
int num, ext2fs_block_bitmap map, blk_t *ret)
|
||||
{
|
||||
blk_t b = start;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!map)
|
||||
map = fs->block_map;
|
||||
if (!map)
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -30,6 +29,7 @@ errcode_t badblocks_list_create(badblocks_list *ret, int size)
|
||||
if (!bb)
|
||||
return ENOMEM;
|
||||
memset(bb, 0, sizeof(struct struct_badblocks_list));
|
||||
bb->magic = EXT2_ET_MAGIC_BADBLOCKS_LIST;
|
||||
bb->size = size ? size : 10;
|
||||
bb->list = malloc(bb->size * sizeof(blk_t));
|
||||
if (!bb->list) {
|
||||
@ -45,6 +45,9 @@ errcode_t badblocks_list_create(badblocks_list *ret, int size)
|
||||
*/
|
||||
void badblocks_list_free(badblocks_list bb)
|
||||
{
|
||||
if (bb->magic != EXT2_ET_MAGIC_BADBLOCKS_LIST)
|
||||
return;
|
||||
|
||||
if (bb->list)
|
||||
free(bb->list);
|
||||
bb->list = 0;
|
||||
@ -58,6 +61,8 @@ errcode_t badblocks_list_add(badblocks_list bb, blk_t blk)
|
||||
{
|
||||
int i;
|
||||
|
||||
EXT2_CHECK_MAGIC(bb, EXT2_ET_MAGIC_BADBLOCKS_LIST);
|
||||
|
||||
for (i=0; i < bb->num; i++)
|
||||
if (bb->list[i] == blk)
|
||||
return 0;
|
||||
@ -84,6 +89,8 @@ int badblocks_list_test(badblocks_list bb, blk_t blk)
|
||||
{
|
||||
int i;
|
||||
|
||||
EXT2_CHECK_MAGIC(bb, EXT2_ET_MAGIC_BADBLOCKS_LIST);
|
||||
|
||||
for (i=0; i < bb->num; i++)
|
||||
if (bb->list[i] == blk)
|
||||
return 1;
|
||||
@ -96,10 +103,13 @@ errcode_t badblocks_list_iterate_begin(badblocks_list bb,
|
||||
{
|
||||
badblocks_iterate iter;
|
||||
|
||||
EXT2_CHECK_MAGIC(bb, EXT2_ET_MAGIC_BADBLOCKS_LIST);
|
||||
|
||||
iter = malloc(sizeof(struct struct_badblocks_iterate));
|
||||
if (!iter)
|
||||
return ENOMEM;
|
||||
|
||||
iter->magic = EXT2_ET_MAGIC_BADBLOCKS_ITERATE;
|
||||
iter->bb = bb;
|
||||
iter->ptr = 0;
|
||||
*ret = iter;
|
||||
@ -108,7 +118,15 @@ errcode_t badblocks_list_iterate_begin(badblocks_list bb,
|
||||
|
||||
int badblocks_list_iterate(badblocks_iterate iter, blk_t *blk)
|
||||
{
|
||||
badblocks_list bb = iter->bb;
|
||||
badblocks_list bb;
|
||||
|
||||
if (iter->magic != EXT2_ET_MAGIC_BADBLOCKS_ITERATE)
|
||||
return 0;
|
||||
|
||||
bb = iter->bb;
|
||||
|
||||
if (bb->magic != EXT2_ET_MAGIC_BADBLOCKS_LIST)
|
||||
return 0;
|
||||
|
||||
if (iter->ptr < bb->num) {
|
||||
*blk = bb->list[iter->ptr++];
|
||||
@ -120,6 +138,9 @@ int badblocks_list_iterate(badblocks_iterate iter, blk_t *blk)
|
||||
|
||||
void badblocks_list_iterate_end(badblocks_iterate iter)
|
||||
{
|
||||
if (!iter || (iter->magic != EXT2_ET_MAGIC_BADBLOCKS_ITERATE))
|
||||
return;
|
||||
|
||||
iter->bb = 0;
|
||||
free(iter);
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -48,7 +47,10 @@ errcode_t ext2fs_update_bb_inode(ext2_filsys fs, badblocks_list bb_list)
|
||||
errcode_t retval;
|
||||
struct set_badblock_record rec;
|
||||
struct ext2_inode inode;
|
||||
blk_t blk;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!fs->block_map)
|
||||
return EXT2_ET_NO_BLOCK_BITMAP;
|
||||
|
||||
@ -70,7 +72,8 @@ errcode_t ext2fs_update_bb_inode(ext2_filsys fs, badblocks_list bb_list)
|
||||
/*
|
||||
* First clear the old bad blocks (while saving the indirect blocks)
|
||||
*/
|
||||
retval = ext2fs_block_iterate(fs, EXT2_BAD_INO, 0, 0,
|
||||
retval = ext2fs_block_iterate(fs, EXT2_BAD_INO,
|
||||
BLOCK_FLAG_DEPTH_TRAVERSE, 0,
|
||||
clear_bad_block_proc, &rec);
|
||||
if (retval)
|
||||
goto cleanup;
|
||||
@ -81,8 +84,21 @@ errcode_t ext2fs_update_bb_inode(ext2_filsys fs, badblocks_list bb_list)
|
||||
|
||||
/*
|
||||
* Now set the bad blocks!
|
||||
*
|
||||
* First, mark the bad blocks as used. This prevents a bad
|
||||
* block from being used as an indirecto block for the bad
|
||||
* block inode (!).
|
||||
*/
|
||||
if (bb_list) {
|
||||
retval = badblocks_list_iterate_begin(bb_list, &rec.bb_iter);
|
||||
if (retval)
|
||||
goto cleanup;
|
||||
while (badblocks_list_iterate(rec.bb_iter, &blk)) {
|
||||
ext2fs_mark_block_bitmap(fs->block_map, blk);
|
||||
}
|
||||
badblocks_list_iterate_end(rec.bb_iter);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
|
||||
retval = badblocks_list_iterate_begin(bb_list, &rec.bb_iter);
|
||||
if (retval)
|
||||
goto cleanup;
|
||||
@ -138,6 +154,15 @@ static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr, int blockcnt,
|
||||
if (!*block_nr)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* If the block number is outrageous, clear it and ignore it.
|
||||
*/
|
||||
if (*block_nr >= fs->super->s_blocks_count ||
|
||||
*block_nr < fs->super->s_first_data_block) {
|
||||
*block_nr = 0;
|
||||
return BLOCK_CHANGED;
|
||||
}
|
||||
|
||||
if (blockcnt < 0) {
|
||||
if (rec->ind_blocks_size >= rec->max_ind_blocks) {
|
||||
rec->max_ind_blocks += 10;
|
||||
@ -155,7 +180,7 @@ static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr, int blockcnt,
|
||||
/*
|
||||
* Mark the block as unused, and update accounting information
|
||||
*/
|
||||
ext2fs_unmark_block_bitmap(fs, fs->block_map, *block_nr);
|
||||
ext2fs_unmark_block_bitmap(fs->block_map, *block_nr);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
group = ext2fs_group_of_blk(fs, *block_nr);
|
||||
fs->group_desc[group].bg_free_blocks_count++;
|
||||
@ -188,34 +213,38 @@ static int set_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
|
||||
if (!badblocks_list_iterate(rec->bb_iter, &blk))
|
||||
return BLOCK_ABORT;
|
||||
rec->bad_block_count++;
|
||||
} else if (rec->ind_blocks_ptr < rec->ind_blocks_size)
|
||||
} else {
|
||||
/*
|
||||
* An indirect block; fetch a block from the
|
||||
* previously used indirect block list.
|
||||
* previously used indirect block list. The block
|
||||
* most be not marked as used; if so, get another one.
|
||||
* If we run out of reserved indirect blocks, allocate
|
||||
* a new one.
|
||||
*/
|
||||
blk = rec->ind_blocks[rec->ind_blocks_ptr++];
|
||||
else {
|
||||
/*
|
||||
* An indirect block, and we're out of reserved
|
||||
* indirect blocks. Allocate a new one.
|
||||
*/
|
||||
retval = ext2fs_new_block(fs, 0, 0, &blk);
|
||||
if (retval) {
|
||||
rec->err = retval;
|
||||
return BLOCK_ABORT;
|
||||
retry:
|
||||
if (rec->ind_blocks_ptr < rec->ind_blocks_size) {
|
||||
blk = rec->ind_blocks[rec->ind_blocks_ptr++];
|
||||
if (ext2fs_test_block_bitmap(fs->block_map, blk))
|
||||
goto retry;
|
||||
} else {
|
||||
retval = ext2fs_new_block(fs, 0, 0, &blk);
|
||||
if (retval) {
|
||||
rec->err = retval;
|
||||
return BLOCK_ABORT;
|
||||
}
|
||||
}
|
||||
retval = io_channel_write_blk(fs->io, blk, 1, rec->block_buf);
|
||||
if (retval) {
|
||||
rec->err = retval;
|
||||
return BLOCK_ABORT;
|
||||
}
|
||||
ext2fs_mark_block_bitmap(fs->block_map, blk);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark the block as used, and update block counts
|
||||
* Update block counts
|
||||
*/
|
||||
ext2fs_mark_block_bitmap(fs, fs->block_map, blk);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
group = ext2fs_group_of_blk(fs, blk);
|
||||
fs->group_desc[group].bg_free_blocks_count--;
|
||||
fs->super->s_free_blocks_count--;
|
||||
|
@ -15,244 +15,173 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
|
||||
errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs)
|
||||
errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs,
|
||||
const char *descr,
|
||||
ext2fs_inode_bitmap *ret)
|
||||
{
|
||||
int i;
|
||||
int nbytes;
|
||||
errcode_t retval;
|
||||
char * inode_bitmap = fs->inode_map;
|
||||
char * bitmap_block = NULL;
|
||||
|
||||
if (!(fs->flags & EXT2_FLAG_RW))
|
||||
return EXT2_ET_RO_FILSYS;
|
||||
if (!inode_bitmap)
|
||||
return 0;
|
||||
nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8;
|
||||
bitmap_block = malloc(fs->blocksize);
|
||||
if (!bitmap_block)
|
||||
return ENOMEM;
|
||||
memset(bitmap_block, 0xff, fs->blocksize);
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
memcpy(bitmap_block, inode_bitmap, nbytes);
|
||||
retval = io_channel_write_blk(fs->io,
|
||||
fs->group_desc[i].bg_inode_bitmap, 1,
|
||||
bitmap_block);
|
||||
if (retval)
|
||||
return EXT2_ET_INODE_BITMAP_WRITE;
|
||||
inode_bitmap += nbytes;
|
||||
}
|
||||
fs->flags |= EXT2_FLAG_CHANGED;
|
||||
fs->flags &= ~EXT2_FLAG_IB_DIRTY;
|
||||
free(bitmap_block);
|
||||
return 0;
|
||||
}
|
||||
|
||||
errcode_t ext2fs_write_block_bitmap (ext2_filsys fs)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int nbytes;
|
||||
int nbits;
|
||||
errcode_t retval;
|
||||
char * block_bitmap = fs->block_map;
|
||||
char * bitmap_block = NULL;
|
||||
|
||||
if (!(fs->flags & EXT2_FLAG_RW))
|
||||
return EXT2_ET_RO_FILSYS;
|
||||
if (!block_bitmap)
|
||||
return 0;
|
||||
nbytes = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
|
||||
bitmap_block = malloc(fs->blocksize);
|
||||
if (!bitmap_block)
|
||||
return ENOMEM;
|
||||
memset(bitmap_block, 0xff, fs->blocksize);
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
memcpy(bitmap_block, block_bitmap, nbytes);
|
||||
if (i == fs->group_desc_count - 1) {
|
||||
/* Force bitmap padding for the last group */
|
||||
nbits = (fs->super->s_blocks_count
|
||||
- fs->super->s_first_data_block)
|
||||
% EXT2_BLOCKS_PER_GROUP(fs->super);
|
||||
for (j = nbits; j < fs->blocksize * 8; j++)
|
||||
set_bit(j, bitmap_block);
|
||||
}
|
||||
retval = io_channel_write_blk(fs->io,
|
||||
fs->group_desc[i].bg_block_bitmap, 1,
|
||||
bitmap_block);
|
||||
if (retval)
|
||||
return EXT2_ET_BLOCK_BITMAP_WRITE;
|
||||
block_bitmap += nbytes;
|
||||
}
|
||||
fs->flags |= EXT2_FLAG_CHANGED;
|
||||
fs->flags &= ~EXT2_FLAG_BB_DIRTY;
|
||||
free(bitmap_block);
|
||||
return 0;
|
||||
}
|
||||
|
||||
errcode_t ext2fs_read_inode_bitmap (ext2_filsys fs)
|
||||
{
|
||||
int i;
|
||||
char * inode_bitmap;
|
||||
char *buf = 0;
|
||||
errcode_t retval;
|
||||
int nbytes;
|
||||
|
||||
fs->write_bitmaps = ext2fs_write_bitmaps;
|
||||
|
||||
if (fs->inode_map)
|
||||
free(fs->inode_map);
|
||||
nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8;
|
||||
fs->flags &= ~EXT2_FLAG_IB_DIRTY;
|
||||
fs->inode_map = malloc((nbytes * fs->group_desc_count) + 1);
|
||||
if (!fs->inode_map)
|
||||
return ENOMEM;
|
||||
inode_bitmap = fs->inode_map;
|
||||
|
||||
buf = malloc(fs->blocksize);
|
||||
if (!buf)
|
||||
return ENOMEM;
|
||||
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
retval = io_channel_read_blk(fs->io,
|
||||
fs->group_desc[i].bg_inode_bitmap, 1,
|
||||
buf);
|
||||
if (retval) {
|
||||
retval = EXT2_ET_INODE_BITMAP_READ;
|
||||
goto cleanup;
|
||||
}
|
||||
memcpy(inode_bitmap, buf, nbytes);
|
||||
inode_bitmap += nbytes;
|
||||
}
|
||||
free(buf);
|
||||
return 0;
|
||||
|
||||
cleanup:
|
||||
free(fs->inode_map);
|
||||
fs->inode_map = 0;
|
||||
if (buf)
|
||||
free(buf);
|
||||
return retval;
|
||||
}
|
||||
|
||||
errcode_t ext2fs_read_block_bitmap(ext2_filsys fs)
|
||||
{
|
||||
int i;
|
||||
char * block_bitmap;
|
||||
char *buf = 0;
|
||||
errcode_t retval;
|
||||
int nbytes;
|
||||
|
||||
fs->write_bitmaps = ext2fs_write_bitmaps;
|
||||
|
||||
if (fs->block_map)
|
||||
free(fs->block_map);
|
||||
nbytes = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
|
||||
fs->flags &= ~EXT2_FLAG_BB_DIRTY;
|
||||
fs->block_map = malloc((nbytes * fs->group_desc_count) + 1);
|
||||
if (!fs->block_map)
|
||||
return ENOMEM;
|
||||
block_bitmap = fs->block_map;
|
||||
|
||||
buf = malloc(fs->blocksize);
|
||||
if (!buf)
|
||||
return ENOMEM;
|
||||
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
retval = io_channel_read_blk(fs->io,
|
||||
fs->group_desc[i].bg_block_bitmap, 1,
|
||||
buf);
|
||||
if (retval) {
|
||||
retval = EXT2_ET_BLOCK_BITMAP_READ;
|
||||
goto cleanup;
|
||||
}
|
||||
memcpy(block_bitmap, buf, nbytes);
|
||||
block_bitmap += nbytes;
|
||||
}
|
||||
free(buf);
|
||||
return 0;
|
||||
|
||||
cleanup:
|
||||
free(fs->block_map);
|
||||
fs->block_map = 0;
|
||||
if (buf)
|
||||
free(buf);
|
||||
return retval;
|
||||
}
|
||||
|
||||
errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs, char **ret)
|
||||
{
|
||||
char *map;
|
||||
int size;
|
||||
|
||||
fs->write_bitmaps = ext2fs_write_bitmaps;
|
||||
|
||||
size = (fs->super->s_inodes_count / 8) + 1;
|
||||
map = malloc(size);
|
||||
if (!map)
|
||||
return ENOMEM;
|
||||
memset(map, 0, size);
|
||||
*ret = map;
|
||||
return 0;
|
||||
}
|
||||
|
||||
errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs, char **ret)
|
||||
{
|
||||
char *map;
|
||||
ext2fs_inode_bitmap bitmap;
|
||||
int size;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
fs->write_bitmaps = ext2fs_write_bitmaps;
|
||||
|
||||
size = (fs->super->s_blocks_count / 8) + 1;
|
||||
map = malloc(size);
|
||||
if (!map)
|
||||
|
||||
bitmap = malloc(sizeof(struct ext2fs_struct_inode_bitmap));
|
||||
if (!bitmap)
|
||||
return ENOMEM;
|
||||
memset(map, 0, size);
|
||||
*ret = map;
|
||||
|
||||
bitmap->magic = EXT2_ET_MAGIC_INODE_BITMAP;
|
||||
bitmap->fs = fs;
|
||||
bitmap->start = 1;
|
||||
bitmap->end = fs->super->s_inodes_count;
|
||||
bitmap->real_end = (EXT2_INODES_PER_GROUP(fs->super)
|
||||
* fs->group_desc_count);
|
||||
if (descr) {
|
||||
bitmap->description = malloc(strlen(descr)+1);
|
||||
if (!bitmap->description) {
|
||||
free(bitmap);
|
||||
return ENOMEM;
|
||||
}
|
||||
strcpy(bitmap->description, descr);
|
||||
} else
|
||||
bitmap->description = 0;
|
||||
|
||||
size = ((bitmap->real_end - bitmap->start) / 8) + 1;
|
||||
bitmap->bitmap = malloc(size);
|
||||
if (!bitmap->bitmap) {
|
||||
free(bitmap->description);
|
||||
free(bitmap);
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
memset(bitmap->bitmap, 0, size);
|
||||
*ret = bitmap;
|
||||
return 0;
|
||||
}
|
||||
|
||||
errcode_t ext2fs_read_bitmaps(ext2_filsys fs)
|
||||
errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs,
|
||||
const char *descr,
|
||||
ext2fs_block_bitmap *ret)
|
||||
{
|
||||
errcode_t retval;
|
||||
ext2fs_block_bitmap bitmap;
|
||||
int size;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
fs->write_bitmaps = ext2fs_write_bitmaps;
|
||||
|
||||
if (!fs->inode_map) {
|
||||
retval = ext2fs_read_inode_bitmap(fs);
|
||||
if (retval)
|
||||
return retval;
|
||||
}
|
||||
if (!fs->block_map) {
|
||||
retval = ext2fs_read_block_bitmap(fs);
|
||||
if (retval)
|
||||
return retval;
|
||||
bitmap = malloc(sizeof(struct ext2fs_struct_inode_bitmap));
|
||||
if (!bitmap)
|
||||
return ENOMEM;
|
||||
|
||||
bitmap->magic = EXT2_ET_MAGIC_BLOCK_BITMAP;
|
||||
bitmap->fs = fs;
|
||||
bitmap->start = fs->super->s_first_data_block;
|
||||
bitmap->end = fs->super->s_blocks_count-1;
|
||||
bitmap->real_end = (EXT2_BLOCKS_PER_GROUP(fs->super)
|
||||
* fs->group_desc_count)-1 + bitmap->start;
|
||||
if (descr) {
|
||||
bitmap->description = malloc(strlen(descr)+1);
|
||||
if (!bitmap->description) {
|
||||
free(bitmap);
|
||||
return ENOMEM;
|
||||
}
|
||||
strcpy(bitmap->description, descr);
|
||||
} else
|
||||
bitmap->description = 0;
|
||||
|
||||
size = ((bitmap->real_end - bitmap->start) / 8) + 1;
|
||||
bitmap->bitmap = malloc(size);
|
||||
if (!bitmap->bitmap) {
|
||||
free(bitmap->description);
|
||||
free(bitmap);
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
memset(bitmap->bitmap, 0, size);
|
||||
*ret = bitmap;
|
||||
return 0;
|
||||
}
|
||||
|
||||
errcode_t ext2fs_write_bitmaps(ext2_filsys fs)
|
||||
errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap,
|
||||
ino_t end, ino_t *oend)
|
||||
{
|
||||
errcode_t retval;
|
||||
|
||||
if (fs->block_map && ext2fs_test_bb_dirty(fs)) {
|
||||
retval = ext2fs_write_block_bitmap(fs);
|
||||
if (retval)
|
||||
return retval;
|
||||
}
|
||||
if (fs->inode_map && ext2fs_test_ib_dirty(fs)) {
|
||||
retval = ext2fs_write_inode_bitmap(fs);
|
||||
if (retval)
|
||||
return retval;
|
||||
}
|
||||
EXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_INODE_BITMAP);
|
||||
|
||||
if (end > bitmap->real_end)
|
||||
return EXT2_ET_FUDGE_INODE_BITMAP_END;
|
||||
if (oend)
|
||||
*oend = bitmap->end;
|
||||
bitmap->end = end;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap,
|
||||
blk_t end, blk_t *oend)
|
||||
{
|
||||
EXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_BLOCK_BITMAP);
|
||||
|
||||
if (end > bitmap->real_end)
|
||||
return EXT2_ET_FUDGE_BLOCK_BITMAP_END;
|
||||
if (oend)
|
||||
*oend = bitmap->end;
|
||||
bitmap->end = end;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap)
|
||||
{
|
||||
if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_INODE_BITMAP))
|
||||
return;
|
||||
|
||||
memset(bitmap->bitmap, 0,
|
||||
((bitmap->real_end - bitmap->start) / 8) + 1);
|
||||
}
|
||||
|
||||
void ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap)
|
||||
{
|
||||
if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_BLOCK_BITMAP))
|
||||
return;
|
||||
|
||||
memset(bitmap->bitmap, 0,
|
||||
((bitmap->real_end - bitmap->start) / 8) + 1);
|
||||
}
|
||||
|
||||
void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap)
|
||||
{
|
||||
if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_INODE_BITMAP))
|
||||
return;
|
||||
|
||||
bitmap->magic = 0;
|
||||
if (bitmap->description) {
|
||||
free(bitmap->description);
|
||||
bitmap->description = 0;
|
||||
}
|
||||
if (bitmap->bitmap) {
|
||||
free(bitmap->bitmap);
|
||||
bitmap->bitmap = 0;
|
||||
}
|
||||
free(bitmap);
|
||||
}
|
||||
|
||||
void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap)
|
||||
{
|
||||
if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_BLOCK_BITMAP))
|
||||
return;
|
||||
|
||||
bitmap->magic = 0;
|
||||
if (bitmap->description) {
|
||||
free(bitmap->description);
|
||||
bitmap->description = 0;
|
||||
}
|
||||
if (bitmap->bitmap) {
|
||||
free(bitmap->bitmap);
|
||||
bitmap->bitmap = 0;
|
||||
}
|
||||
free(bitmap);
|
||||
}
|
||||
|
||||
|
@ -10,12 +10,12 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
|
||||
#if (!defined(__i386__) && !defined(__i486__) && !defined(__i586__))
|
||||
#ifndef _EXT2_HAVE_ASM_BITOPS_
|
||||
|
||||
/*
|
||||
* For the benefit of those who are trying to port Linux to another
|
||||
@ -69,27 +69,14 @@ int test_bit(int nr, const void * addr)
|
||||
mask = 1 << (nr & 0x1f);
|
||||
return ((mask & *ADDR) != 0);
|
||||
}
|
||||
#endif /* !i386 */
|
||||
#endif /* !_EXT2_HAVE_ASM_BITOPS_ */
|
||||
|
||||
/*
|
||||
* These are routines print warning messages; they are called by
|
||||
* inline routines.
|
||||
*/
|
||||
const char *ext2fs_block_string = "block";
|
||||
const char *ext2fs_inode_string = "inode";
|
||||
const char *ext2fs_mark_string = "mark";
|
||||
const char *ext2fs_unmark_string = "unmark";
|
||||
const char *ext2fs_test_string = "test";
|
||||
|
||||
void ext2fs_warn_bitmap(ext2_filsys fs, const char *op, const char *type,
|
||||
int arg)
|
||||
void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg,
|
||||
const char *description)
|
||||
{
|
||||
char func[80];
|
||||
|
||||
sprintf(func, "ext2fs_%s_%s_bitmap", op, type);
|
||||
com_err(func, 0, "INTERNAL ERROR: illegal %s #%d for %s",
|
||||
type, arg, fs->device_name);
|
||||
if (description)
|
||||
com_err(0, errcode, "#%u for %s", arg, description);
|
||||
else
|
||||
com_err(0, errcode, "#%u", arg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -22,19 +22,18 @@ extern const char *ext2fs_inode_string;
|
||||
extern const char *ext2fs_mark_string;
|
||||
extern const char *ext2fs_unmark_string;
|
||||
extern const char *ext2fs_test_string;
|
||||
extern void ext2fs_warn_bitmap(ext2_filsys fs, const char *op,
|
||||
const char *type, int arg);
|
||||
extern void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg,
|
||||
const char *description);
|
||||
|
||||
extern void ext2fs_mark_block_bitmap(ext2_filsys fs, char *bitmap, int block);
|
||||
extern void ext2fs_unmark_block_bitmap(ext2_filsys fs, char *bitmap,
|
||||
int block);
|
||||
extern int ext2fs_test_block_bitmap(ext2_filsys fs, const char *bitmap,
|
||||
int block);
|
||||
extern void ext2fs_mark_inode_bitmap(ext2_filsys fs, char *bitmap, int inode);
|
||||
extern void ext2fs_unmark_inode_bitmap(ext2_filsys fs, char *bitmap,
|
||||
int inode);
|
||||
extern int ext2fs_test_inode_bitmap(ext2_filsys fs, const char *bitmap,
|
||||
int inode);
|
||||
extern void ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
|
||||
extern void ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
|
||||
blk_t block);
|
||||
extern int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
|
||||
|
||||
extern void ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ino_t inode);
|
||||
extern void ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
|
||||
ino_t inode);
|
||||
extern int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ino_t inode);
|
||||
|
||||
/*
|
||||
* The inline routines themselves...
|
||||
@ -50,6 +49,9 @@ extern int ext2fs_test_inode_bitmap(ext2_filsys fs, const char *bitmap,
|
||||
#endif
|
||||
|
||||
#if (defined(__i386__) || defined(__i486__) || defined(__i586__))
|
||||
|
||||
#define _EXT2_HAVE_ASM_BITOPS_
|
||||
|
||||
/*
|
||||
* These are done by inline assembly for speed reasons.....
|
||||
*
|
||||
@ -99,73 +101,106 @@ _INLINE_ int test_bit(int nr, const void * addr)
|
||||
|
||||
#endif /* i386 */
|
||||
|
||||
_INLINE_ void ext2fs_mark_block_bitmap(ext2_filsys fs, char *bitmap,
|
||||
int block)
|
||||
#ifdef __mc68000__
|
||||
|
||||
#define _EXT2_HAVE_ASM_BITOPS_
|
||||
|
||||
_INLINE_ int set_bit(int nr,void * addr)
|
||||
{
|
||||
if ((block < fs->super->s_first_data_block) ||
|
||||
(block >= fs->super->s_blocks_count)) {
|
||||
ext2fs_warn_bitmap(fs, ext2fs_mark_string,
|
||||
ext2fs_block_string, block);
|
||||
return;
|
||||
}
|
||||
set_bit(block - fs->super->s_first_data_block, bitmap);
|
||||
char retval;
|
||||
|
||||
__asm__ __volatile__ ("bfset %2@{%1:#1}; sne %0"
|
||||
: "=d" (retval) : "d" (nr), "a" (addr));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
_INLINE_ void ext2fs_unmark_block_bitmap(ext2_filsys fs, char *bitmap,
|
||||
int block)
|
||||
_INLINE_ int clear_bit(int nr, void * addr)
|
||||
{
|
||||
if ((block < fs->super->s_first_data_block) ||
|
||||
(block >= fs->super->s_blocks_count)) {
|
||||
ext2fs_warn_bitmap(fs, ext2fs_unmark_string,
|
||||
ext2fs_block_string, block);
|
||||
return;
|
||||
}
|
||||
clear_bit(block - fs->super->s_first_data_block, bitmap);
|
||||
char retval;
|
||||
|
||||
__asm__ __volatile__ ("bfclr %2@{%1:#1}; sne %0"
|
||||
: "=d" (retval) : "d" (nr), "a" (addr));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
_INLINE_ int ext2fs_test_block_bitmap(ext2_filsys fs, const char *bitmap,
|
||||
int block)
|
||||
_INLINE_ int test_bit(int nr, const void * addr)
|
||||
{
|
||||
if ((block < fs->super->s_first_data_block) ||
|
||||
(block >= fs->super->s_blocks_count)) {
|
||||
ext2fs_warn_bitmap(fs, ext2fs_test_string,
|
||||
ext2fs_block_string, block);
|
||||
char retval;
|
||||
|
||||
__asm__ __volatile__ ("bftst %2@{%1:#1}; sne %0"
|
||||
: "=d" (retval) : "d" (nr), "a" (addr));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif /* __mc68000__ */
|
||||
|
||||
_INLINE_ void ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap,
|
||||
blk_t block)
|
||||
{
|
||||
if ((block < bitmap->start) || (block > bitmap->end)) {
|
||||
ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_MARK, block,
|
||||
bitmap->description);
|
||||
return;
|
||||
}
|
||||
set_bit(block - bitmap->start, bitmap->bitmap);
|
||||
}
|
||||
|
||||
_INLINE_ void ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
|
||||
blk_t block)
|
||||
{
|
||||
if ((block < bitmap->start) || (block > bitmap->end)) {
|
||||
ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_UNMARK,
|
||||
block, bitmap->description);
|
||||
return;
|
||||
}
|
||||
clear_bit(block - bitmap->start, bitmap->bitmap);
|
||||
}
|
||||
|
||||
_INLINE_ int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap,
|
||||
blk_t block)
|
||||
{
|
||||
if ((block < bitmap->start) || (block > bitmap->end)) {
|
||||
ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_TEST,
|
||||
block, bitmap->description);
|
||||
return 0;
|
||||
}
|
||||
return test_bit(block - fs->super->s_first_data_block, bitmap);
|
||||
return test_bit(block - bitmap->start, bitmap->bitmap);
|
||||
}
|
||||
|
||||
_INLINE_ void ext2fs_mark_inode_bitmap(ext2_filsys fs, char *bitmap,
|
||||
int inode)
|
||||
_INLINE_ void ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
|
||||
ino_t inode)
|
||||
{
|
||||
if ((inode < 1) || (inode > fs->super->s_inodes_count)) {
|
||||
ext2fs_warn_bitmap(fs, ext2fs_mark_string,
|
||||
ext2fs_inode_string, inode);
|
||||
if ((inode < bitmap->start) || (inode > bitmap->end)) {
|
||||
ext2fs_warn_bitmap(EXT2_ET_BAD_INODE_MARK,
|
||||
inode, bitmap->description);
|
||||
return;
|
||||
}
|
||||
set_bit(inode - 1, bitmap);
|
||||
set_bit(inode - bitmap->start, bitmap->bitmap);
|
||||
}
|
||||
|
||||
_INLINE_ void ext2fs_unmark_inode_bitmap(ext2_filsys fs, char *bitmap,
|
||||
int inode)
|
||||
_INLINE_ void ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
|
||||
ino_t inode)
|
||||
{
|
||||
if ((inode < 1) || (inode > fs->super->s_inodes_count)) {
|
||||
ext2fs_warn_bitmap(fs, ext2fs_unmark_string,
|
||||
ext2fs_inode_string, inode);
|
||||
if ((inode < bitmap->start) || (inode > bitmap->end)) {
|
||||
ext2fs_warn_bitmap(EXT2_ET_BAD_INODE_UNMARK,
|
||||
inode, bitmap->description);
|
||||
return;
|
||||
}
|
||||
clear_bit(inode - 1, bitmap);
|
||||
clear_bit(inode - bitmap->start, bitmap->bitmap);
|
||||
}
|
||||
|
||||
_INLINE_ int ext2fs_test_inode_bitmap(ext2_filsys fs, const char *bitmap,
|
||||
int inode)
|
||||
_INLINE_ int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
|
||||
ino_t inode)
|
||||
{
|
||||
if ((inode < 1) || (inode > fs->super->s_inodes_count)) {
|
||||
ext2fs_warn_bitmap(fs, ext2fs_test_string,
|
||||
ext2fs_inode_string, inode);
|
||||
if ((inode < bitmap->start) || (inode > bitmap->end)) {
|
||||
ext2fs_warn_bitmap(EXT2_ET_BAD_INODE_TEST,
|
||||
inode, bitmap->description);
|
||||
return 0;
|
||||
}
|
||||
return test_bit(inode - 1, bitmap);
|
||||
return test_bit(inode - bitmap->start, bitmap->bitmap);
|
||||
}
|
||||
|
||||
#undef _INLINE_
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -40,6 +40,12 @@ static int block_iterate_ind(blk_t *ind_block, struct block_context *ctx)
|
||||
ret = (*ctx->func)(ctx->fs, ind_block, -1, ctx->private);
|
||||
if (!*ind_block || (ret & BLOCK_ABORT))
|
||||
return ret;
|
||||
if (*ind_block >= ctx->fs->super->s_blocks_count ||
|
||||
*ind_block < ctx->fs->super->s_first_data_block) {
|
||||
ctx->errcode = EXT2_ET_BAD_IND_BLOCK;
|
||||
ret |= BLOCK_ERROR;
|
||||
return ret;
|
||||
}
|
||||
ctx->errcode = io_channel_read_blk(ctx->fs->io, *ind_block,
|
||||
1, ctx->ind_buf);
|
||||
if (ctx->errcode) {
|
||||
@ -80,6 +86,12 @@ static int block_iterate_dind(blk_t *dind_block, struct block_context *ctx)
|
||||
ret = (*ctx->func)(ctx->fs, dind_block, -2, ctx->private);
|
||||
if (!*dind_block || (ret & BLOCK_ABORT))
|
||||
return ret;
|
||||
if (*dind_block >= ctx->fs->super->s_blocks_count ||
|
||||
*dind_block < ctx->fs->super->s_first_data_block) {
|
||||
ctx->errcode = EXT2_ET_BAD_DIND_BLOCK;
|
||||
ret |= BLOCK_ERROR;
|
||||
return ret;
|
||||
}
|
||||
ctx->errcode = io_channel_read_blk(ctx->fs->io, *dind_block,
|
||||
1, ctx->dind_buf);
|
||||
if (ctx->errcode) {
|
||||
@ -119,6 +131,12 @@ static int block_iterate_tind(blk_t *tind_block, struct block_context *ctx)
|
||||
ret = (*ctx->func)(ctx->fs, tind_block, -3, ctx->private);
|
||||
if (!*tind_block || (ret & BLOCK_ABORT))
|
||||
return ret;
|
||||
if (*tind_block >= ctx->fs->super->s_blocks_count ||
|
||||
*tind_block < ctx->fs->super->s_first_data_block) {
|
||||
ctx->errcode = EXT2_ET_BAD_TIND_BLOCK;
|
||||
ret |= BLOCK_ERROR;
|
||||
return ret;
|
||||
}
|
||||
ctx->errcode = io_channel_read_blk(ctx->fs->io, *tind_block,
|
||||
1, ctx->tind_buf);
|
||||
if (ctx->errcode) {
|
||||
@ -165,6 +183,8 @@ errcode_t ext2fs_block_iterate(ext2_filsys fs,
|
||||
struct ext2_inode inode;
|
||||
errcode_t retval;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
ret = ext2fs_get_blocks(fs, ino, blocks);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
63
lib/ext2fs/check_desc.c
Normal file
63
lib/ext2fs/check_desc.c
Normal file
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* check_desc.c --- Check the group descriptors of an ext2 filesystem
|
||||
*
|
||||
* Copyright (C) 1993, 1994 Theodore Ts'o. This file may be redistributed
|
||||
* under the terms of the GNU Public License.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
|
||||
/*
|
||||
* This routine sanity checks the group descriptors
|
||||
*/
|
||||
errcode_t ext2fs_check_desc(ext2_filsys fs)
|
||||
{
|
||||
int i;
|
||||
int block = fs->super->s_first_data_block;
|
||||
int next, inode_blocks_per_group;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
inode_blocks_per_group = fs->super->s_inodes_per_group /
|
||||
EXT2_INODES_PER_BLOCK (fs->super);
|
||||
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
next = block + fs->super->s_blocks_per_group;
|
||||
/*
|
||||
* Check to make sure block bitmap for group is
|
||||
* located within the group.
|
||||
*/
|
||||
if (fs->group_desc[i].bg_block_bitmap < block ||
|
||||
fs->group_desc[i].bg_block_bitmap >= next)
|
||||
return EXT2_ET_GDESC_BAD_BLOCK_MAP;
|
||||
/*
|
||||
* Check to make sure inode bitmap for group is
|
||||
* located within the group
|
||||
*/
|
||||
if (fs->group_desc[i].bg_inode_bitmap < block ||
|
||||
fs->group_desc[i].bg_inode_bitmap >= next)
|
||||
return EXT2_ET_GDESC_BAD_INODE_MAP;
|
||||
/*
|
||||
* Check to make sure inode table for group is located
|
||||
* within the group
|
||||
*/
|
||||
if (fs->group_desc[i].bg_inode_table < block ||
|
||||
fs->group_desc[i].bg_inode_table+inode_blocks_per_group >=
|
||||
next)
|
||||
return EXT2_ET_GDESC_BAD_INODE_TABLE;
|
||||
|
||||
block = next;
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -10,7 +10,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -21,7 +20,10 @@ errcode_t ext2fs_flush(ext2_filsys fs)
|
||||
int group_block;
|
||||
errcode_t retval;
|
||||
char *group_ptr;
|
||||
unsigned long fs_state;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
/*
|
||||
* Write out master superblock. This has to be done
|
||||
* separately, since it is located at a fixed location
|
||||
@ -34,6 +36,13 @@ errcode_t ext2fs_flush(ext2_filsys fs)
|
||||
return retval;
|
||||
io_channel_set_blksize(fs->io, fs->blocksize);
|
||||
|
||||
/*
|
||||
* Save the state of the FS and set it to non valid for the
|
||||
* backup superblocks
|
||||
*/
|
||||
fs_state = fs->super->s_state;
|
||||
fs->super->s_state &= ~EXT2_VALID_FS;
|
||||
|
||||
/*
|
||||
* Write out the master group descriptors, and the backup
|
||||
* superblocks and group descriptors.
|
||||
@ -44,21 +53,27 @@ errcode_t ext2fs_flush(ext2_filsys fs)
|
||||
retval = io_channel_write_blk(fs->io, group_block,
|
||||
-SUPERBLOCK_SIZE,
|
||||
fs->super);
|
||||
if (retval)
|
||||
if (retval) {
|
||||
fs->super->s_state = fs_state;
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
group_ptr = (char *) fs->group_desc;
|
||||
for (j=0; j < fs->desc_blocks; j++) {
|
||||
retval = io_channel_write_blk(fs->io,
|
||||
group_block+1+j, 1,
|
||||
group_ptr);
|
||||
if (retval)
|
||||
if (retval) {
|
||||
fs->super->s_state = fs_state;
|
||||
return retval;
|
||||
}
|
||||
group_ptr += fs->blocksize;
|
||||
}
|
||||
group_block += EXT2_BLOCKS_PER_GROUP(fs->super);
|
||||
}
|
||||
|
||||
fs->super->s_state = fs_state;
|
||||
|
||||
/*
|
||||
* If the write_bitmaps() function is present, call it to
|
||||
* flush the bitmaps. This is done this way so that a simple
|
||||
@ -78,6 +93,8 @@ errcode_t ext2fs_close(ext2_filsys fs)
|
||||
{
|
||||
errcode_t retval;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (fs->flags & EXT2_FLAG_DIRTY) {
|
||||
retval = ext2fs_flush(fs);
|
||||
if (retval)
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -62,7 +62,7 @@ static int expand_dir_proc(ext2_filsys fs,
|
||||
}
|
||||
free(block);
|
||||
*blocknr = new_blk;
|
||||
ext2fs_mark_block_bitmap(fs, fs->block_map, new_blk);
|
||||
ext2fs_mark_block_bitmap(fs->block_map, new_blk);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
group = ext2fs_group_of_blk(fs, new_blk);
|
||||
fs->group_desc[group].bg_free_blocks_count--;
|
||||
@ -80,6 +80,8 @@ errcode_t ext2fs_expand_dir(ext2_filsys fs, ino_t dir)
|
||||
struct expand_dir_struct es;
|
||||
struct ext2_inode inode;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!(fs->flags & EXT2_FLAG_RW))
|
||||
return EXT2_ET_RO_FILSYS;
|
||||
|
||||
|
@ -10,8 +10,27 @@
|
||||
#endif
|
||||
|
||||
static const char * const text[] = {
|
||||
"EXT2FS Library version 0.0",
|
||||
"EXT2FS Library version 0.5b",
|
||||
"Wrong magic number for ext2_filsys structure",
|
||||
"Wrong magic number for badblocks_list structure",
|
||||
"Wrong magic number for badblocks_iterate structure",
|
||||
"Wrong magic number for inode_scan structure",
|
||||
"Wrong magic number for io_channel structure",
|
||||
"Wrong magic number for unix io_channel structure",
|
||||
"Wrong magic number for io_manager structure",
|
||||
"Wrong magic number for block_bitmap structure",
|
||||
"Wrong magic number for inode_bitmap structure",
|
||||
"Wrong magic number --- RESERVED_1",
|
||||
"Wrong magic number --- RESERVED_2",
|
||||
"Wrong magic number --- RESERVED_3",
|
||||
"Wrong magic number --- RESERVED_4",
|
||||
"Wrong magic number --- RESERVED_5",
|
||||
"Wrong magic number --- RESERVED_6",
|
||||
"Wrong magic number --- RESERVED_7",
|
||||
"Wrong magic number --- RESERVED_8",
|
||||
"Wrong magic number --- RESERVED_9",
|
||||
"Bad magic number in super-block",
|
||||
"Filesystem revision too high",
|
||||
"Can't seek to superblock",
|
||||
"Can't read superblock",
|
||||
"Can't write superblock",
|
||||
@ -39,6 +58,17 @@ static const char * const text[] = {
|
||||
"Illegal block number",
|
||||
"Internal error in ext2fs_expand_dir",
|
||||
"Not enough space to build proposed filesystem",
|
||||
"Illegal block number passed to ext2fs_mark_block_bitmap",
|
||||
"Illegal block number passed to ext2fs_unmark_block_bitmap",
|
||||
"Illegal block number passed to ext2fs_test_block_bitmap",
|
||||
"Illegal inode number passed to ext2fs_mark_inode_bitmap",
|
||||
"Illegal inode number passed to ext2fs_unmark_inode_bitmap",
|
||||
"Illegal inode number passed to ext2fs_test_inode_bitmap",
|
||||
"Attempt to fudge end of block bitmap past the real end",
|
||||
"Attempt to fudge end of inode bitmap past the real end",
|
||||
"Illegal indirect block found" ,
|
||||
"Illegal doubly indirect block found" ,
|
||||
"Illegal triply indirect block found" ,
|
||||
0
|
||||
};
|
||||
|
||||
@ -53,7 +83,7 @@ struct et_list {
|
||||
};
|
||||
extern struct et_list *_et_list;
|
||||
|
||||
static const struct error_table et = { text, 2133571328L, 29 };
|
||||
static const struct error_table et = { text, 2133571328L, 59 };
|
||||
|
||||
static struct et_list link = { 0, 0 };
|
||||
|
||||
|
@ -1,15 +1,72 @@
|
||||
#
|
||||
# Copyright (C) 1993 Theodore Ts'o. This file may be redistributed
|
||||
# Copyright (C) 1993, 1994 Theodore Ts'o. This file may be redistributed
|
||||
# under the terms of the GNU Public License.
|
||||
#
|
||||
error_table ext2
|
||||
|
||||
ec EXT2_ET_BASE,
|
||||
"EXT2FS Library version 0.0"
|
||||
"EXT2FS Library version 0.5b"
|
||||
|
||||
ec EXT2_ET_MAGIC_EXT2FS_FILSYS,
|
||||
"Wrong magic number for ext2_filsys structure"
|
||||
|
||||
ec EXT2_ET_MAGIC_BADBLOCKS_LIST,
|
||||
"Wrong magic number for badblocks_list structure"
|
||||
|
||||
ec EXT2_ET_MAGIC_BADBLOCKS_ITERATE,
|
||||
"Wrong magic number for badblocks_iterate structure"
|
||||
|
||||
ec EXT2_ET_MAGIC_INODE_SCAN,
|
||||
"Wrong magic number for inode_scan structure"
|
||||
|
||||
ec EXT2_ET_MAGIC_IO_CHANNEL,
|
||||
"Wrong magic number for io_channel structure"
|
||||
|
||||
ec EXT2_ET_MAGIC_UNIX_IO_CHANNEL,
|
||||
"Wrong magic number for unix io_channel structure"
|
||||
|
||||
ec EXT2_ET_MAGIC_IO_MANAGER,
|
||||
"Wrong magic number for io_manager structure"
|
||||
|
||||
ec EXT2_ET_MAGIC_BLOCK_BITMAP,
|
||||
"Wrong magic number for block_bitmap structure"
|
||||
|
||||
ec EXT2_ET_MAGIC_INODE_BITMAP,
|
||||
"Wrong magic number for inode_bitmap structure"
|
||||
|
||||
ec EXT2_ET_MAGIC_RESERVED_1,
|
||||
"Wrong magic number --- RESERVED_1"
|
||||
|
||||
ec EXT2_ET_MAGIC_RESERVED_2,
|
||||
"Wrong magic number --- RESERVED_2"
|
||||
|
||||
ec EXT2_ET_MAGIC_RESERVED_3,
|
||||
"Wrong magic number --- RESERVED_3"
|
||||
|
||||
ec EXT2_ET_MAGIC_RESERVED_4,
|
||||
"Wrong magic number --- RESERVED_4"
|
||||
|
||||
ec EXT2_ET_MAGIC_RESERVED_5,
|
||||
"Wrong magic number --- RESERVED_5"
|
||||
|
||||
ec EXT2_ET_MAGIC_RESERVED_6,
|
||||
"Wrong magic number --- RESERVED_6"
|
||||
|
||||
ec EXT2_ET_MAGIC_RESERVED_7,
|
||||
"Wrong magic number --- RESERVED_7"
|
||||
|
||||
ec EXT2_ET_MAGIC_RESERVED_8,
|
||||
"Wrong magic number --- RESERVED_8"
|
||||
|
||||
ec EXT2_ET_MAGIC_RESERVED_9,
|
||||
"Wrong magic number --- RESERVED_9"
|
||||
|
||||
ec EXT2_ET_BAD_MAGIC,
|
||||
"Bad magic number in super-block"
|
||||
|
||||
ec EXT2_ET_REV_TOO_HIGH,
|
||||
"Filesystem revision too high"
|
||||
|
||||
ec EXT2_ET_SB_LSEEK,
|
||||
"Can't seek to superblock"
|
||||
|
||||
@ -91,5 +148,38 @@ ec EXT2_ET_EXPAND_DIR_ERR,
|
||||
ec EXT2_ET_TOOSMALL,
|
||||
"Not enough space to build proposed filesystem"
|
||||
|
||||
ec EXT2_ET_BAD_BLOCK_MARK,
|
||||
"Illegal block number passed to ext2fs_mark_block_bitmap"
|
||||
|
||||
ec EXT2_ET_BAD_BLOCK_UNMARK,
|
||||
"Illegal block number passed to ext2fs_unmark_block_bitmap"
|
||||
|
||||
ec EXT2_ET_BAD_BLOCK_TEST,
|
||||
"Illegal block number passed to ext2fs_test_block_bitmap"
|
||||
|
||||
ec EXT2_ET_BAD_INODE_MARK,
|
||||
"Illegal inode number passed to ext2fs_mark_inode_bitmap"
|
||||
|
||||
ec EXT2_ET_BAD_INODE_UNMARK,
|
||||
"Illegal inode number passed to ext2fs_unmark_inode_bitmap"
|
||||
|
||||
ec EXT2_ET_BAD_INODE_TEST,
|
||||
"Illegal inode number passed to ext2fs_test_inode_bitmap"
|
||||
|
||||
ec EXT2_ET_FUDGE_BLOCK_BITMAP_END,
|
||||
"Attempt to fudge end of block bitmap past the real end"
|
||||
|
||||
ec EXT2_ET_FUDGE_INODE_BITMAP_END,
|
||||
"Attempt to fudge end of inode bitmap past the real end"
|
||||
|
||||
ec EXT2_ET_BAD_IND_BLOCK,
|
||||
"Illegal indirect block found"
|
||||
|
||||
ec EXT2_ET_BAD_DIND_BLOCK,
|
||||
"Illegal doubly indirect block found"
|
||||
|
||||
ec EXT2_ET_BAD_TIND_BLOCK,
|
||||
"Illegal triply indirect block found"
|
||||
|
||||
end
|
||||
|
||||
|
@ -10,34 +10,64 @@
|
||||
#endif
|
||||
|
||||
#define EXT2_ET_BASE (2133571328L)
|
||||
#define EXT2_ET_BAD_MAGIC (2133571329L)
|
||||
#define EXT2_ET_SB_LSEEK (2133571330L)
|
||||
#define EXT2_ET_SB_READ (2133571331L)
|
||||
#define EXT2_ET_SB_WRITE (2133571332L)
|
||||
#define EXT2_ET_RO_FILSYS (2133571333L)
|
||||
#define EXT2_ET_GDESC_READ (2133571334L)
|
||||
#define EXT2_ET_GDESC_WRITE (2133571335L)
|
||||
#define EXT2_ET_GDESC_BAD_BLOCK_MAP (2133571336L)
|
||||
#define EXT2_ET_GDESC_BAD_INODE_MAP (2133571337L)
|
||||
#define EXT2_ET_GDESC_BAD_INODE_TABLE (2133571338L)
|
||||
#define EXT2_ET_INODE_BITMAP_WRITE (2133571339L)
|
||||
#define EXT2_ET_INODE_BITMAP_READ (2133571340L)
|
||||
#define EXT2_ET_BLOCK_BITMAP_WRITE (2133571341L)
|
||||
#define EXT2_ET_BLOCK_BITMAP_READ (2133571342L)
|
||||
#define EXT2_ET_INODE_TABLE_WRITE (2133571343L)
|
||||
#define EXT2_ET_INODE_TABLE_READ (2133571344L)
|
||||
#define EXT2_ET_NEXT_INODE_READ (2133571345L)
|
||||
#define EXT2_ET_UNEXPECTED_BLOCK_SIZE (2133571346L)
|
||||
#define EXT2_ET_DIR_CORRUPTED (2133571347L)
|
||||
#define EXT2_ET_SHORT_READ (2133571348L)
|
||||
#define EXT2_ET_SHORT_WRITE (2133571349L)
|
||||
#define EXT2_ET_DIR_NO_SPACE (2133571350L)
|
||||
#define EXT2_ET_NO_INODE_BITMAP (2133571351L)
|
||||
#define EXT2_ET_NO_BLOCK_BITMAP (2133571352L)
|
||||
#define EXT2_ET_BAD_INODE_NUM (2133571353L)
|
||||
#define EXT2_ET_BAD_BLOCK_NUM (2133571354L)
|
||||
#define EXT2_ET_EXPAND_DIR_ERR (2133571355L)
|
||||
#define EXT2_ET_TOOSMALL (2133571356L)
|
||||
#define EXT2_ET_MAGIC_EXT2FS_FILSYS (2133571329L)
|
||||
#define EXT2_ET_MAGIC_BADBLOCKS_LIST (2133571330L)
|
||||
#define EXT2_ET_MAGIC_BADBLOCKS_ITERATE (2133571331L)
|
||||
#define EXT2_ET_MAGIC_INODE_SCAN (2133571332L)
|
||||
#define EXT2_ET_MAGIC_IO_CHANNEL (2133571333L)
|
||||
#define EXT2_ET_MAGIC_UNIX_IO_CHANNEL (2133571334L)
|
||||
#define EXT2_ET_MAGIC_IO_MANAGER (2133571335L)
|
||||
#define EXT2_ET_MAGIC_BLOCK_BITMAP (2133571336L)
|
||||
#define EXT2_ET_MAGIC_INODE_BITMAP (2133571337L)
|
||||
#define EXT2_ET_MAGIC_RESERVED_1 (2133571338L)
|
||||
#define EXT2_ET_MAGIC_RESERVED_2 (2133571339L)
|
||||
#define EXT2_ET_MAGIC_RESERVED_3 (2133571340L)
|
||||
#define EXT2_ET_MAGIC_RESERVED_4 (2133571341L)
|
||||
#define EXT2_ET_MAGIC_RESERVED_5 (2133571342L)
|
||||
#define EXT2_ET_MAGIC_RESERVED_6 (2133571343L)
|
||||
#define EXT2_ET_MAGIC_RESERVED_7 (2133571344L)
|
||||
#define EXT2_ET_MAGIC_RESERVED_8 (2133571345L)
|
||||
#define EXT2_ET_MAGIC_RESERVED_9 (2133571346L)
|
||||
#define EXT2_ET_BAD_MAGIC (2133571347L)
|
||||
#define EXT2_ET_REV_TOO_HIGH (2133571348L)
|
||||
#define EXT2_ET_SB_LSEEK (2133571349L)
|
||||
#define EXT2_ET_SB_READ (2133571350L)
|
||||
#define EXT2_ET_SB_WRITE (2133571351L)
|
||||
#define EXT2_ET_RO_FILSYS (2133571352L)
|
||||
#define EXT2_ET_GDESC_READ (2133571353L)
|
||||
#define EXT2_ET_GDESC_WRITE (2133571354L)
|
||||
#define EXT2_ET_GDESC_BAD_BLOCK_MAP (2133571355L)
|
||||
#define EXT2_ET_GDESC_BAD_INODE_MAP (2133571356L)
|
||||
#define EXT2_ET_GDESC_BAD_INODE_TABLE (2133571357L)
|
||||
#define EXT2_ET_INODE_BITMAP_WRITE (2133571358L)
|
||||
#define EXT2_ET_INODE_BITMAP_READ (2133571359L)
|
||||
#define EXT2_ET_BLOCK_BITMAP_WRITE (2133571360L)
|
||||
#define EXT2_ET_BLOCK_BITMAP_READ (2133571361L)
|
||||
#define EXT2_ET_INODE_TABLE_WRITE (2133571362L)
|
||||
#define EXT2_ET_INODE_TABLE_READ (2133571363L)
|
||||
#define EXT2_ET_NEXT_INODE_READ (2133571364L)
|
||||
#define EXT2_ET_UNEXPECTED_BLOCK_SIZE (2133571365L)
|
||||
#define EXT2_ET_DIR_CORRUPTED (2133571366L)
|
||||
#define EXT2_ET_SHORT_READ (2133571367L)
|
||||
#define EXT2_ET_SHORT_WRITE (2133571368L)
|
||||
#define EXT2_ET_DIR_NO_SPACE (2133571369L)
|
||||
#define EXT2_ET_NO_INODE_BITMAP (2133571370L)
|
||||
#define EXT2_ET_NO_BLOCK_BITMAP (2133571371L)
|
||||
#define EXT2_ET_BAD_INODE_NUM (2133571372L)
|
||||
#define EXT2_ET_BAD_BLOCK_NUM (2133571373L)
|
||||
#define EXT2_ET_EXPAND_DIR_ERR (2133571374L)
|
||||
#define EXT2_ET_TOOSMALL (2133571375L)
|
||||
#define EXT2_ET_BAD_BLOCK_MARK (2133571376L)
|
||||
#define EXT2_ET_BAD_BLOCK_UNMARK (2133571377L)
|
||||
#define EXT2_ET_BAD_BLOCK_TEST (2133571378L)
|
||||
#define EXT2_ET_BAD_INODE_MARK (2133571379L)
|
||||
#define EXT2_ET_BAD_INODE_UNMARK (2133571380L)
|
||||
#define EXT2_ET_BAD_INODE_TEST (2133571381L)
|
||||
#define EXT2_ET_FUDGE_BLOCK_BITMAP_END (2133571382L)
|
||||
#define EXT2_ET_FUDGE_INODE_BITMAP_END (2133571383L)
|
||||
#define EXT2_ET_BAD_IND_BLOCK (2133571384L)
|
||||
#define EXT2_ET_BAD_DIND_BLOCK (2133571385L)
|
||||
#define EXT2_ET_BAD_TIND_BLOCK (2133571386L)
|
||||
extern void initialize_ext2_error_table (NOARGS);
|
||||
#define ERROR_TABLE_BASE_ext2 (2133571328L)
|
||||
|
||||
|
@ -15,6 +15,12 @@
|
||||
#define SUPERBLOCK_OFFSET 1024
|
||||
#define SUPERBLOCK_SIZE 1024
|
||||
|
||||
/*
|
||||
* The last ext2fs revision level that this version of the library is
|
||||
* able to support.
|
||||
*/
|
||||
#define EXT2_LIB_CURRENT_REV 0
|
||||
|
||||
typedef unsigned long blk_t;
|
||||
typedef unsigned int dgrp_t;
|
||||
|
||||
@ -22,6 +28,32 @@ typedef unsigned int dgrp_t;
|
||||
#include "ext2fs/io.h"
|
||||
#include "ext2fs/ext2_err.h"
|
||||
|
||||
typedef struct struct_ext2_filsys *ext2_filsys;
|
||||
|
||||
struct ext2fs_struct_inode_bitmap {
|
||||
int magic;
|
||||
ext2_filsys fs;
|
||||
ino_t start, end;
|
||||
ino_t real_end;
|
||||
char *description;
|
||||
char *bitmap;
|
||||
int reserved[8];
|
||||
};
|
||||
|
||||
typedef struct ext2fs_struct_inode_bitmap *ext2fs_inode_bitmap;
|
||||
|
||||
struct ext2fs_struct_block_bitmap {
|
||||
int magic;
|
||||
ext2_filsys fs;
|
||||
blk_t start, end;
|
||||
ino_t real_end;
|
||||
char *description;
|
||||
char *bitmap;
|
||||
int reserved[8];
|
||||
};
|
||||
|
||||
typedef struct ext2fs_struct_block_bitmap *ext2fs_block_bitmap;
|
||||
|
||||
/*
|
||||
* Flags for the ext2_filsys structure
|
||||
*/
|
||||
@ -33,9 +65,8 @@ typedef unsigned int dgrp_t;
|
||||
#define EXT2_FLAG_IB_DIRTY 0x10
|
||||
#define EXT2_FLAG_BB_DIRTY 0x20
|
||||
|
||||
typedef struct struct_ext2_filsys *ext2_filsys;
|
||||
|
||||
struct struct_ext2_filsys {
|
||||
int magic;
|
||||
io_channel io;
|
||||
int flags;
|
||||
char * device_name;
|
||||
@ -46,11 +77,12 @@ struct struct_ext2_filsys {
|
||||
unsigned long desc_blocks;
|
||||
struct ext2_group_desc * group_desc;
|
||||
int inode_blocks_per_group;
|
||||
char * inode_map;
|
||||
char * block_map;
|
||||
ext2fs_inode_bitmap inode_map;
|
||||
ext2fs_block_bitmap block_map;
|
||||
errcode_t (*get_blocks)(ext2_filsys fs, ino_t ino, blk_t *blocks);
|
||||
errcode_t (*check_directory)(ext2_filsys fs, ino_t ino);
|
||||
errcode_t (*write_bitmaps)(ext2_filsys fs);
|
||||
int reserved[16];
|
||||
|
||||
/*
|
||||
* Not used by ext2fs library; reserved for the use of the
|
||||
@ -66,10 +98,12 @@ struct struct_ext2_filsys {
|
||||
typedef struct struct_badblocks_list *badblocks_list;
|
||||
|
||||
struct struct_badblocks_list {
|
||||
int magic;
|
||||
int num;
|
||||
int size;
|
||||
blk_t *list;
|
||||
int badblocks_flags;
|
||||
int reserved[8];
|
||||
};
|
||||
|
||||
#define BADBLOCKS_FLAG_DIRTY 1
|
||||
@ -77,12 +111,14 @@ struct struct_badblocks_list {
|
||||
typedef struct struct_badblocks_iterate *badblocks_iterate;
|
||||
|
||||
struct struct_badblocks_iterate {
|
||||
int magic;
|
||||
badblocks_list bb;
|
||||
int ptr;
|
||||
int reserved[8];
|
||||
};
|
||||
|
||||
#include "ext2fs/bitops.h"
|
||||
|
||||
#include "ext2fs/bitops.h"
|
||||
|
||||
/*
|
||||
* Return flags for the block iterator functions
|
||||
*/
|
||||
@ -112,7 +148,10 @@ struct struct_badblocks_iterate {
|
||||
/*
|
||||
* Inode scan definitions
|
||||
*/
|
||||
typedef struct ext2_struct_inode_scan *ext2_inode_scan;
|
||||
|
||||
struct ext2_struct_inode_scan {
|
||||
int magic;
|
||||
ext2_filsys fs;
|
||||
ino_t current_inode;
|
||||
blk_t current_block;
|
||||
@ -121,21 +160,33 @@ struct ext2_struct_inode_scan {
|
||||
int inode_buffer_blocks;
|
||||
char * inode_buffer;
|
||||
struct ext2_inode * inode_scan_ptr;
|
||||
errcode_t (*done_group)(ext2_filsys fs,
|
||||
ext2_inode_scan scan,
|
||||
dgrp_t group,
|
||||
void * private);
|
||||
void * done_group_data;
|
||||
int reserved[8];
|
||||
};
|
||||
|
||||
typedef struct ext2_struct_inode_scan *ext2_inode_scan;
|
||||
/*
|
||||
* For checking structure magic numbers...
|
||||
*/
|
||||
|
||||
#define EXT2_CHECK_MAGIC(struct, code) \
|
||||
if ((struct)->magic != (code)) return (code)
|
||||
|
||||
/*
|
||||
* function prototypes
|
||||
*/
|
||||
|
||||
/* alloc.c */
|
||||
extern errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode,
|
||||
char *map, ino_t *ret);
|
||||
ext2fs_inode_bitmap map, ino_t *ret);
|
||||
extern errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal,
|
||||
char *map, blk_t *ret);
|
||||
ext2fs_block_bitmap map, blk_t *ret);
|
||||
extern errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start,
|
||||
blk_t finish, int num, char *map,
|
||||
blk_t finish, int num,
|
||||
ext2fs_block_bitmap map,
|
||||
blk_t *ret);
|
||||
|
||||
/* badblocks.c */
|
||||
@ -157,8 +208,20 @@ extern errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs);
|
||||
extern errcode_t ext2fs_write_block_bitmap (ext2_filsys fs);
|
||||
extern errcode_t ext2fs_read_inode_bitmap (ext2_filsys fs);
|
||||
extern errcode_t ext2fs_read_block_bitmap(ext2_filsys fs);
|
||||
extern errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs, char **ret);
|
||||
extern errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs, char **ret);
|
||||
errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs,
|
||||
const char *descr,
|
||||
ext2fs_block_bitmap *ret);
|
||||
errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs,
|
||||
const char *descr,
|
||||
ext2fs_inode_bitmap *ret);
|
||||
errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap,
|
||||
ino_t end, ino_t *oend);
|
||||
errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap,
|
||||
blk_t end, blk_t *oend);
|
||||
void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap);
|
||||
void ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap);
|
||||
void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap);
|
||||
void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap);
|
||||
extern errcode_t ext2fs_read_bitmaps(ext2_filsys fs);
|
||||
extern errcode_t ext2fs_write_bitmaps(ext2_filsys fs);
|
||||
|
||||
@ -173,6 +236,9 @@ extern errcode_t ext2fs_block_iterate(ext2_filsys fs,
|
||||
void *private),
|
||||
void *private);
|
||||
|
||||
/* check_desc.c */
|
||||
extern errcode_t ext2fs_check_desc(ext2_filsys fs);
|
||||
|
||||
/* closefs.c */
|
||||
extern errcode_t ext2fs_close(ext2_filsys fs);
|
||||
extern errcode_t ext2fs_flush(ext2_filsys fs);
|
||||
@ -194,6 +260,18 @@ extern errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks,
|
||||
extern void ext2fs_close_inode_scan(ext2_inode_scan scan);
|
||||
extern errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ino_t *ino,
|
||||
struct ext2_inode *inode);
|
||||
void ext2fs_set_inode_callback(ext2_inode_scan scan,
|
||||
errcode_t (*done_group)(ext2_filsys fs,
|
||||
ext2_inode_scan scan,
|
||||
dgrp_t group,
|
||||
void * private),
|
||||
void *done_group_data);
|
||||
void ext2fs_set_inode_callback(ext2_inode_scan scan,
|
||||
errcode_t (*done_group)(ext2_filsys fs,
|
||||
ext2_inode_scan scan,
|
||||
dgrp_t group,
|
||||
void * private),
|
||||
void *done_group_data);
|
||||
extern errcode_t ext2fs_read_inode (ext2_filsys fs, unsigned long ino,
|
||||
struct ext2_inode * inode);
|
||||
extern errcode_t ext2fs_write_inode(ext2_filsys fs, unsigned long ino,
|
||||
@ -229,7 +307,6 @@ extern errcode_t ext2fs_mkdir(ext2_filsys fs, ino_t parent, ino_t inum,
|
||||
extern errcode_t ext2fs_open(const char *name, int flags, int superblock,
|
||||
int block_size, io_manager manager,
|
||||
ext2_filsys *ret_fs);
|
||||
extern errcode_t ext2fs_check_desc(ext2_filsys fs);
|
||||
|
||||
/* get_pathname.c */
|
||||
extern errcode_t ext2fs_get_pathname(ext2_filsys fs, ino_t dir, ino_t ino,
|
||||
|
@ -9,14 +9,13 @@
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
|
||||
void ext2fs_free(ext2_filsys fs)
|
||||
{
|
||||
if (!fs)
|
||||
if (!fs || (fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS))
|
||||
return;
|
||||
if (fs->io) {
|
||||
io_channel_close(fs->io);
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -92,7 +92,11 @@ static errcode_t ext2fs_get_pathname_int(ext2_filsys fs, ino_t dir, ino_t ino,
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = malloc(strlen(parent_name)+strlen(gp.name)+2);
|
||||
if (gp.name)
|
||||
ret = malloc(strlen(parent_name)+strlen(gp.name)+2);
|
||||
else
|
||||
ret = malloc(strlen(parent_name)+5); /* strlen("???") + 2 */
|
||||
|
||||
if (!ret) {
|
||||
retval = ENOMEM;
|
||||
goto cleanup;
|
||||
@ -121,6 +125,8 @@ errcode_t ext2fs_get_pathname(ext2_filsys fs, ino_t dir, ino_t ino,
|
||||
char *buf;
|
||||
errcode_t retval;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
buf = malloc(fs->blocksize);
|
||||
if (!buf)
|
||||
return ENOMEM;
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -29,6 +28,8 @@ errcode_t ext2fs_initialize(const char *name, int flags,
|
||||
int overhead = 0;
|
||||
blk_t group_block;
|
||||
int i, j;
|
||||
int numblocks;
|
||||
char *buf;
|
||||
|
||||
if (!param || !param->s_blocks_count)
|
||||
return EINVAL;
|
||||
@ -38,6 +39,7 @@ errcode_t ext2fs_initialize(const char *name, int flags,
|
||||
return ENOMEM;
|
||||
|
||||
memset(fs, 0, sizeof(struct struct_ext2_filsys));
|
||||
fs->magic = EXT2_ET_MAGIC_EXT2FS_FILSYS;
|
||||
fs->flags = flags | EXT2_FLAG_RW;
|
||||
retval = manager->open(name, IO_FLAG_RW, &fs->io);
|
||||
if (retval)
|
||||
@ -70,6 +72,10 @@ errcode_t ext2fs_initialize(const char *name, int flags,
|
||||
set_field(s_checkinterval, EXT2_DFL_CHECKINTERVAL);
|
||||
super->s_lastcheck = time(NULL);
|
||||
|
||||
#ifdef EXT2_OS_LINUX
|
||||
super->s_creator_os = EXT2_OS_LINUX;
|
||||
#endif
|
||||
|
||||
fs->blocksize = EXT2_BLOCK_SIZE(super);
|
||||
fs->fragsize = EXT2_FRAG_SIZE(super);
|
||||
frags_per_block = fs->blocksize / fs->fragsize;
|
||||
@ -78,10 +84,13 @@ errcode_t ext2fs_initialize(const char *name, int flags,
|
||||
super->s_frags_per_group = super->s_blocks_per_group * frags_per_block;
|
||||
|
||||
super->s_blocks_count = param->s_blocks_count;
|
||||
super->s_r_blocks_count = param->s_r_blocks_count;
|
||||
if (super->s_r_blocks_count >= param->s_blocks_count) {
|
||||
retval = EINVAL;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
retry:
|
||||
set_field(s_r_blocks_count, super->s_blocks_count/20); /* 5% default */
|
||||
|
||||
fs->group_desc_count = (super->s_blocks_count -
|
||||
super->s_first_data_block +
|
||||
EXT2_BLOCKS_PER_GROUP(super) - 1)
|
||||
@ -149,14 +158,24 @@ retry:
|
||||
* count.
|
||||
*/
|
||||
|
||||
retval = ext2fs_allocate_block_bitmap(fs, &fs->block_map);
|
||||
buf = malloc(strlen(fs->device_name) + 80);
|
||||
if (!buf) {
|
||||
retval = ENOMEM;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
sprintf(buf, "block bitmap for %s", fs->device_name);
|
||||
retval = ext2fs_allocate_block_bitmap(fs, buf, &fs->block_map);
|
||||
if (retval)
|
||||
goto cleanup;
|
||||
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, &fs->inode_map);
|
||||
sprintf(buf, "inode bitmap for %s", fs->device_name);
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, 0, &fs->inode_map);
|
||||
if (retval)
|
||||
goto cleanup;
|
||||
|
||||
free(buf);
|
||||
|
||||
fs->group_desc = malloc(fs->desc_blocks * fs->blocksize);
|
||||
if (!fs->group_desc) {
|
||||
retval = ENOMEM;
|
||||
@ -164,11 +183,34 @@ retry:
|
||||
}
|
||||
memset(fs->group_desc, 0, fs->desc_blocks * fs->blocksize);
|
||||
|
||||
/*
|
||||
* Reserve the superblock and group descriptors for each
|
||||
* group, and fill in the correct group statistics for group.
|
||||
* Note that although the block bitmap, inode bitmap, and
|
||||
* inode table have not been allocated (and in fact won't be
|
||||
* by this routine), they are accounted for nevertheless.
|
||||
*/
|
||||
group_block = super->s_first_data_block;
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
for (j=0; j < fs->desc_blocks+1; j++)
|
||||
ext2fs_mark_block_bitmap(fs, fs->block_map,
|
||||
ext2fs_mark_block_bitmap(fs->block_map,
|
||||
group_block + j);
|
||||
|
||||
if (i == fs->group_desc_count-1) {
|
||||
numblocks = (fs->super->s_blocks_count -
|
||||
fs->super->s_first_data_block) %
|
||||
fs->super->s_blocks_per_group;
|
||||
if (!numblocks)
|
||||
numblocks = fs->super->s_blocks_per_group;
|
||||
} else
|
||||
numblocks = fs->super->s_blocks_per_group;
|
||||
numblocks -= 3 + fs->desc_blocks + fs->inode_blocks_per_group;
|
||||
|
||||
fs->group_desc[i].bg_free_blocks_count = numblocks;
|
||||
fs->group_desc[i].bg_free_inodes_count =
|
||||
fs->super->s_inodes_per_group;
|
||||
fs->group_desc[i].bg_used_dirs_count = 0;
|
||||
|
||||
group_block += super->s_blocks_per_group;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#define INCLUDE_INLINE_FUNCS
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -22,16 +21,21 @@ errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks,
|
||||
{
|
||||
ext2_inode_scan scan;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
scan = (ext2_inode_scan) malloc(sizeof(struct ext2_struct_inode_scan));
|
||||
if (!scan)
|
||||
return ENOMEM;
|
||||
memset(scan, 0, sizeof(struct ext2_struct_inode_scan));
|
||||
|
||||
scan->magic = EXT2_ET_MAGIC_INODE_SCAN;
|
||||
scan->fs = fs;
|
||||
scan->current_group = -1;
|
||||
scan->inode_buffer_blocks = buffer_blocks ? buffer_blocks : 8;
|
||||
scan->groups_left = fs->group_desc_count;
|
||||
scan->inode_buffer = malloc(scan->inode_buffer_blocks * fs->blocksize);
|
||||
scan->done_group = 0;
|
||||
scan->done_group_data = 0;
|
||||
if (!scan->inode_buffer) {
|
||||
free(scan);
|
||||
return ENOMEM;
|
||||
@ -42,33 +46,63 @@ errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks,
|
||||
|
||||
void ext2fs_close_inode_scan(ext2_inode_scan scan)
|
||||
{
|
||||
if (!scan || (scan->magic != EXT2_ET_MAGIC_INODE_SCAN))
|
||||
return;
|
||||
|
||||
free(scan->inode_buffer);
|
||||
scan->inode_buffer = NULL;
|
||||
free(scan);
|
||||
return;
|
||||
}
|
||||
|
||||
void ext2fs_set_inode_callback(ext2_inode_scan scan,
|
||||
errcode_t (*done_group)(ext2_filsys fs,
|
||||
ext2_inode_scan scan,
|
||||
dgrp_t group,
|
||||
void * private),
|
||||
void *done_group_data)
|
||||
{
|
||||
if (!scan || (scan->magic != EXT2_ET_MAGIC_INODE_SCAN))
|
||||
return;
|
||||
|
||||
scan->done_group = done_group;
|
||||
scan->done_group_data = done_group_data;
|
||||
}
|
||||
|
||||
errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ino_t *ino,
|
||||
struct ext2_inode *inode)
|
||||
{
|
||||
errcode_t retval;
|
||||
int num_blocks;
|
||||
|
||||
EXT2_CHECK_MAGIC(scan, EXT2_ET_MAGIC_INODE_SCAN);
|
||||
|
||||
if (!scan->inode_buffer)
|
||||
return EINVAL;
|
||||
|
||||
if (scan->inodes_left <= 0) {
|
||||
if (scan->blocks_left <= 0) {
|
||||
if (scan->groups_left <= 0) {
|
||||
*ino = 0;
|
||||
return 0;
|
||||
if (scan->done_group) {
|
||||
retval = (scan->done_group)
|
||||
(scan->fs, scan,
|
||||
scan->current_group,
|
||||
scan->done_group_data);
|
||||
if (retval)
|
||||
return retval;
|
||||
}
|
||||
scan->current_group++;
|
||||
scan->groups_left--;
|
||||
do {
|
||||
if (scan->groups_left <= 0) {
|
||||
*ino = 0;
|
||||
return 0;
|
||||
}
|
||||
scan->current_group++;
|
||||
scan->groups_left--;
|
||||
|
||||
scan->current_block = scan->fs->group_desc[scan->current_group].bg_inode_table;
|
||||
scan->blocks_left = (EXT2_INODES_PER_GROUP(scan->fs->super) /
|
||||
EXT2_INODES_PER_BLOCK(scan->fs->super));
|
||||
scan->current_block =
|
||||
scan->fs->group_desc[scan->current_group].bg_inode_table;
|
||||
scan->blocks_left = (EXT2_INODES_PER_GROUP(scan->fs->super) /
|
||||
EXT2_INODES_PER_BLOCK(scan->fs->super));
|
||||
} while (scan->current_block == 0);
|
||||
} else {
|
||||
scan->current_block += scan->inode_buffer_blocks;
|
||||
}
|
||||
@ -109,6 +143,8 @@ errcode_t ext2fs_read_inode (ext2_filsys fs, unsigned long ino,
|
||||
errcode_t retval;
|
||||
int i;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (ino > fs->super->s_inodes_count)
|
||||
return EXT2_ET_BAD_INODE_NUM;
|
||||
if (inode_buffer_size != fs->blocksize) {
|
||||
@ -149,6 +185,8 @@ errcode_t ext2fs_write_inode(ext2_filsys fs, unsigned long ino,
|
||||
errcode_t retval;
|
||||
int i;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!(fs->flags & EXT2_FLAG_RW))
|
||||
return EXT2_ET_RO_FILSYS;
|
||||
|
||||
@ -194,6 +232,8 @@ errcode_t ext2fs_get_blocks(ext2_filsys fs, ino_t ino, blk_t *blocks)
|
||||
int i;
|
||||
errcode_t retval;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (ino > fs->super->s_inodes_count)
|
||||
return EXT2_ET_BAD_INODE_NUM;
|
||||
|
||||
@ -214,6 +254,8 @@ errcode_t ext2fs_check_directory(ext2_filsys fs, ino_t ino)
|
||||
struct ext2_inode inode;
|
||||
errcode_t retval;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (ino > fs->super->s_inodes_count)
|
||||
return EXT2_ET_BAD_INODE_NUM;
|
||||
|
||||
|
@ -5,10 +5,23 @@
|
||||
* under the terms of the GNU Public License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ext2_loff_t is defined here since unix_io.c needs it.
|
||||
*/
|
||||
#if defined(__GNUC__) || defined(HAS_LONG_LONG)
|
||||
typedef long long ext2_loff_t;
|
||||
#else
|
||||
typedef long ext2_loff_t;
|
||||
#endif
|
||||
|
||||
/* llseek.c */
|
||||
ext2_loff_t ext2_llseek (unsigned int, ext2_loff_t, unsigned int);
|
||||
|
||||
typedef struct struct_io_manager *io_manager;
|
||||
typedef struct struct_io_channel *io_channel;
|
||||
|
||||
struct struct_io_channel {
|
||||
int magic;
|
||||
io_manager manager;
|
||||
char *name;
|
||||
int block_size;
|
||||
@ -26,10 +39,12 @@ struct struct_io_channel {
|
||||
size_t size,
|
||||
int actual_bytes_written,
|
||||
errcode_t error);
|
||||
int reserved[16];
|
||||
void *private_data;
|
||||
};
|
||||
|
||||
struct struct_io_manager {
|
||||
int magic;
|
||||
const char *name;
|
||||
errcode_t (*open)(const char *name, int flags, io_channel *channel);
|
||||
errcode_t (*close)(io_channel channel);
|
||||
@ -39,6 +54,7 @@ struct struct_io_manager {
|
||||
errcode_t (*write_blk)(io_channel channel, unsigned long block,
|
||||
int count, const void *data);
|
||||
errcode_t (*flush)(io_channel channel);
|
||||
int reserved[16];
|
||||
};
|
||||
|
||||
#define IO_FLAG_RW 1
|
||||
|
75
lib/ext2fs/jump/jump.funcs
Normal file
75
lib/ext2fs/jump/jump.funcs
Normal file
@ -0,0 +1,75 @@
|
||||
00000000 T _ext2fs_open libext2fs openfs
|
||||
00000000 T _ext2fs_check_desc libext2fs openfs
|
||||
00000000 T _ext2fs_free libext2fs freefs
|
||||
00000000 T _ext2fs_flush libext2fs closefs
|
||||
00000000 T _ext2fs_close libext2fs closefs
|
||||
00000000 T _ext2fs_allocate_inode_bitmap libext2fs bitmaps
|
||||
00000000 T _ext2fs_allocate_block_bitmap libext2fs bitmaps
|
||||
00000000 T _ext2fs_free_inode_bitmap libext2fs bitmaps
|
||||
00000000 T _ext2fs_free_block_bitmap libext2fs bitmaps
|
||||
00000000 T _ext2fs_fudge_inode_bitmap_end libext2fs bitmaps
|
||||
00000000 T _ext2fs_fudge_block_bitmap_end libext2fs bitmaps
|
||||
00000000 T _ext2fs_clear_inode_bitmap libext2fs bitmaps
|
||||
00000000 T _ext2fs_clear_block_bitmap libext2fs bitmaps
|
||||
00000000 T _ext2fs_write_inode_bitmap libext2fs rw_bitmaps
|
||||
00000000 T _ext2fs_write_block_bitmap libext2fs rw_bitmaps
|
||||
00000000 T _ext2fs_read_inode_bitmap libext2fs rw_bitmaps
|
||||
00000000 T _ext2fs_read_block_bitmap libext2fs rw_bitmaps
|
||||
00000000 T _ext2fs_read_bitmaps libext2fs rw_bitmaps
|
||||
00000000 T _ext2fs_write_bitmaps libext2fs rw_bitmaps
|
||||
00000000 T _ext2fs_open_inode_scan libext2fs inode
|
||||
00000000 T _ext2fs_close_inode_scan libext2fs inode
|
||||
00000000 T _ext2fs_get_next_inode libext2fs inode
|
||||
00000000 T _ext2fs_read_inode libext2fs inode
|
||||
00000000 T _ext2fs_write_inode libext2fs inode
|
||||
00000000 T _ext2fs_get_blocks libext2fs inode
|
||||
00000000 T _ext2fs_check_directory libext2fs inode
|
||||
00000000 T _ext2fs_block_iterate libext2fs block
|
||||
00000000 T _ext2fs_dir_iterate libext2fs namei
|
||||
00000000 T _ext2fs_lookup libext2fs namei
|
||||
00000000 T _ext2fs_namei libext2fs namei
|
||||
00000000 T _ext2fs_new_dir_block libext2fs newdir
|
||||
00000000 T _ext2fs_mkdir libext2fs mkdir
|
||||
00000000 T _ext2fs_get_pathname libext2fs get_pathname
|
||||
00000000 T _ext2fs_warn_bitmap libext2fs bitops
|
||||
00000000 T _ext2fs_link libext2fs link
|
||||
00000000 T _ext2fs_unlink libext2fs link
|
||||
00000000 T _ext2fs_new_inode libext2fs alloc
|
||||
00000000 T _ext2fs_new_block libext2fs alloc
|
||||
00000000 T _ext2fs_get_free_blocks libext2fs alloc
|
||||
00000000 T _ext2fs_expand_dir libext2fs expanddir
|
||||
00000000 T _set_bit libext2fs inline
|
||||
00000000 T _clear_bit libext2fs inline
|
||||
00000000 T _test_bit libext2fs inline
|
||||
00000000 T _ext2fs_mark_block_bitmap libext2fs inline
|
||||
00000000 T _ext2fs_unmark_block_bitmap libext2fs inline
|
||||
00000000 T _ext2fs_test_block_bitmap libext2fs inline
|
||||
00000000 T _ext2fs_mark_inode_bitmap libext2fs inline
|
||||
00000000 T _ext2fs_unmark_inode_bitmap libext2fs inline
|
||||
00000000 T _ext2fs_test_inode_bitmap libext2fs inline
|
||||
00000000 T _ext2fs_mark_super_dirty libext2fs inline
|
||||
00000000 T _ext2fs_mark_changed libext2fs inline
|
||||
00000000 T _ext2fs_test_changed libext2fs inline
|
||||
00000000 T _ext2fs_mark_valid libext2fs inline
|
||||
00000000 T _ext2fs_unmark_valid libext2fs inline
|
||||
00000000 T _ext2fs_test_valid libext2fs inline
|
||||
00000000 T _ext2fs_mark_ib_dirty libext2fs inline
|
||||
00000000 T _ext2fs_mark_bb_dirty libext2fs inline
|
||||
00000000 T _ext2fs_test_ib_dirty libext2fs inline
|
||||
00000000 T _ext2fs_test_bb_dirty libext2fs inline
|
||||
00000000 T _ext2fs_group_of_blk libext2fs inline
|
||||
00000000 T _ext2fs_group_of_ino libext2fs inline
|
||||
00000000 T _ext2fs_initialize libext2fs initialize
|
||||
00000000 T _badblocks_list_create libext2fs badblocks
|
||||
00000000 T _badblocks_list_free libext2fs badblocks
|
||||
00000000 T _badblocks_list_add libext2fs badblocks
|
||||
00000000 T _badblocks_list_test libext2fs badblocks
|
||||
00000000 T _badblocks_list_iterate_begin libext2fs badblocks
|
||||
00000000 T _badblocks_list_iterate libext2fs badblocks
|
||||
00000000 T _badblocks_list_iterate_end libext2fs badblocks
|
||||
00000000 T _ext2fs_read_bb_inode libext2fs read_bb
|
||||
00000000 T _ext2fs_update_bb_inode libext2fs bb_inode
|
||||
00000000 T _ext2fs_read_bb_FILE libext2fs read_bb_file
|
||||
00000000 T _initialize_ext2_error_table libext2fs ext2_err
|
||||
00000000 T _ext2_llseek libext2fs llseek
|
||||
00000000 T _ext2fs_set_inode_callback libext2fs inode
|
166
lib/ext2fs/jump/jump.import
Normal file
166
lib/ext2fs/jump/jump.import
Normal file
@ -0,0 +1,166 @@
|
||||
00000004 D __et_list libcom_err jump/error_message
|
||||
00000004 D _com_err_hook libcom_err jump/com_err
|
||||
/usr/lib/libc.sa(__libc.o):00001000 a __GOT_SIZE
|
||||
/usr/lib/libc.sa(__libc.o):6008f0b0 A _AL
|
||||
/usr/lib/libc.sa(__libc.o):6008f198 A _AL_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f060 A _AM
|
||||
/usr/lib/libc.sa(__libc.o):6008f0b4 A _BC
|
||||
/usr/lib/libc.sa(__libc.o):6008f064 A _BS
|
||||
/usr/lib/libc.sa(__libc.o):6008f0bc A _BT
|
||||
/usr/lib/libc.sa(__libc.o):6008f068 A _CA
|
||||
/usr/lib/libc.sa(__libc.o):6008f0c0 A _CD
|
||||
/usr/lib/libc.sa(__libc.o):6008f0c4 A _CE
|
||||
/usr/lib/libc.sa(__libc.o):6008f0c8 A _CL
|
||||
/usr/lib/libc.sa(__libc.o):6008f0cc A _CM
|
||||
/usr/lib/libc.sa(__libc.o):6008f048 A _COLS
|
||||
/usr/lib/libc.sa(__libc.o):6008f0d0 A _CR
|
||||
/usr/lib/libc.sa(__libc.o):6008f0d4 A _CS
|
||||
/usr/lib/libc.sa(__libc.o):6008f06c A _DA
|
||||
/usr/lib/libc.sa(__libc.o):6008f070 A _DB
|
||||
/usr/lib/libc.sa(__libc.o):6008f0d8 A _DC
|
||||
/usr/lib/libc.sa(__libc.o):6008f0dc A _DL
|
||||
/usr/lib/libc.sa(__libc.o):6008f19c A _DL_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f0e0 A _DM
|
||||
/usr/lib/libc.sa(__libc.o):6008f0e4 A _DO
|
||||
/usr/lib/libc.sa(__libc.o):6008f1a4 A _DOWN_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f03c A _Def_term
|
||||
/usr/lib/libc.sa(__libc.o):6008f0e8 A _ED
|
||||
/usr/lib/libc.sa(__libc.o):6008f0ec A _EI
|
||||
/usr/lib/libc.sa(__libc.o):6008f074 A _EO
|
||||
/usr/lib/libc.sa(__libc.o):6008f1b8 A _GT
|
||||
/usr/lib/libc.sa(__libc.o):6008f078 A _HC
|
||||
/usr/lib/libc.sa(__libc.o):6008f118 A _HO
|
||||
/usr/lib/libc.sa(__libc.o):6008f07c A _HZ
|
||||
/usr/lib/libc.sa(__libc.o):6008f11c A _IC
|
||||
/usr/lib/libc.sa(__libc.o):6008f120 A _IM
|
||||
/usr/lib/libc.sa(__libc.o):6008f080 A _IN
|
||||
/usr/lib/libc.sa(__libc.o):6008f124 A _IP
|
||||
/usr/lib/libc.sa(__libc.o):6008f0f0 A _K0
|
||||
/usr/lib/libc.sa(__libc.o):6008f0f4 A _K1
|
||||
/usr/lib/libc.sa(__libc.o):6008f0f8 A _K2
|
||||
/usr/lib/libc.sa(__libc.o):6008f0fc A _K3
|
||||
/usr/lib/libc.sa(__libc.o):6008f100 A _K4
|
||||
/usr/lib/libc.sa(__libc.o):6008f104 A _K5
|
||||
/usr/lib/libc.sa(__libc.o):6008f108 A _K6
|
||||
/usr/lib/libc.sa(__libc.o):6008f10c A _K7
|
||||
/usr/lib/libc.sa(__libc.o):6008f110 A _K8
|
||||
/usr/lib/libc.sa(__libc.o):6008f114 A _K9
|
||||
/usr/lib/libc.sa(__libc.o):6008f128 A _KD
|
||||
/usr/lib/libc.sa(__libc.o):6008f12c A _KE
|
||||
/usr/lib/libc.sa(__libc.o):6008f130 A _KH
|
||||
/usr/lib/libc.sa(__libc.o):6008f134 A _KL
|
||||
/usr/lib/libc.sa(__libc.o):6008f138 A _KR
|
||||
/usr/lib/libc.sa(__libc.o):6008f13c A _KS
|
||||
/usr/lib/libc.sa(__libc.o):6008f140 A _KU
|
||||
/usr/lib/libc.sa(__libc.o):6008f1a8 A _LEFT_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f044 A _LINES
|
||||
/usr/lib/libc.sa(__libc.o):6008f144 A _LL
|
||||
/usr/lib/libc.sa(__libc.o):6008f148 A _MA
|
||||
/usr/lib/libc.sa(__libc.o):6008f300 A _MCAppPath
|
||||
/usr/lib/libc.sa(__libc.o):6008f084 A _MI
|
||||
/usr/lib/libc.sa(__libc.o):6008f088 A _MS
|
||||
/usr/lib/libc.sa(__libc.o):6008f030 A _My_term
|
||||
/usr/lib/libc.sa(__libc.o):6008f08c A _NC
|
||||
/usr/lib/libc.sa(__libc.o):6008f14c A _ND
|
||||
/usr/lib/libc.sa(__libc.o):6008f150 A _NL
|
||||
/usr/lib/libc.sa(__libc.o):6008f1bc A _NONL
|
||||
/usr/lib/libc.sa(__libc.o):6008f090 A _NS
|
||||
/usr/lib/libc.sa(__libc.o):6008f094 A _OS
|
||||
/usr/lib/libc.sa(__libc.o):6008f1b0 A _PC
|
||||
/usr/lib/libc.sa(__libc.o):6008f154 A _RC
|
||||
/usr/lib/libc.sa(__libc.o):6008f1ac A _RIGHT_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f158 A _SC
|
||||
/usr/lib/libc.sa(__libc.o):6008f15c A _SE
|
||||
/usr/lib/libc.sa(__libc.o):6008f160 A _SF
|
||||
/usr/lib/libc.sa(__libc.o):6008f164 A _SO
|
||||
/usr/lib/libc.sa(__libc.o):6008f168 A _SR
|
||||
/usr/lib/libc.sa(__libc.o):6008f16c A _TA
|
||||
/usr/lib/libc.sa(__libc.o):6008f170 A _TE
|
||||
/usr/lib/libc.sa(__libc.o):6008f174 A _TI
|
||||
/usr/lib/libc.sa(__libc.o):6008f178 A _UC
|
||||
/usr/lib/libc.sa(__libc.o):6008f17c A _UE
|
||||
/usr/lib/libc.sa(__libc.o):6008f098 A _UL
|
||||
/usr/lib/libc.sa(__libc.o):6008f180 A _UP
|
||||
/usr/lib/libc.sa(__libc.o):6008f1c0 A _UPPERCASE
|
||||
/usr/lib/libc.sa(__libc.o):6008f1a0 A _UP_PARM
|
||||
/usr/lib/libc.sa(__libc.o):6008f188 A _US
|
||||
/usr/lib/libc.sa(__libc.o):6008f18c A _VB
|
||||
/usr/lib/libc.sa(__libc.o):6008f194 A _VE
|
||||
/usr/lib/libc.sa(__libc.o):6008f190 A _VS
|
||||
/usr/lib/libc.sa(__libc.o):6008f09c A _XB
|
||||
/usr/lib/libc.sa(__libc.o):6008f0a0 A _XN
|
||||
/usr/lib/libc.sa(__libc.o):6008f0a8 A _XS
|
||||
/usr/lib/libc.sa(__libc.o):6008f0a4 A _XT
|
||||
/usr/lib/libc.sa(__libc.o):6008f0ac A _XX
|
||||
/usr/lib/libc.sa(__libc.o):6008f2a4 A __IO_file_jumps
|
||||
/usr/lib/libc.sa(__libc.o):6008f1f4 A __IO_list_all
|
||||
/usr/lib/libc.sa(__libc.o):6008f2a8 A __IO_proc_jumps
|
||||
/usr/lib/libc.sa(__libc.o):6008f1ec A __IO_stderr_
|
||||
/usr/lib/libc.sa(__libc.o):6008f1e4 A __IO_stdin_
|
||||
/usr/lib/libc.sa(__libc.o):6008f1e8 A __IO_stdout_
|
||||
/usr/lib/libc.sa(__libc.o):6008f2ac A __IO_str_jumps
|
||||
/usr/lib/libc.sa(__libc.o):6008f214 A ____brk_addr
|
||||
/usr/lib/libc.sa(__libc.o):6008f01c A ___ctype_b
|
||||
/usr/lib/libc.sa(__libc.o):6008f020 A ___ctype_tolower
|
||||
/usr/lib/libc.sa(__libc.o):6008f024 A ___ctype_toupper
|
||||
/usr/lib/libc.sa(__libc.o):6008f1fc A ___environ
|
||||
/usr/lib/libc.sa(__libc.o):6008f250 A ___exit_funcs
|
||||
/usr/lib/libc.sa(__libc.o):6008f2f0 A ___glob_closedir_hook
|
||||
/usr/lib/libc.sa(__libc.o):6008f2f4 A ___glob_opendir_hook
|
||||
/usr/lib/libc.sa(__libc.o):6008f2f8 A ___glob_readdir_hook
|
||||
/usr/lib/libc.sa(__libc.o):6008f278 A ___ttyname
|
||||
/usr/lib/libc.sa(__libc.o):6008f238 A __collate_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f23c A __ctype_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f028 A __echoit
|
||||
/usr/lib/libc.sa(__libc.o):6008f034 A __endwin
|
||||
/usr/lib/libc.sa(__libc.o):6008f288 A __gdbm_fetch_val
|
||||
/usr/lib/libc.sa(__libc.o):6008f280 A __gdbm_file
|
||||
/usr/lib/libc.sa(__libc.o):6008f284 A __gdbm_memory
|
||||
/usr/lib/libc.sa(__libc.o):6008f240 A __monetary_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f234 A __null_auth
|
||||
/usr/lib/libc.sa(__libc.o):6008f244 A __numeric_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f2ec A __obstack
|
||||
/usr/lib/libc.sa(__libc.o):6008f1c8 A __pfast
|
||||
/usr/lib/libc.sa(__libc.o):6008f02c A __rawmode
|
||||
/usr/lib/libc.sa(__libc.o):6008f1dc A __res
|
||||
/usr/lib/libc.sa(__libc.o):6008f04c A __res_iflg
|
||||
/usr/lib/libc.sa(__libc.o):6008f050 A __res_lflg
|
||||
/usr/lib/libc.sa(__libc.o):6008f270 A __res_opcodes
|
||||
/usr/lib/libc.sa(__libc.o):6008f274 A __res_resultcodes
|
||||
/usr/lib/libc.sa(__libc.o):6008f248 A __response_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f2fc A __sigintr
|
||||
/usr/lib/libc.sa(__libc.o):6008f00c A __sys_errlist
|
||||
/usr/lib/libc.sa(__libc.o):6008f010 A __sys_nerr
|
||||
/usr/lib/libc.sa(__libc.o):6008f014 A __sys_siglist
|
||||
/usr/lib/libc.sa(__libc.o):6008f24c A __time_info
|
||||
/usr/lib/libc.sa(__libc.o):6008f05c A __tty
|
||||
/usr/lib/libc.sa(__libc.o):6008f040 A __tty_ch
|
||||
/usr/lib/libc.sa(__libc.o):6008f1cc A __unctrl
|
||||
/usr/lib/libc.sa(__libc.o):6008f27c A __win
|
||||
/usr/lib/libc.sa(__libc.o):6008f058 A _curscr
|
||||
/usr/lib/libc.sa(__libc.o):6008f228 A _daylight
|
||||
/usr/lib/libc.sa(__libc.o):6008f200 A _errno
|
||||
/usr/lib/libc.sa(__libc.o):6008f1d0 A _gdbm_errno
|
||||
/usr/lib/libc.sa(__libc.o):6008f28c A _gdbm_version
|
||||
/usr/lib/libc.sa(__libc.o):6008f008 A _h_errlist
|
||||
/usr/lib/libc.sa(__libc.o):6008f1d8 A _h_errno
|
||||
/usr/lib/libc.sa(__libc.o):6008f2a0 A _h_nerr
|
||||
/usr/lib/libc.sa(__libc.o):6008f1c4 A _normtty
|
||||
/usr/lib/libc.sa(__libc.o):6008f204 A _optarg
|
||||
/usr/lib/libc.sa(__libc.o):6008f20c A _opterr
|
||||
/usr/lib/libc.sa(__libc.o):6008f208 A _optind
|
||||
/usr/lib/libc.sa(__libc.o):6008f2e4 A _optopt
|
||||
/usr/lib/libc.sa(__libc.o):6008f218 A _ospeed
|
||||
/usr/lib/libc.sa(__libc.o):6008f26c A _re_max_failures
|
||||
/usr/lib/libc.sa(__libc.o):6008f210 A _re_syntax_options
|
||||
/usr/lib/libc.sa(__libc.o):6008f1e0 A _rexecoptions
|
||||
/usr/lib/libc.sa(__libc.o):6008f230 A _rpc_createerr
|
||||
/usr/lib/libc.sa(__libc.o):6008f25c A _stderr
|
||||
/usr/lib/libc.sa(__libc.o):6008f254 A _stdin
|
||||
/usr/lib/libc.sa(__libc.o):6008f258 A _stdout
|
||||
/usr/lib/libc.sa(__libc.o):6008f054 A _stdscr
|
||||
/usr/lib/libc.sa(__libc.o):6008f2e8 A _svc_fdset
|
||||
/usr/lib/libc.sa(__libc.o):6008f224 A _timezone
|
||||
/usr/lib/libc.sa(__libc.o):6008f21c A _tputs_baud_rate
|
||||
/usr/lib/libc.sa(__libc.o):6008f038 A _ttytype
|
||||
/usr/lib/libc.sa(__libc.o):6008f220 A _tzname
|
6
lib/ext2fs/jump/jump.params
Normal file
6
lib/ext2fs/jump/jump.params
Normal file
@ -0,0 +1,6 @@
|
||||
Name=libe2fs
|
||||
Text=0x66900000
|
||||
Data=0x00000000
|
||||
Jump=0x00001000
|
||||
GOT=0x00001000
|
||||
Version=1.0.0
|
2
lib/ext2fs/jump/jump.undefs
Normal file
2
lib/ext2fs/jump/jump.undefs
Normal file
@ -0,0 +1,2 @@
|
||||
66909078 D __NEEDS_SHRLIB_libc_4
|
||||
6690908c D __NEEDS_SHRLIB_libet_1
|
1
lib/ext2fs/jump/jump.vars
Normal file
1
lib/ext2fs/jump/jump.vars
Normal file
@ -0,0 +1 @@
|
||||
00000004 D _unix_io_manager libext2fs unix_io
|
@ -9,7 +9,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -86,6 +86,8 @@ errcode_t ext2fs_link(ext2_filsys fs, ino_t dir, const char *name, ino_t ino,
|
||||
errcode_t retval;
|
||||
struct link_struct ls;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!(fs->flags & EXT2_FLAG_RW))
|
||||
return EXT2_ET_RO_FILSYS;
|
||||
|
||||
@ -129,6 +131,8 @@ errcode_t ext2fs_unlink(ext2_filsys fs, ino_t dir, const char *name, ino_t ino,
|
||||
errcode_t retval;
|
||||
struct link_struct ls;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!(fs->flags & EXT2_FLAG_RW))
|
||||
return EXT2_ET_RO_FILSYS;
|
||||
|
||||
|
79
lib/ext2fs/llseek.c
Normal file
79
lib/ext2fs/llseek.c
Normal file
@ -0,0 +1,79 @@
|
||||
/*
|
||||
* llseek.c -- stub calling the llseek system call
|
||||
*
|
||||
* Copyright (C) 1994 Remy Card. This file may be redistributed
|
||||
* under the terms of the GNU Public License.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/unistd.h>
|
||||
#include "et/com_err.h"
|
||||
#include "ext2fs/io.h"
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
#ifndef __NR__llseek
|
||||
#define __NR__llseek 140
|
||||
#endif
|
||||
|
||||
static int _llseek (unsigned int, unsigned long,
|
||||
unsigned long, ext2_loff_t *, unsigned int);
|
||||
|
||||
static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
|
||||
unsigned long, offset_low,ext2_loff_t *,result,
|
||||
unsigned int, origin)
|
||||
|
||||
ext2_loff_t ext2_llseek (unsigned int fd, ext2_loff_t offset,
|
||||
unsigned int origin)
|
||||
{
|
||||
unsigned long offset_high;
|
||||
unsigned long offset_low;
|
||||
ext2_loff_t result;
|
||||
int retval;
|
||||
static int do_compat = 0;
|
||||
|
||||
if (do_compat) {
|
||||
compat_lseek:
|
||||
if ((sizeof(off_t) < sizeof(ext2_loff_t)) &&
|
||||
(offset >= ((ext2_loff_t) 1 << ((sizeof(off_t)*8) -1)))) {
|
||||
errno = -EINVAL;
|
||||
return -1;
|
||||
}
|
||||
return lseek (fd, (off_t) offset, origin);
|
||||
}
|
||||
|
||||
offset_high = ((unsigned long long) offset) >> 32;
|
||||
offset_low = ((unsigned long long) offset) & 0xffffffff;
|
||||
retval = _llseek (fd, offset_high, offset_low, &result, origin);
|
||||
if (retval == -1 && errno == ENOSYS) {
|
||||
/*
|
||||
* Just in case this code runs on top of an old kernel
|
||||
* which does not support the llseek system call
|
||||
*/
|
||||
do_compat++;
|
||||
goto compat_lseek;
|
||||
}
|
||||
if (retval == -1)
|
||||
result = -1;
|
||||
return result;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
ext2_loff_t ext2_llseek (unsigned int fd, ext2_loff_t offset,
|
||||
unsigned int origin)
|
||||
{
|
||||
if ((sizeof(off_t) < sizeof(ext2_loff_t)) &&
|
||||
(offset >= ((ext2_loff_t) 1 << ((sizeof(off_t)*8) -1)))) {
|
||||
errno = -EINVAL;
|
||||
return -1;
|
||||
}
|
||||
return lseek (fd, (off_t) offset, origin);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -30,6 +29,8 @@ errcode_t ext2fs_mkdir(ext2_filsys fs, ino_t parent, ino_t inum,
|
||||
char *block = 0;
|
||||
int group;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
/*
|
||||
* Allocate an inode, if necessary
|
||||
*/
|
||||
@ -109,9 +110,9 @@ errcode_t ext2fs_mkdir(ext2_filsys fs, ino_t parent, ino_t inum,
|
||||
/*
|
||||
* Update accounting....
|
||||
*/
|
||||
ext2fs_mark_block_bitmap(fs, fs->block_map, blk);
|
||||
ext2fs_mark_block_bitmap(fs->block_map, blk);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
ext2fs_mark_inode_bitmap(fs, fs->inode_map, ino);
|
||||
ext2fs_mark_inode_bitmap(fs->inode_map, ino);
|
||||
ext2fs_mark_ib_dirty(fs);
|
||||
|
||||
group = ext2fs_group_of_blk(fs, blk);
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -46,6 +46,8 @@ errcode_t ext2fs_dir_iterate(ext2_filsys fs,
|
||||
struct dir_context ctx;
|
||||
errcode_t retval;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
retval = ext2fs_check_directory(fs, dir);
|
||||
if (retval)
|
||||
return retval;
|
||||
@ -155,6 +157,8 @@ errcode_t ext2fs_lookup(ext2_filsys fs, ino_t dir, const char *name,
|
||||
errcode_t retval;
|
||||
struct lookup_struct ls;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
ls.name = name;
|
||||
ls.len = namelen;
|
||||
ls.inode = inode;
|
||||
@ -176,6 +180,8 @@ errcode_t ext2fs_namei(ext2_filsys fs, ino_t root, ino_t cwd, const char *name,
|
||||
int len;
|
||||
errcode_t retval;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
buf = malloc(fs->blocksize);
|
||||
if (!buf)
|
||||
return ENOMEM;
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -24,6 +24,8 @@ errcode_t ext2fs_new_dir_block(ext2_filsys fs, ino_t dir_ino, ino_t parent_ino,
|
||||
struct ext2_dir_entry *dir = NULL;
|
||||
int rec_len;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
buf = malloc(fs->blocksize);
|
||||
if (!buf)
|
||||
return ENOMEM;
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -31,11 +30,14 @@ errcode_t ext2fs_open(const char *name, int flags, int superblock,
|
||||
int i, group_block;
|
||||
char *dest;
|
||||
|
||||
EXT2_CHECK_MAGIC(manager, EXT2_ET_MAGIC_IO_MANAGER);
|
||||
|
||||
fs = (ext2_filsys) malloc(sizeof(struct struct_ext2_filsys));
|
||||
if (!fs)
|
||||
return ENOMEM;
|
||||
|
||||
memset(fs, 0, sizeof(struct struct_ext2_filsys));
|
||||
fs->magic = EXT2_ET_MAGIC_EXT2FS_FILSYS;
|
||||
fs->flags = flags;
|
||||
retval = manager->open(name, (flags & EXT2_FLAG_RW) ? IO_FLAG_RW : 0,
|
||||
&fs->io);
|
||||
@ -65,9 +67,11 @@ errcode_t ext2fs_open(const char *name, int flags, int superblock,
|
||||
goto cleanup;
|
||||
}
|
||||
io_channel_set_blksize(fs->io, block_size);
|
||||
group_block = superblock + 1;
|
||||
} else {
|
||||
io_channel_set_blksize(fs->io, SUPERBLOCK_OFFSET);
|
||||
superblock = 1;
|
||||
group_block = 0;
|
||||
}
|
||||
retval = io_channel_read_blk(fs->io, superblock, -SUPERBLOCK_SIZE,
|
||||
fs->super);
|
||||
@ -78,6 +82,12 @@ errcode_t ext2fs_open(const char *name, int flags, int superblock,
|
||||
retval = EXT2_ET_BAD_MAGIC;
|
||||
goto cleanup;
|
||||
}
|
||||
#ifdef EXT2_CURRENT_REV
|
||||
if (fs->super->s_rev_level > EXT2_LIB_CURRENT_REV) {
|
||||
retval = EXT2_ET_REV_TOO_HIGH;
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
fs->blocksize = EXT2_BLOCK_SIZE(fs->super);
|
||||
fs->fragsize = EXT2_FRAG_SIZE(fs->super);
|
||||
fs->inode_blocks_per_group = (fs->super->s_inodes_per_group /
|
||||
@ -108,7 +118,8 @@ errcode_t ext2fs_open(const char *name, int flags, int superblock,
|
||||
retval = ENOMEM;
|
||||
goto cleanup;
|
||||
}
|
||||
group_block = fs->super->s_first_data_block + 1;
|
||||
if (!group_block)
|
||||
group_block = fs->super->s_first_data_block + 1;
|
||||
dest = (char *) fs->group_desc;
|
||||
for (i=0 ; i < fs->desc_blocks; i++) {
|
||||
retval = io_channel_read_blk(fs->io, group_block, 1, dest);
|
||||
@ -125,45 +136,3 @@ cleanup:
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine sanity checks the group descriptors
|
||||
*/
|
||||
errcode_t ext2fs_check_desc(ext2_filsys fs)
|
||||
{
|
||||
int i;
|
||||
int block = fs->super->s_first_data_block;
|
||||
int next, inode_blocks_per_group;
|
||||
|
||||
inode_blocks_per_group = fs->super->s_inodes_per_group /
|
||||
EXT2_INODES_PER_BLOCK (fs->super);
|
||||
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
next = block + fs->super->s_blocks_per_group;
|
||||
/*
|
||||
* Check to make sure block bitmap for group is
|
||||
* located within the group.
|
||||
*/
|
||||
if (fs->group_desc[i].bg_block_bitmap < block ||
|
||||
fs->group_desc[i].bg_block_bitmap >= next)
|
||||
return EXT2_ET_GDESC_BAD_BLOCK_MAP;
|
||||
/*
|
||||
* Check to make sure inode bitmap for group is
|
||||
* located within the group
|
||||
*/
|
||||
if (fs->group_desc[i].bg_inode_bitmap < block ||
|
||||
fs->group_desc[i].bg_inode_bitmap >= next)
|
||||
return EXT2_ET_GDESC_BAD_INODE_MAP;
|
||||
/*
|
||||
* Check to make sure inode table for group is located
|
||||
* within the group
|
||||
*/
|
||||
if (fs->group_desc[i].bg_inode_table < block ||
|
||||
fs->group_desc[i].bg_inode_table+inode_blocks_per_group >=
|
||||
next)
|
||||
return EXT2_ET_GDESC_BAD_INODE_TABLE;
|
||||
|
||||
block = next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -51,6 +50,8 @@ errcode_t ext2fs_read_bb_inode(ext2_filsys fs, badblocks_list *bb_list)
|
||||
struct ext2_inode inode;
|
||||
int numblocks;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!*bb_list) {
|
||||
retval = ext2fs_read_inode(fs, EXT2_BAD_INO, &inode);
|
||||
if (retval)
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
@ -29,6 +28,9 @@ errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f,
|
||||
errcode_t retval;
|
||||
blk_t blockno;
|
||||
int count;
|
||||
char buf[128];
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!*bb_list) {
|
||||
retval = badblocks_list_create(bb_list, 10);
|
||||
@ -37,9 +39,11 @@ errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f,
|
||||
}
|
||||
|
||||
while (!feof (f)) {
|
||||
count = fscanf (f, "%lu", &blockno);
|
||||
if (count <= 0)
|
||||
if (fgets(buf, sizeof(buf), f) == NULL)
|
||||
break;
|
||||
count = sscanf(buf, "%lu", &blockno);
|
||||
if (count <= 0)
|
||||
continue;
|
||||
if ((blockno < fs->super->s_first_data_block) ||
|
||||
(blockno >= fs->super->s_blocks_count)) {
|
||||
if (invalid)
|
||||
@ -47,7 +51,8 @@ errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f,
|
||||
continue;
|
||||
}
|
||||
retval = badblocks_list_add(*bb_list, blockno);
|
||||
return retval;
|
||||
if (retval)
|
||||
return retval;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
218
lib/ext2fs/rw_bitmaps.c
Normal file
218
lib/ext2fs/rw_bitmaps.c
Normal file
@ -0,0 +1,218 @@
|
||||
/*
|
||||
* rw_bitmaps.c --- routines to read and write the inode and block bitmaps.
|
||||
*
|
||||
* Copyright (C) 1993,1994 Theodore Ts'o. This file may be redistributed
|
||||
* under the terms of the GNU Public License.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
#include "ext2fs.h"
|
||||
|
||||
errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs)
|
||||
{
|
||||
int i;
|
||||
int nbytes;
|
||||
errcode_t retval;
|
||||
char * inode_bitmap = fs->inode_map->bitmap;
|
||||
char * bitmap_block = NULL;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!(fs->flags & EXT2_FLAG_RW))
|
||||
return EXT2_ET_RO_FILSYS;
|
||||
if (!inode_bitmap)
|
||||
return 0;
|
||||
nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8;
|
||||
bitmap_block = malloc(fs->blocksize);
|
||||
if (!bitmap_block)
|
||||
return ENOMEM;
|
||||
memset(bitmap_block, 0xff, fs->blocksize);
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
memcpy(bitmap_block, inode_bitmap, nbytes);
|
||||
retval = io_channel_write_blk(fs->io,
|
||||
fs->group_desc[i].bg_inode_bitmap, 1,
|
||||
bitmap_block);
|
||||
if (retval)
|
||||
return EXT2_ET_INODE_BITMAP_WRITE;
|
||||
inode_bitmap += nbytes;
|
||||
}
|
||||
fs->flags |= EXT2_FLAG_CHANGED;
|
||||
fs->flags &= ~EXT2_FLAG_IB_DIRTY;
|
||||
free(bitmap_block);
|
||||
return 0;
|
||||
}
|
||||
|
||||
errcode_t ext2fs_write_block_bitmap (ext2_filsys fs)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int nbytes;
|
||||
int nbits;
|
||||
errcode_t retval;
|
||||
char * block_bitmap = fs->block_map->bitmap;
|
||||
char * bitmap_block = NULL;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (!(fs->flags & EXT2_FLAG_RW))
|
||||
return EXT2_ET_RO_FILSYS;
|
||||
if (!block_bitmap)
|
||||
return 0;
|
||||
nbytes = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
|
||||
bitmap_block = malloc(fs->blocksize);
|
||||
if (!bitmap_block)
|
||||
return ENOMEM;
|
||||
memset(bitmap_block, 0xff, fs->blocksize);
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
memcpy(bitmap_block, block_bitmap, nbytes);
|
||||
if (i == fs->group_desc_count - 1) {
|
||||
/* Force bitmap padding for the last group */
|
||||
nbits = (fs->super->s_blocks_count
|
||||
- fs->super->s_first_data_block)
|
||||
% EXT2_BLOCKS_PER_GROUP(fs->super);
|
||||
if (nbits)
|
||||
for (j = nbits; j < fs->blocksize * 8; j++)
|
||||
set_bit(j, bitmap_block);
|
||||
}
|
||||
retval = io_channel_write_blk(fs->io,
|
||||
fs->group_desc[i].bg_block_bitmap, 1,
|
||||
bitmap_block);
|
||||
if (retval)
|
||||
return EXT2_ET_BLOCK_BITMAP_WRITE;
|
||||
block_bitmap += nbytes;
|
||||
}
|
||||
fs->flags |= EXT2_FLAG_CHANGED;
|
||||
fs->flags &= ~EXT2_FLAG_BB_DIRTY;
|
||||
free(bitmap_block);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
|
||||
{
|
||||
int i;
|
||||
char *block_bitmap, *inode_bitmap;
|
||||
char *buf;
|
||||
errcode_t retval;
|
||||
int block_nbytes = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
|
||||
int inode_nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
fs->write_bitmaps = ext2fs_write_bitmaps;
|
||||
|
||||
buf = malloc(strlen(fs->device_name) + 80);
|
||||
if (do_block) {
|
||||
if (fs->block_map)
|
||||
ext2fs_free_block_bitmap(fs->block_map);
|
||||
sprintf(buf, "block bitmap for %s", fs->device_name);
|
||||
retval = ext2fs_allocate_block_bitmap(fs, buf, &fs->block_map);
|
||||
if (retval)
|
||||
goto cleanup;
|
||||
block_bitmap = fs->block_map->bitmap;
|
||||
}
|
||||
if (do_inode) {
|
||||
if (fs->inode_map)
|
||||
ext2fs_free_inode_bitmap(fs->inode_map);
|
||||
sprintf(buf, "inode bitmap for %s", fs->device_name);
|
||||
retval = ext2fs_allocate_inode_bitmap(fs, buf, &fs->inode_map);
|
||||
if (retval)
|
||||
goto cleanup;
|
||||
inode_bitmap = fs->inode_map->bitmap;
|
||||
}
|
||||
free(buf);
|
||||
buf = malloc(fs->blocksize);
|
||||
if (!buf) {
|
||||
retval = ENOMEM;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
for (i = 0; i < fs->group_desc_count; i++) {
|
||||
if (do_block) {
|
||||
retval = io_channel_read_blk
|
||||
(fs->io,
|
||||
fs->group_desc[i].bg_block_bitmap,
|
||||
1, buf);
|
||||
if (retval) {
|
||||
retval = EXT2_ET_BLOCK_BITMAP_READ;
|
||||
goto cleanup;
|
||||
}
|
||||
memcpy(block_bitmap, buf, block_nbytes);
|
||||
block_bitmap += block_nbytes;
|
||||
}
|
||||
if (do_inode) {
|
||||
retval = io_channel_read_blk
|
||||
(fs->io,
|
||||
fs->group_desc[i].bg_inode_bitmap,
|
||||
1, buf);
|
||||
if (retval) {
|
||||
retval = EXT2_ET_INODE_BITMAP_READ;
|
||||
goto cleanup;
|
||||
}
|
||||
memcpy(inode_bitmap, buf, inode_nbytes);
|
||||
inode_bitmap += inode_nbytes;
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
return 0;
|
||||
|
||||
cleanup:
|
||||
if (do_block) {
|
||||
free(fs->block_map);
|
||||
fs->block_map = 0;
|
||||
}
|
||||
if (do_inode) {
|
||||
free(fs->inode_map);
|
||||
fs->inode_map = 0;
|
||||
}
|
||||
if (buf)
|
||||
free(buf);
|
||||
return retval;
|
||||
}
|
||||
|
||||
errcode_t ext2fs_read_inode_bitmap (ext2_filsys fs)
|
||||
{
|
||||
return read_bitmaps(fs, 1, 0);
|
||||
}
|
||||
|
||||
errcode_t ext2fs_read_block_bitmap(ext2_filsys fs)
|
||||
{
|
||||
return read_bitmaps(fs, 0, 1);
|
||||
}
|
||||
|
||||
errcode_t ext2fs_read_bitmaps(ext2_filsys fs)
|
||||
{
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
return read_bitmaps(fs, !fs->inode_map, !fs->block_map);
|
||||
}
|
||||
|
||||
errcode_t ext2fs_write_bitmaps(ext2_filsys fs)
|
||||
{
|
||||
errcode_t retval;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
|
||||
if (fs->block_map && ext2fs_test_bb_dirty(fs)) {
|
||||
retval = ext2fs_write_block_bitmap(fs);
|
||||
if (retval)
|
||||
return retval;
|
||||
}
|
||||
if (fs->inode_map && ext2fs_test_ib_dirty(fs)) {
|
||||
retval = ext2fs_write_inode_bitmap(fs);
|
||||
if (retval)
|
||||
return retval;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user