diff options
author | Theodore Ts'o <tytso@mit.edu> | 2001-06-01 15:36:05 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2001-06-01 15:36:05 +0000 |
commit | 5e4f070952bb4472e28a925f591b551baf2db278 (patch) | |
tree | 8db0ec90d0f1e1f9f1f381acb2e693bff78a7665 /debugfs | |
parent | 4bb0c0434c06da97836a3efba8a978a0d1ad5c6e (diff) | |
download | e2fsprogs-5e4f070952bb4472e28a925f591b551baf2db278.tar.gz |
ChangeLog, debugfs.c, debugfs.h, logdump.c:
debugfs.c, debugfs.h, logdump.c: Fix various gcc -Wall nitpicks.
Diffstat (limited to 'debugfs')
-rw-r--r-- | debugfs/ChangeLog | 2 | ||||
-rw-r--r-- | debugfs/debugfs.c | 4 | ||||
-rw-r--r-- | debugfs/debugfs.h | 5 | ||||
-rw-r--r-- | debugfs/logdump.c | 26 |
4 files changed, 22 insertions, 15 deletions
diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index 9964624c..a8d0c8f6 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,5 +1,7 @@ 2001-06-01 Theodore Tso <tytso@valinux.com> + * debugfs.c, debugfs.h, logdump.c: Fix various gcc -Wall nitpicks. + * logdump.c (read_journal_block): Replace pread with lseek/read combination. diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 7ec68493..d37599e0 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -388,7 +388,7 @@ static int list_blocks_proc(ext2_filsys fs, blk_t *blocknr, int blockcnt, } -static void dump_blocks(FILE *f, char *prefix, ext2_ino_t inode) +static void dump_blocks(FILE *f, const char *prefix, ext2_ino_t inode) { struct list_blocks_struct lb; @@ -406,7 +406,7 @@ static void dump_blocks(FILE *f, char *prefix, ext2_ino_t inode) } -void internal_dump_inode(FILE *out, char *prefix, +void internal_dump_inode(FILE *out, const char *prefix, ext2_ino_t inode_num, struct ext2_inode *inode, int do_dump_blocks) { diff --git a/debugfs/debugfs.h b/debugfs/debugfs.h index ed56a295..1cc308ad 100644 --- a/debugfs/debugfs.h +++ b/debugfs/debugfs.h @@ -31,6 +31,9 @@ extern void do_dump(int argc, char **argv); extern void do_cat(int argc, char **argv); extern void do_rdump(int argc, char **argv); +/* logdump.c */ +extern void do_logdump(int argc, char **argv); + /* lsdel.c */ extern void do_lsdel(int argc, char **argv); @@ -44,7 +47,7 @@ extern void do_ncheck(int argc, char **argv); extern void do_set_super(int argc, char **); /* debugfs.c */ -extern void internal_dump_inode(FILE *, char *, ext2_ino_t, +extern void internal_dump_inode(FILE *, const char *, ext2_ino_t, struct ext2_inode *, int); extern void do_dirty_filesys(int argc, char **argv); diff --git a/debugfs/logdump.c b/debugfs/logdump.c index 5bcd7ca9..c6f6fd6e 100644 --- a/debugfs/logdump.c +++ b/debugfs/logdump.c @@ -72,9 +72,7 @@ static void do_hexdump (FILE *, char *, int); void do_logdump(int argc, char **argv) { - ext2_ino_t inode; int c; - int fd; int retval; char *out_fn; FILE *out_file; @@ -92,12 +90,15 @@ void do_logdump(int argc, char **argv) "[-ac] [-b<block>] [-i<inode>] " "[-f<journal_file>] [output_file]"); - struct journal_source journal_source = {}; + struct journal_source journal_source; optind = 0; #ifdef HAVE_OPTRESET optreset = 1; /* Makes BSD getopt happy */ #endif + journal_source.where = 0; + journal_source.fd = 0; + journal_source.file = 0; dump_all = 0; dump_contents = 0; dump_descriptors = 1; @@ -243,8 +244,9 @@ void do_logdump(int argc, char **argv) } -int read_journal_block(char *cmd, struct journal_source *source, off_t offset, - char *buf, int size, int *got) +static int read_journal_block(const char *cmd, struct journal_source *source, + off_t offset, char *buf, int size, + unsigned int *got) { int retval; @@ -281,7 +283,7 @@ int read_journal_block(char *cmd, struct journal_source *source, off_t offset, return retval; } -static char *type_to_name(int btype) +static const char *type_to_name(int btype) { switch (btype) { case JFS_DESCRIPTOR_BLOCK: @@ -294,7 +296,6 @@ static char *type_to_name(int btype) return "V2 superblock"; case JFS_REVOKE_BLOCK: return "revoke table"; - default: } return "unrecognised type"; } @@ -307,7 +308,7 @@ static void dump_journal(char *cmdname, FILE *out_file, char buf[8192]; journal_superblock_t *jsb; int blocksize; - int got; + unsigned int got; int retval; __u32 magic, sequence, blocktype; journal_header_t *header; @@ -494,7 +495,7 @@ static void show_extent(FILE *out_file, int start_extent, int end_extent, start_extent, end_extent-start_extent, first_block); } -static void show_indirect(FILE *out_file, char *name, __u32 where) +static void show_indirect(FILE *out_file, const char *name, __u32 where) { if (where) fprintf(out_file, "(%s): %u ", name, where); @@ -508,8 +509,9 @@ static void dump_metadata_block(FILE *out_file, struct journal_source *source, int blocksize, tid_t transaction) { - int got, retval; - char buf[8192]; + unsigned int got; + int retval; + char buf[8192]; if (!(dump_all || (fs_blocknr == block_to_dump) @@ -576,7 +578,7 @@ static void dump_metadata_block(FILE *out_file, struct journal_source *source, * inode. */ fprintf (out_file, " Blocks: "); - start_extent = -1; + first = prev = start_extent = -1; for (i=0; i<EXT2_NDIR_BLOCKS; i++) { this = inode->i_block[i]; |