]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_logprint: report realtime CUIs
authorDarrick J. Wong <djwong@kernel.org>
Mon, 24 Feb 2025 18:22:06 +0000 (10:22 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 25 Feb 2025 17:16:02 +0000 (09:16 -0800)
Decode the CUI format just enough to report if an CUI targets the
realtime device or not.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
logprint/log_misc.c
logprint/log_print_all.c
logprint/log_redo.c

index aaa9598616a308ef967dde0bbf8b5c7005426a06..144695753211aa57c1d1ec8fc9f9eba426d7147a 100644 (file)
@@ -1027,12 +1027,14 @@ xlog_print_record(
                                        be32_to_cpu(op_head->oh_len));
                        break;
                    }
+                   case XFS_LI_CUI_RT:
                    case XFS_LI_CUI: {
                        skip = xlog_print_trans_cui(&ptr,
                                        be32_to_cpu(op_head->oh_len),
                                        continued);
                        break;
                    }
+                   case XFS_LI_CUD_RT:
                    case XFS_LI_CUD: {
                        skip = xlog_print_trans_cud(&ptr,
                                        be32_to_cpu(op_head->oh_len));
index 56e765d64f2df4d6ebac97c503917fc2633600d3..1498ef97247d3dcf040426f28dcb0e36ab82086e 100644 (file)
@@ -430,9 +430,11 @@ xlog_recover_print_logitem(
        case XFS_LI_RUI:
                xlog_recover_print_rui(item);
                break;
+       case XFS_LI_CUD_RT:
        case XFS_LI_CUD:
                xlog_recover_print_cud(item);
                break;
+       case XFS_LI_CUI_RT:
        case XFS_LI_CUI:
                xlog_recover_print_cui(item);
                break;
@@ -512,6 +514,12 @@ xlog_recover_print_item(
        case XFS_LI_CUI:
                printf("CUI");
                break;
+       case XFS_LI_CUD_RT:
+               printf("CUD_RT");
+               break;
+       case XFS_LI_CUI_RT:
+               printf("CUI_RT");
+               break;
        case XFS_LI_BUD:
                printf("BUD");
                break;
index a0cc558499ae0b78008cbaa5c8d7ba0420e6dafd..89d7448342b33d7b52666eb3a5993ccc288a90eb 100644 (file)
@@ -440,6 +440,7 @@ xlog_print_trans_cui(
        uint                    src_len,
        int                     continued)
 {
+       const char              *item_name = "CUI?";
        struct xfs_cui_log_format       *src_f, *f = NULL;
        uint                    dst_len;
        uint                    nextents;
@@ -480,8 +481,14 @@ xlog_print_trans_cui(
                goto error;
        }
 
-       printf(_("CUI:  #regs: %d       num_extents: %d  id: 0x%llx\n"),
-               f->cui_size, f->cui_nextents, (unsigned long long)f->cui_id);
+       switch (f->cui_type) {
+       case XFS_LI_CUI:        item_name = "CUI"; break;
+       case XFS_LI_CUI_RT:     item_name = "CUI_RT"; break;
+       }
+
+       printf(_("%s:  #regs: %d        num_extents: %d  id: 0x%llx\n"),
+                       item_name, f->cui_size, f->cui_nextents,
+                       (unsigned long long)f->cui_id);
 
        if (continued) {
                printf(_("CUI extent data skipped (CONTINUE set, no space)\n"));
@@ -520,6 +527,7 @@ xlog_print_trans_cud(
        char                            **ptr,
        uint                            len)
 {
+       const char                      *item_name = "CUD?";
        struct xfs_cud_log_format       *f;
        struct xfs_cud_log_format       lbuf;
 
@@ -528,11 +536,17 @@ xlog_print_trans_cud(
 
        memcpy(&lbuf, *ptr, min(core_size, len));
        f = &lbuf;
+
+       switch (f->cud_type) {
+       case XFS_LI_CUD:        item_name = "CUD"; break;
+       case XFS_LI_CUD_RT:     item_name = "CUD_RT"; break;
+       }
+
        *ptr += len;
        if (len >= core_size) {
-               printf(_("CUD:  #regs: %d                        id: 0x%llx\n"),
-                       f->cud_size,
-                       (unsigned long long)f->cud_cui_id);
+               printf(_("%s:  #regs: %d                         id: 0x%llx\n"),
+                               item_name, f->cud_size,
+                               (unsigned long long)f->cud_cui_id);
 
                /* don't print extents as they are not used */