Commit 7f88b043 authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

Many files:

  Checkin of e2fsprogs 1.03.
parent 126cf2f7
Wed Mar 27 00:33:40 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.03
Wed Jan 31 11:06:08 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.02
......
E2fsprogs 1.03 (March 27, 1996)
===============================
Change the m68k bit numbering for bitmasks to match the bit numbering
used by all other ext2 implementations. (This change was requested by
the m68k kernel development team.)
Support (in-development) filesystem format revision which supports
(among other things) dynamically sized inodes.
Fixed a bug in the ext2 library so that an intelligent error is
returned if mke2fs is run with a ridiculously small number of blocks
for a partition.
Fixed a bug in the ext2 library which required that the device be
openable in read/write mode in order to determine its size. This
caused e2fsck -n to require read/write access when it was not
previously necessary.
Fixed a bug in e2fsck which casued it to occasionally fail the test
suite depending on which version of the floating point library it was
using.
Fixed a bug in e2fsck so that it now halts with a fatal error when
certain superblock consistency checks fail. Previously it continued
running e2fsck, with some potential confusing/damaging consequences.
Added new flag to fsck which allows the root to be checked in parallel
with other filesytems. This is not the safest thing in the world to
do, but some system administrators really wanted it.
E2fsprogs 1.02 (January 16, 1996)
=================================
......
Wed Mar 27 00:33:40 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.03
Wed Jan 31 11:06:08 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.02
......
......@@ -181,6 +181,7 @@ void do_show_super_stats(int argc, char *argv[])
fprintf(out, "Superblock size = %d\n", sizeof(struct ext2_super_block));
fprintf(out, "Block size = %d, fragment size = %d\n",
EXT2_BLOCK_SIZE(fs->super), EXT2_FRAG_SIZE(fs->super));
fprintf(out, "Inode size = %d\n", EXT2_INODE_SIZE(fs->super));
fprintf(out, "%d inodes, %d free\n", fs->super->s_inodes_count,
fs->super->s_free_inodes_count);
fprintf(out, "%d blocks, %d free, %d reserved, first block = %d\n",
......@@ -189,7 +190,6 @@ void do_show_super_stats(int argc, char *argv[])
fprintf(out, "%d blocks per group\n", fs->super->s_blocks_per_group);
fprintf(out, "%d fragments per group\n", fs->super->s_frags_per_group);
fprintf(out, "%d inodes per group\n", EXT2_INODES_PER_GROUP(fs->super));
fprintf(out, "%d inodes per block\n", EXT2_INODES_PER_BLOCK(fs->super));
fprintf(out, "%ld group%s (%ld descriptors block%s)\n",
fs->group_desc_count, (fs->group_desc_count != 1) ? "s" : "",
fs->desc_blocks, (fs->desc_blocks != 1) ? "s" : "");
......
Wed Mar 27 00:33:40 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.03
Tue Mar 26 12:03:42 1996 <tytso@rsts-11.mit.edu>
* e2fsck.c (show_stats): Don't use floating point to display
percentage of non-contiguous files, as different libc
handle result truncation differently, and this causes the
test suite to bomb out depending on which libc you are
using.
* util.c (allocate_memory): Fix error message to omit extraneous
%%s.
Tue Mar 5 03:50:40 1996 <tytso@rsts-11.mit.edu>
* pass4.c (pass4):
* pass2.c (check_dir_block):
* pass1.c (pass1): Add support for dynamic first inode revision.
Wed Feb 14 16:27:30 1996 <tytso@rsts-11.mit.edu>
* pass3.c (check_root): Fix spelling typo
Mon Feb 5 22:30:30 1996 <tytso@rsts-11.mit.edu>
* e2fsck.c (check_super_block): If the superblock fails certain
internal consistency checks, exit with a fatal error after
printing the "superblock is corrupt message".
Wed Jan 31 11:06:08 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.02
......
......@@ -91,6 +91,7 @@ static void show_stats(ext2_filsys fs)
int inodes, inodes_used, blocks, blocks_used;
int dir_links;
int num_files, num_links;
int frag_percent;
dir_links = 2 * fs_directory_count - 1;
num_files = fs_total_count - dir_links;
......@@ -101,19 +102,22 @@ static void show_stats(ext2_filsys fs)
blocks = fs->super->s_blocks_count;
blocks_used = (fs->super->s_blocks_count -
fs->super->s_free_blocks_count);
frag_percent = (10000 * fs_fragmented) / inodes_used;
frag_percent = (frag_percent + 5) / 10;
if (!verbose) {
printf("%s: %d/%d files (%3.1f%% non-contiguous), %d/%d blocks\n",
printf("%s: %d/%d files (%0d.%d%% non-contiguous), %d/%d blocks\n",
device_name, inodes_used, inodes,
100.00 * fs_fragmented / inodes_used,
frag_percent / 10, frag_percent % 10,
blocks_used, blocks);
return;
}
printf ("\n%8d inode%s used (%d%%)\n", inodes_used,
(inodes_used != 1) ? "s" : "",
100 * inodes_used / inodes);
printf ("%8d non-contiguous inodes (%3.1f%%)\n",
fs_fragmented, 100.00 * fs_fragmented / inodes_used);
printf ("%8d non-contiguous inodes (%0d.%d%%)\n",
fs_fragmented, frag_percent / 10, frag_percent % 10);
printf (" # of inodes with ind/dind/tind blocks: %d/%d/%d\n",
fs_ind_count, fs_dind_count, fs_tind_count);
printf ("%8d block%s used (%d%%)\n"
......@@ -285,6 +289,7 @@ static void check_super_block(ext2_filsys fs)
"have been %u\n", s->s_blocks_per_group,
should_be);
printf(corrupt_msg);
fatal_error(0);
}
should_be = (s->s_log_block_size == 0) ? 1 : 0;
......@@ -293,6 +298,7 @@ static void check_super_block(ext2_filsys fs)
"have been %u\n", s->s_first_data_block,
should_be);
printf(corrupt_msg);
fatal_error(0);
}
/*
......@@ -601,7 +607,8 @@ restart:
#ifdef EXT2_CURRENT_REV
if (fs->super->s_rev_level > E2FSCK_CURRENT_REV) {
com_err(program_name, retval, "while trying to open %s",
com_err(program_name, EXT2_ET_REV_TOO_HIGH,
"while trying to open %s",
filesystem_name);
printf ("Get a newer version of e2fsck!\n");
fatal_error(0);
......
......@@ -307,7 +307,8 @@ void pass1(ext2_filsys fs)
ext2fs_unmark_valid(fs);
}
}
if ((ino != EXT2_ROOT_INO) && (ino < EXT2_FIRST_INO)) {
if ((ino != EXT2_ROOT_INO) &&
(ino < EXT2_FIRST_INODE(fs->super))) {
ext2fs_mark_inode_bitmap(inode_used_map, ino);
if (inode.i_mode != 0) {
printf("Reserved inode %lu has bad mode. ", ino);
......
......@@ -382,7 +382,7 @@ static int check_dir_block(ext2_filsys fs,
* Make sure the inode listed is a legal one.
*/
if (((dirent->inode != EXT2_ROOT_INO) &&
(dirent->inode < EXT2_FIRST_INO)) ||
(dirent->inode < EXT2_FIRST_INODE(fs->super))) ||
(dirent->inode > fs->super->s_inodes_count)) {
retval = ext2fs_get_pathname(fs, ino, 0, &path1);
if (retval)
......
......@@ -138,7 +138,7 @@ void check_root(ext2_filsys fs, ino_t root_ino)
printf("Root inode not allocated. ");
preenhalt(fs);
if (!ask("Rellocate", 1)) {
if (!ask("Reallocate", 1)) {
ext2fs_unmark_valid(fs);
fatal_error("Cannot proceed without a root inode.");
}
......
......@@ -24,7 +24,7 @@ void pass4(ext2_filsys fs)
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))
(i > EXT2_ROOT_INO && i < EXT2_FIRST_INODE(fs->super)))
continue;
if (!(ext2fs_test_inode_bitmap(inode_used_map, i)))
continue;
......
......@@ -36,7 +36,7 @@ void *allocate_memory(int size, const char *description)
#endif
ret = malloc(size);
if (!ret) {
sprintf(buf, "%%s: Can't allocate %s\n", description);
sprintf(buf, "Can't allocate %s\n", description);
fatal_error(buf);
}
memset(ret, 0, size);
......
Wed Mar 27 00:33:40 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.03
Wed Jan 31 11:06:08 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.02
......
Wed Mar 27 00:33:40 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.03
Wed Jan 31 11:06:08 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.02
......
Wed Mar 27 00:33:40 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.03
Wed Jan 31 11:06:08 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.02
......
Wed Mar 27 00:33:40 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.03
Wed Jan 31 11:06:08 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.02
......
......@@ -43,9 +43,21 @@ static void print_group (unsigned short gid)
printf ("(group %s)\n", gr->gr_name);
}
#ifndef EXT2_INODE_SIZE
#define EXT2_INODE_SIZE(s) sizeof(struct ext2_inode)
#endif
void list_super (struct ext2_super_block * s)
{
int inode_blocks_per_group;
inode_blocks_per_group = (((s->s_inodes_per_group *
EXT2_INODE_SIZE(s)) +
EXT2_BLOCK_SIZE(s) - 1) /
EXT2_BLOCK_SIZE(s));
printf ("Filesystem magic number: 0x%04X\n", s->s_magic);
printf ("Filesystem revision #: %d\n", s->s_rev_level);
printf ("Filesystem state: ");
print_fs_state (stdout, s->s_state);
printf ("\n");
......@@ -63,6 +75,7 @@ void list_super (struct ext2_super_block * s)
printf ("Blocks per group: %u\n", s->s_blocks_per_group);
printf ("Fragments per group: %u\n", s->s_frags_per_group);
printf ("Inodes per group: %u\n", s->s_inodes_per_group);
printf ("Inode blocks per group: %u\n", inode_blocks_per_group);
printf ("Last mount time: %s", ctime ((time_t *) &s->s_mtime));
printf ("Last write time: %s", ctime ((time_t *) &s->s_wtime));
printf ("Mount count: %u\n", s->s_mnt_count);
......@@ -82,4 +95,10 @@ void list_super (struct ext2_super_block * s)
printf ("Reserved blocks gid: ");
print_group (s->s_def_resgid);
#endif
#ifdef EXT2_DYNAMIC_REV
if (s->s_rev_level >= EXT2_DYNAMIC_REV) {
printf("First inode: %d\n", s->s_first_ino);
printf("Inode size: %d\n", s->s_inode_size);
}
#endif
}
Wed Mar 27 00:33:40 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.03
Wed Jan 31 11:06:08 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.02
......
Wed Mar 27 00:33:40 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.03
Tue Mar 26 12:06:32 1996 <tytso@rsts-11.mit.edu>
* bitops.h (ext2fs_set_bit, ext2fs_clear_bit, ext2fs_test_bit):
Change the m68k bit numbering for bitmasks to match with
the bit numbering used by all other ext2 implementations.
Thu Mar 7 03:37:00 1996 <tytso@rsts-11.mit.edu>
* inode.c (ext2fs_get_next_inode, ext2fs_close_inode_scan,
ext2fs_open_inode_scan): Support dynamically-sized inodes.
Wed Mar 6 12:26:29 1996 <tytso@rsts-11.mit.edu>
* inode.c (ext2fs_read_inode, ext2fs_write_inode): Support
dynamically-sized inodes.
* openfs.c (ext2fs_open): Allow dynamic revision filesystem to be
loaded.
Tue Mar 5 03:49:37 1996 <tytso@rsts-11.mit.edu>
* initialize.c (ext2fs_initialize): Catch an error condition where
the passed in size is *really* too small.
* alloc.c (ext2fs_new_inode):
* ext2fs.h (EXT2_FIRST_INODE): Add support for dynamic revision to
get first inode.
Wed Feb 21 15:56:17 1996 <tytso@rsts-11.mit.edu>
* getsize.c (ext2fs_get_device_size): Open the device read-only
when trying to determine its size.
Wed Jan 31 11:06:08 1996 <tytso@rsts-11.mit.edu>
* Release of E2fsprogs version 1.02
......
......@@ -43,8 +43,8 @@ errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode,
dir_group = (dir - 1) / EXT2_INODES_PER_GROUP(fs->super);
start_inode = (dir_group * EXT2_INODES_PER_GROUP(fs->super)) + 1;
if (start_inode < EXT2_FIRST_INO)
start_inode = EXT2_FIRST_INO;
if (start_inode < EXT2_FIRST_INODE(fs->super))
start_inode = EXT2_FIRST_INODE(fs->super);
i = start_inode;
do {
......@@ -52,7 +52,7 @@ errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode,
break;
i++;
if (i > fs->super->s_inodes_count)
i = EXT2_FIRST_INO;
i = EXT2_FIRST_INODE(fs->super);
} while (i != start_inode);
if (ext2fs_test_inode_bitmap(map, i))
......
......@@ -141,7 +141,7 @@ _INLINE_ int ext2fs_set_bit(int nr,void * addr)
char retval;
__asm__ __volatile__ ("bfset %2@{%1:#1}; sne %0"
: "=d" (retval) : "d" (nr), "a" (addr));
: "=d" (retval) : "d" (nr^7), "a" (addr));
return retval;
}
......@@ -151,7 +151,7 @@ _INLINE_ int ext2fs_clear_bit(int nr, void * addr)
char retval;
__asm__ __volatile__ ("bfclr %2@{%1:#1}; sne %0"
: "=d" (retval) : "d" (nr), "a" (addr));
: "=d" (retval) : "d" (nr^7), "a" (addr));
return retval;
}
......@@ -161,7 +161,7 @@ _INLINE_ int ext2fs_test_bit(int nr, const void * addr)
char retval;
__asm__ __volatile__ ("bftst %2@{%1:#1}; sne %0"
: "=d" (retval) : "d" (nr), "a" (addr));
: "=d" (retval) : "d" (nr^7), "a" (addr));
return retval;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment