}
-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;
}
-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)
{
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);
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);
void do_logdump(int argc, char **argv)
{
- ext2_ino_t inode;
int c;
- int fd;
int retval;
char *out_fn;
FILE *out_file;
"[-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;
}
-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;
return retval;
}
-static char *type_to_name(int btype)
+static const char *type_to_name(int btype)
{
switch (btype) {
case JFS_DESCRIPTOR_BLOCK:
return "V2 superblock";
case JFS_REVOKE_BLOCK:
return "revoke table";
- default:
}
return "unrecognised type";
}
char buf[8192];
journal_superblock_t *jsb;
int blocksize;
- int got;
+ unsigned int got;
int retval;
__u32 magic, sequence, blocktype;
journal_header_t *header;
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);
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)
* 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];