Fix format bug if NLS is in use.
Add extra so that the info directory looks OK on OpenWall.
+2002-10-13 Theodore Ts'o <tytso@mit.edu>
+
+ * debugfs.h, htree.c, setsuper.c: Fix gcc -Wall nits.
+
2002-10-02 Theodore Y. Ts'o <tytso@mit.edu>
* htree.c (htree_dump_leaf_node): Use ext2fs_read_dir_block2 so
extern void do_cat(int argc, char **argv);
extern void do_rdump(int argc, char **argv);
+/* htree.c */
+extern void do_htree_dump(int argc, char **argv);
+extern void do_dx_hash(int argc, char **argv);
+extern void do_dirsearch(int argc, char **argv);
+
/* logdump.c */
extern void do_logdump(int argc, char **argv);
extern void do_rmdir(int argc, char **argv);
extern void do_show_debugfs_params(int argc, char **argv);
extern void do_expand_dir(int argc, char **argv);
-extern void do_features(int argc, char *argv[]);
+extern void do_features(int argc, char **argv);
+extern void do_bmap(int argc, char **argv);
static void htree_dump_leaf_node(ext2_filsys fs, ext2_ino_t ino,
struct ext2_inode *inode,
- struct ext2_dx_root_info * root,
+ struct ext2_dx_root_info * rootnode,
blk_t blk, char *buf)
{
errcode_t errcode;
(dirent->name_len & 0xFF) : EXT2_NAME_LEN;
strncpy(name, dirent->name, thislen);
name[thislen] = '\0';
- errcode = ext2fs_dirhash(root->hash_version, name, thislen,
- fs->super->s_hash_seed,
+ errcode = ext2fs_dirhash(rootnode->hash_version, name,
+ thislen, fs->super->s_hash_seed,
&hash, 0);
if (errcode)
com_err("htree_dump_leaf_node", errcode,
static void htree_dump_int_block(ext2_filsys fs, ext2_ino_t ino,
struct ext2_inode *inode,
- struct ext2_dx_root_info * root,
+ struct ext2_dx_root_info * rootnode,
blk_t blk, char *buf, int level);
static void htree_dump_int_node(ext2_filsys fs, ext2_ino_t ino,
struct ext2_inode *inode,
- struct ext2_dx_root_info * root,
+ struct ext2_dx_root_info * rootnode,
struct ext2_dx_entry *ent,
char *buf, int level)
{
fprintf(pager, "Entry #%d: Hash 0x%08x, block %d\n", i,
i ? e.hash : 0, e.block);
if (level)
- htree_dump_int_block(fs, ino, inode, root,
+ htree_dump_int_block(fs, ino, inode, rootnode,
e.block, buf, level-1);
else
- htree_dump_leaf_node(fs, ino, inode, root,
+ htree_dump_leaf_node(fs, ino, inode, rootnode,
e.block, buf);
}
static void htree_dump_int_block(ext2_filsys fs, ext2_ino_t ino,
struct ext2_inode *inode,
- struct ext2_dx_root_info * root,
+ struct ext2_dx_root_info * rootnode,
blk_t blk, char *buf, int level)
{
char *cbuf;
return;
}
- htree_dump_int_node(fs, ino, inode, root,
+ htree_dump_int_node(fs, ino, inode, rootnode,
(struct ext2_dx_entry *) (buf+8),
cbuf, level);
free(cbuf);
{
ext2_ino_t ino;
struct ext2_inode inode;
- int retval;
- int i, c;
- int flags;
+ int c;
int long_opt;
- void *buf = NULL;
- struct ext2_dx_root_info *root;
+ char *buf = NULL;
+ struct ext2_dx_root_info *rootnode;
struct ext2_dx_entry *ent;
struct ext2_dx_countlimit *limit;
errcode_t errcode;
goto errout;
}
- root = (struct ext2_dx_root_info *) (buf + 24);
+ rootnode = (struct ext2_dx_root_info *) (buf + 24);
fprintf(pager, "Root node dump:\n");
- fprintf(pager, "\t Reserved zero: %d\n", root->reserved_zero);
- fprintf(pager, "\t Hash Version: %d\n", root->hash_version);
- fprintf(pager, "\t Info length: %d\n", root->info_length);
- fprintf(pager, "\t Indirect levels: %d\n", root->indirect_levels);
- fprintf(pager, "\t Flags: %d\n", root->unused_flags);
+ fprintf(pager, "\t Reserved zero: %d\n", rootnode->reserved_zero);
+ fprintf(pager, "\t Hash Version: %d\n", rootnode->hash_version);
+ fprintf(pager, "\t Info length: %d\n", rootnode->info_length);
+ fprintf(pager, "\t Indirect levels: %d\n", rootnode->indirect_levels);
+ fprintf(pager, "\t Flags: %d\n", rootnode->unused_flags);
- ent = (struct ext2_dx_entry *) (buf + 24 + root->info_length);
+ ent = (struct ext2_dx_entry *) (buf + 24 + rootnode->info_length);
limit = (struct ext2_dx_countlimit *) ent;
- htree_dump_int_node(current_fs, ino, &inode, root, ent,
+ htree_dump_int_node(current_fs, ino, &inode, rootnode, ent,
buf + current_fs->blocksize,
- root->indirect_levels);
+ rootnode->indirect_levels);
errout:
if (buf)
void do_dirsearch(int argc, char *argv[])
{
ext2_ino_t inode;
- int retval;
- int c;
- int flags;
struct process_block_struct pb;
if (check_fs_open(argv[0]))
#include <utime.h>
#include "debugfs.h"
+#include "uuid/uuid.h"
+#include "e2p/e2p.h"
static struct ext2_super_block set_sb;
static errcode_t parse_uuid(struct super_set_info *info, char *arg)
{
- char * p = (char *) info->ptr;
+ unsigned char * p = (unsigned char *) info->ptr;
if ((strcasecmp(arg, "null") == 0) ||
(strcasecmp(arg, "clear") == 0)) {
+2002-10-13 Theodore Ts'o <tytso@mit.edu>
+
+ * libext2fs.texinfo: Add extra spaceing so that the info directory
+ looks OK on Openwall.
+
2001-09-24 Theodore Tso <tytso@mit.edu>
* Release of E2fsprogs 1.29
@dircategory Development
@format
START-INFO-DIR-ENTRY
-* libext2fs: (libext2fs.info). The EXT2FS library.
+* libext2fs: (libext2fs.info). The EXT2FS library.
END-INFO-DIR-ENTRY
@end format
@end ifinfo
+2002-10-13 Theodore Ts'o <tytso@mit.edu>
+
+ * pass3.c (e2fsck_get_lost_and_found): Pass in mode 700 to
+ ext2fs_new_inode().
+
+ * unix.c (show_stats): Fix format bug if NLS is in use.
+
+ * journal.c, pass1.c, revoke.c, util.c: Fix gcc -Wall nits.
+
2002-10-08 Theodore Ts'o <tytso@mit.edu>
* pass3.c (e2fsck_get_lost_and_found): Create the lost+found
struct buffer_head *bh;
struct inode *j_inode = NULL;
struct kdev_s *dev_fs = NULL, *dev_journal;
- char *journal_name = 0;
+ const char *journal_name = 0;
journal_t *journal = NULL;
- errcode_t retval;
- io_manager io_ptr;
+ errcode_t retval = 0;
+ io_manager io_ptr = 0;
unsigned long start = 0;
int free_journal_name = 0;
int ext_journal = 0;
* found.
*/
+#include <string.h>
#include <time.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
(block << (hash_shift - 12))) & (table->hash_size - 1);
}
-int insert_revoke_hash(journal_t *journal, unsigned long blocknr, tid_t seq)
+static int insert_revoke_hash(journal_t *journal, unsigned long blocknr,
+ tid_t seq)
{
struct list_head *hash_list;
struct jbd_revoke_record_s *record;
*/
#ifdef ENABLE_NLS
printf (_("\n%8d inodes used (%d%%)\n"), inodes_used,
- (inodes_used != 1), 100 * inodes_used / inodes);
+ 100 * inodes_used / inodes);
printf (_("%8d non-contiguous inodes (%0d.%d%%)\n"),
ctx->fs_fragmented, frag_percent / 10, frag_percent % 10);
printf (_(" # of inodes with ind/dind/tind blocks: %d/%d/%d\n"),
}
#ifndef HAVE_CONIO_H
-int read_a_char(void)
+static int read_a_char(void)
{
char c;
int r;
+2002-10-13 Theodore Ts'o <tytso@mit.edu>
+
+ * ext2fs.h: Add #include of header files necessary for ext2fs.h to
+ compile cleanly.
+
2002-10-02 Theodore Y. Ts'o <tytso@mit.edu>
* rw_bitmaps.c (ext2fs_write_block_bitmap,
#include <sys/types.h>
#endif
+#include <stdio.h>
#include <stdlib.h>
#if EXT2_FLAT_INCLUDES
#include "e2_types.h"
+#include "ext2_fs.h"
#else
#include <ext2fs/ext2_types.h>
+#include <ext2fs/ext2_fs.h>
#endif /* EXT2_FLAT_INCLUDES */
typedef __u32 ext2_ino_t;
+2002-10-13 Theodore Ts'o <tytso@mit.edu>
+
+ * get_device_by_label.c (read_partitions): Use a 16k buffer to
+ read in /proc/partitions in one go.
+
+ * badblocks.c, fsck.c, fstype.c, get_device_by_label.c,
+ tune2fs.c: Fix gcc -Wall nits.
+
2002-10-11 Theodore Ts'o <tytso@mit.edu>
* mklost+found.c (main): Make sure the lost+found directory is
}
} else
host_dev = dev;
- if (input_file)
+ if (input_file) {
if (strcmp (input_file, "-") == 0)
in = stdin;
else {
exit (1);
}
}
+ }
if (output_file && strcmp (output_file, "-") != 0)
{
out = fopen (output_file, "w");
/*
* Send a signal to all outstanding fsck child processes
*/
-static int kill_all(int signal)
+static int kill_all(int signum)
{
struct fsck_instance *inst;
int n = 0;
for (inst = instance_list; inst; inst = inst->next) {
if (inst->flags & FLAG_DONE)
continue;
- kill(inst->pid, signal);
+ kill(inst->pid, signum);
n++;
}
return n;
static int check_all(NOARGS)
{
struct fs_info *fs = NULL;
- struct fsck_instance *inst;
int status = EXIT_OK;
int not_done_yet = 1;
int passno = 1;
*/
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
return 0;
}
+#define CBBUF (16 * 1024)
+
static void
uuidcache_addentry(char *device, char *label, char *uuid) {
struct uuidCache_s *last;
struct stat statbuf;
int firstPass;
int handleOnFirst;
+ char *iobuf;
procpt = fopen(PROC_PARTITIONS, "r");
if (!procpt)
return;
+ iobuf = (char *)malloc(CBBUF);
+ if (iobuf)
+ setvbuf(procpt, iobuf, _IOFBF, CBBUF);
+
for (firstPass = 1; firstPass >= 0; firstPass--) {
fseek(procpt, 0, SEEK_SET);
}
fclose(procpt);
+ if (iobuf)
+ free(iobuf);
}
static void
read_evms(void)
{
char line[100];
- char *s;
int ma, mi, sz;
FILE *procpt;
char uuid[16], *label, *devname;
static const char *please_fsck = N_("Please run e2fsck on the filesystem.\n");
+void do_findfs(int argc, char **argv);
+
static void usage(void)
{
fprintf(stderr,
device_name = argv[optind];
}
-do_findfs(int argc, char **argv)
+void do_findfs(int argc, char **argv)
{
char *dev;