]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_logprint: print all AGI unlinked buckets
authorDave Chinner <dchinner@redhat.com>
Thu, 9 May 2013 12:11:50 +0000 (07:11 -0500)
committerRich Johnston <rjohnston@sgi.com>
Thu, 9 May 2013 12:11:50 +0000 (07:11 -0500)
When printing buffer contents, the AGI unlinked buckets are not
printed in transactional output. In normal dump format, they are
printed, but that format is generally not useful for log recovery
analysis. Add the same code to the transactional buffer dump.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
logprint/log_print_all.c

index 69d6e719cb04458c0799957a440b4311daa6c3f7..2c45ff29055ea6c8c6779443dd48bfa03543105a 100644 (file)
@@ -122,6 +122,7 @@ xlog_recover_print_buffer(
                               be32_to_cpu(*(__be32 *)(p+56)),
                               be32_to_cpu(*(__be32 *)(p+60)));
                } else if (be32_to_cpu(*(__be32 *)p) == XFS_AGI_MAGIC) {
+                       int bucket, buckets;
                        agi = (xfs_agi_t *)p;
                        printf(_("      AGI Buffer: (XAGI)\n"));
                        if (!print_buffer) 
@@ -137,6 +138,24 @@ xlog_recover_print_buffer(
                                be32_to_cpu(agi->agi_level),
                                be32_to_cpu(agi->agi_freecount),
                                be32_to_cpu(agi->agi_newino));
+                       if (len == 128) {
+                               buckets = 17;
+                       } else if (len == 256) {
+                               buckets = 32 + 17;
+                       } else {
+                               buckets = XFS_AGI_UNLINKED_BUCKETS;
+                       }
+                       for (bucket = 0; bucket < buckets;) {
+                               int col;
+                               printf(_("bucket[%d - %d]: "), bucket, bucket+3);
+                               for (col = 0; col < 4; col++, bucket++) {
+                                       if (bucket < buckets) {
+                                               printf("0x%x ",
+                       be32_to_cpu(agi->agi_unlinked[bucket]));
+                                       }
+                               }
+                               printf("\n");
+                       }
                } else if (be32_to_cpu(*(__be32 *)p) == XFS_AGF_MAGIC) {
                        agf = (xfs_agf_t *)p;
                        printf(_("      AGF Buffer: (XAGF)\n"));