]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_logprint: remove the printing of transaction type
authorHou Tao <houtao1@huawei.com>
Mon, 19 Sep 2016 06:00:04 +0000 (16:00 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 19 Sep 2016 06:00:04 +0000 (16:00 +1000)
THe kernel stopped using meaningful types in transaction headers
when delayed logging was introduced. Since then the only transaction
type that reaches the journal is a "Checkpoint" type. Since then,
we've effectivey broken the transaction type printing for newer
kernels, and the current kernels don't even have transaction types
internally. Hence this logprint function is stale, broken, and
causing us problems.

This patch removes the transaction type parsing. If a user needs
this information from logprint, we can still build a binary from a
prior version that correctly decoded the transaction type (e.g.
3.2.1) for that purpose.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
logprint/log_misc.c
logprint/log_print_trans.c
logprint/logprint.h

index 479fc14c03bbf647dde51c73f244b21b20f5bc04..e4af09b2b000569b19d2cf7326f9e2881b6d9e1a 100644 (file)
 #define NO_ERROR       (0)
 
 static int logBBsize;
-char *trans_type[] = {
-       "",
-       "SETATTR",
-       "SETATTR_SIZE",
-       "INACTIVE",
-       "CREATE",
-       "CREATE_TRUNC",
-       "TRUNCATE_FILE",
-       "REMOVE",
-       "LINK",
-       "RENAME",
-       "MKDIR",
-       "RMDIR",
-       "SYMLINK",
-       "SET_DMATTRS",
-       "GROWFS",
-       "STRAT_WRITE",
-       "DIOSTRAT",
-       "WRITE_SYNC",
-       "WRITEID",
-       "ADDAFORK",
-       "ATTRINVAL",
-       "ATRUNCATE",
-       "ATTR_SET",
-       "ATTR_RM",
-       "ATTR_FLAG",
-       "CLEAR_AGI_BUCKET",
-       "QM_SBCHANGE",
-       "DUMMY1",
-       "DUMMY2",
-       "QM_QUOTAOFF",
-       "QM_DQALLOC",
-       "QM_SETQLIM",
-       "QM_DQCLUSTER",
-       "QM_QINOCREATE",
-       "QM_QUOTAOFF_END",
-       "SB_UNIT",
-       "FSYNC_TS",
-       "GROWFSRT_ALLOC",
-       "GROWFSRT_ZERO",
-       "GROWFSRT_FREE",
-       "SWAPEXT",
-       "SB_COUNT",
-       "CHECKPOINT",
-       "ICREATE",
-};
 
 typedef struct xlog_split_item {
        struct xlog_split_item  *si_next;
@@ -233,8 +187,8 @@ xlog_print_trans_header(char **ptr, int len)
        return 1;
     }
     h = (xfs_trans_header_t *)cptr;
-    printf(_("    type: %s       tid: %x       num_items: %d\n"),
-          trans_type[h->th_type], h->th_tid, h->th_num_items);
+    printf(_("     tid: %x  num_items: %d\n"),
+          h->th_tid, h->th_num_items);
     return 0;
 }      /* xlog_print_trans_header */
 
index 9bf2b3762a68b14e70832321473cb61c715d31f3..0fecbceaebb7be6d78c29894a4241a2e80b1a254 100644 (file)
@@ -24,8 +24,8 @@ void
 xlog_recover_print_trans_head(
        xlog_recover_t  *tr)
 {
-       printf(_("TRANS: tid:0x%x  type:%s  #items:%d  trans:0x%x  q:0x%lx\n"),
-              tr->r_log_tid, trans_type[tr->r_theader.th_type],
+       printf(_("TRANS: tid:0x%x  #items:%d  trans:0x%x  q:0x%lx\n"),
+              tr->r_log_tid,
               tr->r_theader.th_num_items,
               tr->r_theader.th_tid, (long)&tr->r_itemq);
 }
index 0c03c08f9cf4653af159feb0bc07faa5678df554..bdd0ee1138416f44c98b7b28819c00dc8d16f9b8 100644 (file)
@@ -30,8 +30,6 @@ extern int    print_no_data;
 extern int     print_no_print;
 
 /* exports */
-extern char *trans_type[];
-
 extern void xlog_print_lseek(struct xlog *, int, xfs_daddr_t, int);
 
 extern void xfs_log_copy(struct xlog *, int, char *);