Whamcloud - gitweb
Merge branch 'maint' into next
[tools/e2fsprogs.git] / debugfs / logdump.c
index 74b8935..6b0133e 100644 (file)
@@ -33,7 +33,14 @@ extern char *optarg;
 #include "debugfs.h"
 #include "blkid/blkid.h"
 #include "jfs_user.h"
+#if __GNUC_PREREQ (4, 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+#endif
 #include "ext2fs/fast_commit.h"
+#if __GNUC_PREREQ (4, 6)
+#pragma GCC diagnostic pop
+#endif
 #include <uuid/uuid.h>
 
 enum journal_location {JOURNAL_IS_INTERNAL, JOURNAL_IS_EXTERNAL};
@@ -56,18 +63,18 @@ static void dump_journal(char *, FILE *, struct journal_source *);
 
 static void dump_descriptor_block(FILE *, struct journal_source *,
                                  char *, journal_superblock_t *,
-                                 unsigned int *, int, __u32, tid_t);
+                                 unsigned int *, unsigned int, __u32, tid_t);
 
 static void dump_revoke_block(FILE *, char *, journal_superblock_t *,
-                                 unsigned int, int, tid_t);
+                                 unsigned int, unsigned int, tid_t);
 
 static void dump_metadata_block(FILE *, struct journal_source *,
                                journal_superblock_t*,
                                unsigned int, unsigned int, unsigned int,
-                               int, tid_t);
+                               unsigned int, tid_t);
 
 static void dump_fc_block(FILE *out_file, char *buf, int blocksize,
-                         int transaction, int *fc_done, int dump_old);
+                         tid_t transaction, int *fc_done);
 
 static void do_hexdump (FILE *, char *, int);
 
@@ -522,8 +529,7 @@ fc:
                if (retval)
                        return;
 
-               dump_fc_block(out_file, buf, blocksize, transaction, &fc_done,
-                       dump_old);
+               dump_fc_block(out_file, buf, blocksize, transaction, &fc_done);
                if (!dump_old && fc_done)
                        break;
                blocknr++;
@@ -549,7 +555,7 @@ static inline size_t journal_super_tag_bytes(journal_superblock_t *jsb)
 }
 
 static void dump_fc_block(FILE *out_file, char *buf, int blocksize,
-       int transaction, int *fc_done, int dump_old)
+                         tid_t transaction, int *fc_done)
 {
        struct ext4_fc_tl       tl;
        struct ext4_fc_head     *head;
@@ -643,11 +649,11 @@ static void dump_descriptor_block(FILE *out_file,
                                  struct journal_source *source,
                                  char *buf,
                                  journal_superblock_t *jsb,
-                                 unsigned int *blockp, int blocksize,
+                                 unsigned int *blockp, unsigned blocksize,
                                  __u32 maxlen,
                                  tid_t transaction)
 {
-       int                     offset, tag_size, csum_size = 0;
+       unsigned                offset, tag_size, csum_size = 0;
        char                    *tagp;
        journal_block_tag_t     *tag;
        unsigned int            blocknr;
@@ -703,10 +709,10 @@ static void dump_descriptor_block(FILE *out_file,
 static void dump_revoke_block(FILE *out_file, char *buf,
                              journal_superblock_t *jsb EXT2FS_ATTR((unused)),
                              unsigned int blocknr,
-                             int blocksize EXT2FS_ATTR((unused)),
+                             unsigned int blocksize,
                              tid_t transaction)
 {
-       int                     offset, max;
+       unsigned int            offset, max;
        jbd2_journal_revoke_header_t *header;
        unsigned long long      rblock;
        int                     tag_size = sizeof(__u32);
@@ -721,10 +727,10 @@ static void dump_revoke_block(FILE *out_file, char *buf,
        header = (jbd2_journal_revoke_header_t *) buf;
        offset = sizeof(jbd2_journal_revoke_header_t);
        max = be32_to_cpu(header->r_count);
-       if (max > be32_to_cpu(jsb->s_blocksize)) {
+       if (max > blocksize) {
                fprintf(out_file, "Revoke block's r_count invalid: %u\b",
                        max);
-               max = be32_to_cpu(jsb->s_blocksize);
+               max = blocksize;
        }
 
        while (offset < max) {
@@ -769,7 +775,7 @@ static void dump_metadata_block(FILE *out_file, struct journal_source *source,
                                unsigned int log_blocknr,
                                unsigned int fs_blocknr,
                                unsigned int log_tag_flags,
-                               int blocksize,
+                               unsigned int blocksize,
                                tid_t transaction)
 {
        int             retval;