]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - logprint/log_misc.c
apply gettext translation to more strings
[thirdparty/xfsprogs-dev.git] / logprint / log_misc.c
index 025cd7cc4c92a8623bd89171e9c622813221b42c..253e146a29779782b6db84353acd67add72586dc 100644 (file)
@@ -25,6 +25,8 @@
 #define BAD_HEADER     (-1)
 #define NO_ERROR       (0)
 
+#define XLOG_SET(f,b)  (((f) & (b)) == (b))
+
 static int logBBsize;
 char *trans_type[] = {
        "",
@@ -78,7 +80,7 @@ typedef struct xlog_split_item {
        int                     si_skip;
 } xlog_split_item_t;
 
-xlog_split_item_t *split_list = 0;
+xlog_split_item_t *split_list = NULL;
 
 void
 print_xlog_op_line(void)
@@ -126,12 +128,12 @@ xlog_print_op_header(xlog_op_header_t     *op_head,
     memmove(&hbuf, op_head, sizeof(xlog_op_header_t));
     op_head = &hbuf;
     *ptr += sizeof(xlog_op_header_t);
-    printf("Oper (%d): tid: %x  len: %d  clientid: %s  ", i,
-           INT_GET(op_head->oh_tid, ARCH_CONVERT),
-           INT_GET(op_head->oh_len, ARCH_CONVERT),
+    printf(_("Oper (%d): tid: %x  len: %d  clientid: %s  "), i,
+           be32_to_cpu(op_head->oh_tid),
+           be32_to_cpu(op_head->oh_len),
            (op_head->oh_clientid == XFS_TRANSACTION ? "TRANS" :
            (op_head->oh_clientid == XFS_LOG ? "LOG" : "ERROR")));
-    printf("flags: ");
+    printf(_("flags: "));
     if (op_head->oh_flags) {
        if (op_head->oh_flags & XLOG_START_TRANS)
            printf("START ");
@@ -146,7 +148,7 @@ xlog_print_op_header(xlog_op_header_t       *op_head,
        if (op_head->oh_flags & XLOG_END_TRANS)
            printf("END ");
     } else {
-       printf("none");
+       printf(_("none"));
     }
     printf("\n");
 }      /* xlog_print_op_header */
@@ -162,7 +164,7 @@ xlog_print_add_to_trans(xlog_tid_t  tid,
     item->si_tid  = tid;
     item->si_skip = skip;
     item->si_next = split_list;
-    item->si_prev = 0;
+    item->si_prev = NULL;
     if (split_list)
        split_list->si_prev = item;
     split_list   = item;
@@ -213,7 +215,7 @@ xlog_print_trans_header(xfs_caddr_t *ptr, int len)
 
     *ptr += len;
 
-    magic=*(__uint32_t*)cptr; /* XXX INT_GET soon */
+    magic=*(__uint32_t*)cptr; /* XXX be32_to_cpu soon */
 
     if (len >= 4) {
 #if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -225,11 +227,11 @@ xlog_print_trans_header(xfs_caddr_t *ptr, int len)
 #endif
     }
     if (len != sizeof(xfs_trans_header_t)) {
-       printf("   Not enough data to decode further\n");
+       printf(_("   Not enough data to decode further\n"));
        return 1;
     }
     h = (xfs_trans_header_t *)cptr;
-    printf("    type: %s       tid: %x       num_items: %d\n",
+    printf(_("    type: %s       tid: %x       num_items: %d\n"),
           trans_type[h->th_type], h->th_tid, h->th_num_items);
     return 0;
 }      /* xlog_print_trans_header */
@@ -239,18 +241,17 @@ int
 xlog_print_trans_buffer(xfs_caddr_t *ptr, int len, int *i, int num_ops)
 {
     xfs_buf_log_format_t *f;
-    xfs_buf_log_format_v1_t *old_f;
     xfs_agi_t           *agi;
     xfs_agf_t           *agf;
     xfs_disk_dquot_t    *dq;
-    xlog_op_header_t    *head = 0;
+    xlog_op_header_t    *head = NULL;
     int                         num, skip;
     int                         super_block = 0;
     int                         bucket, col, buckets;
     __int64_t           blkno;
     xfs_buf_log_format_t lbuf;
     int                         size, blen, map_size, struct_size;
-    long long           x, y;
+    __be64              x, y;
     ushort              flags;
 
     /*
@@ -261,45 +262,24 @@ xlog_print_trans_buffer(xfs_caddr_t *ptr, int len, int *i, int num_ops)
     f = &lbuf;
     *ptr += len;
 
-    if (f->blf_type == XFS_LI_BUF) {
-       blkno = f->blf_blkno;
-       size = f->blf_size;
-       blen = f->blf_len;
-       map_size = f->blf_map_size;
-        flags = f->blf_flags;
-       struct_size = sizeof(xfs_buf_log_format_t);
-    } else {
-       old_f = (xfs_buf_log_format_v1_t*)f;
-       blkno = old_f->blf_blkno;
-       size = old_f->blf_size;
-       blen = old_f->blf_len;
-       map_size = old_f->blf_map_size;
-        flags = f->blf_flags;
-       struct_size = sizeof(xfs_buf_log_format_v1_t);
-    }
-    switch (f->blf_type)  {
-    case XFS_LI_BUF:
-       printf("BUF:  ");
-       break;
-    case XFS_LI_6_1_BUF:
-       printf("6.1 BUF:  ");
-       break;
-    case XFS_LI_5_3_BUF:
-       printf("5.3 BUF:  ");
-       break;
-    default:
-       printf("UNKNOWN BUF:  ");
-       break;
-    }
+    ASSERT(f->blf_type == XFS_LI_BUF);
+    printf("BUF:  ");
+    blkno = f->blf_blkno;
+    size = f->blf_size;
+    blen = f->blf_len;
+    map_size = f->blf_map_size;
+    flags = f->blf_flags;
+    struct_size = sizeof(xfs_buf_log_format_t);
+
     if (len >= struct_size) {
        ASSERT((len - sizeof(struct_size)) % sizeof(int) == 0);
-       printf("#regs: %d   start blkno: %lld (0x%llx)  len: %d  bmap size: %d  flags: 0x%x\n",
+       printf(_("#regs: %d   start blkno: %lld (0x%llx)  len: %d  bmap size: %d  flags: 0x%x\n"),
               size, (long long)blkno, (unsigned long long)blkno, blen, map_size, flags);
        if (blkno == 0)
            super_block = 1;
     } else {
        ASSERT(len >= 4);       /* must have at least 4 bytes if != 0 */
-       printf("#regs: %d   Not printing rest of data\n", f->blf_size);
+       printf(_("#regs: %d   Not printing rest of data\n"), f->blf_size);
        return size;
     }
     num = size-1;
@@ -316,137 +296,123 @@ xlog_print_trans_buffer(xfs_caddr_t *ptr, int len, int *i, int num_ops)
        head = (xlog_op_header_t *)*ptr;
        xlog_print_op_header(head, *i, ptr);
        if (super_block) {
-               printf("SUPER BLOCK Buffer: ");
-               if (INT_GET(head->oh_len, ARCH_CONVERT) < 4*8) {
-                       printf("Out of space\n");
+               printf(_("SUPER BLOCK Buffer: "));
+               if (be32_to_cpu(head->oh_len) < 4*8) {
+                       printf(_("Out of space\n"));
                } else {
                        printf("\n");
                        /*
                         * memmove because *ptr may not be 8-byte aligned
                         */
-                       memmove(&x, *ptr, sizeof(long long));
-                       memmove(&y, *ptr+8, sizeof(long long));
-                       printf("icount: %lld  ifree: %lld  ",
-                               INT_GET(x, ARCH_CONVERT),
-                               INT_GET(y, ARCH_CONVERT));
-                       memmove(&x, *ptr+16, sizeof(long long));
-                       memmove(&y, *ptr+24, sizeof(long long));
-                       printf("fdblks: %lld  frext: %lld\n",
-                               INT_GET(x, ARCH_CONVERT),
-                               INT_GET(y, ARCH_CONVERT));
+                       memmove(&x, *ptr, sizeof(__be64));
+                       memmove(&y, *ptr+8, sizeof(__be64));
+                       printf(_("icount: %lld  ifree: %lld  "),
+                               be64_to_cpu(x), be64_to_cpu(y));
+                       memmove(&x, *ptr+16, sizeof(__be64));
+                       memmove(&y, *ptr+24, sizeof(__be64));
+                       printf(_("fdblks: %lld  frext: %lld\n"),
+                               be64_to_cpu(x), be64_to_cpu(y));
                }
                super_block = 0;
-       } else if (INT_GET(*(uint *)(*ptr), ARCH_CONVERT) == XFS_AGI_MAGIC) {
+       } else if (be32_to_cpu(*(__be32 *)(*ptr)) == XFS_AGI_MAGIC) {
                agi = (xfs_agi_t *)(*ptr);
-               printf("AGI Buffer: XAGI  ");
-               if (INT_GET(head->oh_len, ARCH_CONVERT) <
-                   sizeof(xfs_agi_t) -
-                   XFS_AGI_UNLINKED_BUCKETS*sizeof(xfs_agino_t)) {
-                       printf("out of space\n");
+               printf(_("AGI Buffer: XAGI  "));
+               if (be32_to_cpu(head->oh_len) < sizeof(xfs_agi_t) -
+                               XFS_AGI_UNLINKED_BUCKETS*sizeof(xfs_agino_t)) {
+                       printf(_("out of space\n"));
                } else {
                        printf("\n");
-                       printf("ver: %d  ",
-                               INT_GET(agi->agi_versionnum, ARCH_CONVERT));
-                       printf("seq#: %d  len: %d  cnt: %d  root: %d\n",
-                               INT_GET(agi->agi_seqno, ARCH_CONVERT),
-                               INT_GET(agi->agi_length, ARCH_CONVERT),
-                               INT_GET(agi->agi_count, ARCH_CONVERT),
-                               INT_GET(agi->agi_root, ARCH_CONVERT));
-                       printf("level: %d  free#: 0x%x  newino: 0x%x\n",
-                               INT_GET(agi->agi_level, ARCH_CONVERT),
-                               INT_GET(agi->agi_freecount, ARCH_CONVERT),
-                               INT_GET(agi->agi_newino, ARCH_CONVERT));
-                       if (INT_GET(head->oh_len, ARCH_CONVERT) == 128) {
+                       printf(_("ver: %d  "),
+                               be32_to_cpu(agi->agi_versionnum));
+                       printf(_("seq#: %d  len: %d  cnt: %d  root: %d\n"),
+                               be32_to_cpu(agi->agi_seqno),
+                               be32_to_cpu(agi->agi_length),
+                               be32_to_cpu(agi->agi_count),
+                               be32_to_cpu(agi->agi_root));
+                       printf(_("level: %d  free#: 0x%x  newino: 0x%x\n"),
+                               be32_to_cpu(agi->agi_level),
+                               be32_to_cpu(agi->agi_freecount),
+                               be32_to_cpu(agi->agi_newino));
+                       if (be32_to_cpu(head->oh_len) == 128) {
                                buckets = 17;
-                       } else if (INT_GET(head->oh_len, ARCH_CONVERT) == 256) {
+                       } else if (be32_to_cpu(head->oh_len) == 256) {
                                buckets = 32 + 17;
                        } else {
                                if (head->oh_flags & XLOG_CONTINUE_TRANS) {
-                                       printf("AGI unlinked data skipped ");
-                                       printf("(CONTINUE set, no space)\n");
+                                       printf(_("AGI unlinked data skipped "));
+                                       printf(_("(CONTINUE set, no space)\n"));
                                        continue;
                                }
                                buckets = XFS_AGI_UNLINKED_BUCKETS;
                        }
                        for (bucket = 0; bucket < buckets;) {
-                               printf("bucket[%d - %d]: ", bucket, bucket+3);
+                               printf(_("bucket[%d - %d]: "), bucket, bucket+3);
                                for (col = 0; col < 4; col++, bucket++) {
                                        if (bucket < buckets) {
                                                printf("0x%x ",
-                       INT_GET(agi->agi_unlinked[bucket], ARCH_CONVERT));
+                       be32_to_cpu(agi->agi_unlinked[bucket]));
                                        }
                                }
                                printf("\n");
                        }
                }
-       } else if (INT_GET(*(uint *)(*ptr), ARCH_CONVERT) == XFS_AGF_MAGIC) {
+       } else if (be32_to_cpu(*(__be32 *)(*ptr)) == XFS_AGF_MAGIC) {
                agf = (xfs_agf_t *)(*ptr);
-               printf("AGF Buffer: XAGF  ");
-               if (INT_GET(head->oh_len, ARCH_CONVERT) < sizeof(xfs_agf_t)) {
-                       printf("Out of space\n");
+               printf(_("AGF Buffer: XAGF  "));
+               if (be32_to_cpu(head->oh_len) < sizeof(xfs_agf_t)) {
+                       printf(_("Out of space\n"));
                } else {
                        printf("\n");
-                       printf("ver: %d  seq#: %d  len: %d  \n",
-                               INT_GET(agf->agf_versionnum, ARCH_CONVERT),
-                               INT_GET(agf->agf_seqno, ARCH_CONVERT),
-                               INT_GET(agf->agf_length, ARCH_CONVERT));
-                       printf("root BNO: %d  CNT: %d\n",
-                               INT_GET(agf->agf_roots[XFS_BTNUM_BNOi],
-                                       ARCH_CONVERT),
-                               INT_GET(agf->agf_roots[XFS_BTNUM_CNTi],
-                                       ARCH_CONVERT));
-                       printf("level BNO: %d  CNT: %d\n",
-                               INT_GET(agf->agf_levels[XFS_BTNUM_BNOi],
-                                       ARCH_CONVERT),
-                               INT_GET(agf->agf_levels[XFS_BTNUM_CNTi],
-                                       ARCH_CONVERT));
-                       printf("1st: %d  last: %d  cnt: %d  "
-                              "freeblks: %d  longest: %d\n",
-                               INT_GET(agf->agf_flfirst, ARCH_CONVERT),
-                               INT_GET(agf->agf_fllast, ARCH_CONVERT),
-                               INT_GET(agf->agf_flcount, ARCH_CONVERT),
-                               INT_GET(agf->agf_freeblks, ARCH_CONVERT),
-                               INT_GET(agf->agf_longest, ARCH_CONVERT));
+                       printf(_("ver: %d  seq#: %d  len: %d  \n"),
+                               be32_to_cpu(agf->agf_versionnum),
+                               be32_to_cpu(agf->agf_seqno),
+                               be32_to_cpu(agf->agf_length));
+                       printf(_("root BNO: %d  CNT: %d\n"),
+                               be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNOi]),
+                               be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNTi]));
+                       printf(_("level BNO: %d  CNT: %d\n"),
+                               be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNOi]),
+                               be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi]));
+                       printf(_("1st: %d  last: %d  cnt: %d  "
+                              "freeblks: %d  longest: %d\n"),
+                               be32_to_cpu(agf->agf_flfirst),
+                               be32_to_cpu(agf->agf_fllast),
+                               be32_to_cpu(agf->agf_flcount),
+                               be32_to_cpu(agf->agf_freeblks),
+                               be32_to_cpu(agf->agf_longest));
                }
-       } else if (INT_GET(*(uint *)(*ptr), ARCH_CONVERT) == XFS_DQUOT_MAGIC) {
+       } else if (be32_to_cpu(*(__be32 *)(*ptr)) == XFS_DQUOT_MAGIC) {
                dq = (xfs_disk_dquot_t *)(*ptr);
-               printf("DQUOT Buffer: DQ  ");
-               if (INT_GET(head->oh_len, ARCH_CONVERT) <
+               printf(_("DQUOT Buffer: DQ  "));
+               if (be32_to_cpu(head->oh_len) <
                                sizeof(xfs_disk_dquot_t)) {
-                       printf("Out of space\n");
+                       printf(_("Out of space\n"));
                }
                else {
                        printf("\n");
-                       printf("ver: %d  flags: 0x%x  id: %d  \n",
-                               INT_GET(dq->d_version, ARCH_CONVERT),
-                               INT_GET(dq->d_flags, ARCH_CONVERT),
-                               INT_GET(dq->d_id, ARCH_CONVERT));
-                       printf("blk limits  hard: %llu  soft: %llu\n",
-                               (unsigned long long)
-                               INT_GET(dq->d_blk_hardlimit, ARCH_CONVERT),
-                               (unsigned long long)
-                               INT_GET(dq->d_blk_softlimit, ARCH_CONVERT));
-                       printf("blk  count: %llu  warns: %d  timer: %d\n",
-                               (unsigned long long)
-                               INT_GET(dq->d_bcount, ARCH_CONVERT),
-                               INT_GET(dq->d_bwarns, ARCH_CONVERT),
-                               INT_GET(dq->d_btimer, ARCH_CONVERT));
-                       printf("ino limits  hard: %llu  soft: %llu\n",
-                               (unsigned long long)
-                               INT_GET(dq->d_ino_hardlimit, ARCH_CONVERT),
-                               (unsigned long long)
-                               INT_GET(dq->d_ino_softlimit, ARCH_CONVERT));
-                       printf("ino  count: %llu  warns: %d  timer: %d\n",
-                               (unsigned long long)
-                               INT_GET(dq->d_icount, ARCH_CONVERT),
-                               INT_GET(dq->d_iwarns, ARCH_CONVERT),
-                               INT_GET(dq->d_itimer, ARCH_CONVERT));
+                       printf(_("ver: %d  flags: 0x%x  id: %d  \n"),
+                               dq->d_version, dq->d_flags,
+                               be32_to_cpu(dq->d_id));
+                       printf(_("blk limits  hard: %llu  soft: %llu\n"),
+                               be64_to_cpu(dq->d_blk_hardlimit),
+                               be64_to_cpu(dq->d_blk_softlimit));
+                       printf(_("blk  count: %llu  warns: %d  timer: %d\n"),
+                               be64_to_cpu(dq->d_bcount),
+                               be16_to_cpu(dq->d_bwarns),
+                               be32_to_cpu(dq->d_btimer));
+                       printf(_("ino limits  hard: %llu  soft: %llu\n"),
+                               be64_to_cpu(dq->d_ino_hardlimit),
+                               be64_to_cpu(dq->d_ino_softlimit));
+                       printf(_("ino  count: %llu  warns: %d  timer: %d\n"),
+                               be64_to_cpu(dq->d_icount),
+                               be16_to_cpu(dq->d_iwarns),
+                               be32_to_cpu(dq->d_itimer));
                }
        } else {
-               printf("BUF DATA\n");
+               printf(_("BUF DATA\n"));
                if (print_data) {
                        uint *dp  = (uint *)*ptr;
-                       int  nums = INT_GET(head->oh_len, ARCH_CONVERT) >> 2;
+                       int  nums = be32_to_cpu(head->oh_len) >> 2;
                        int  i = 0;
 
                        while (i < nums) {
@@ -461,7 +427,7 @@ xlog_print_trans_buffer(xfs_caddr_t *ptr, int len, int *i, int num_ops)
                        printf("\n");
                }
        }
-       *ptr += INT_GET(head->oh_len, ARCH_CONVERT);
+       *ptr += be32_to_cpu(head->oh_len);
     }
     if (head && head->oh_flags & XLOG_CONTINUE_TRANS)
        skip++;
@@ -485,14 +451,14 @@ xlog_print_trans_efd(xfs_caddr_t *ptr, uint len)
     f = &lbuf;
     *ptr += len;
     if (len >= core_size) {
-       printf("EFD:  #regs: %d    num_extents: %d  id: 0x%llx\n",
+       printf(_("EFD:  #regs: %d    num_extents: %d  id: 0x%llx\n"),
               f->efd_size, f->efd_nextents, (unsigned long long)f->efd_efi_id);
 
        /* don't print extents as they are not used */
 
        return 0;
     } else {
-       printf("EFD: Not enough data to decode further\n");
+       printf(_("EFD: Not enough data to decode further\n"));
        return 1;
     }
 }      /* xlog_print_trans_efd */
@@ -512,7 +478,7 @@ xlog_print_trans_efi(xfs_caddr_t *ptr, uint src_len)
      * xfs_efi_log_format_t structure
      */
     if ((src_f = (xfs_efi_log_format_t *)malloc(src_len)) == NULL) {
-       fprintf(stderr, "%s: xlog_print_trans_efi: malloc failed\n", progname);
+       fprintf(stderr, _("%s: xlog_print_trans_efi: malloc failed\n"), progname);
        exit(1);
     }
     memmove((char*)src_f, *ptr, src_len);
@@ -521,7 +487,7 @@ xlog_print_trans_efi(xfs_caddr_t *ptr, uint src_len)
     /* convert to native format */
     dst_len = sizeof(xfs_efi_log_format_t) + (src_f->efi_nextents - 1) * sizeof(xfs_extent_t);
     if ((f = (xfs_efi_log_format_t *)malloc(dst_len)) == NULL) {
-       fprintf(stderr, "%s: xlog_print_trans_efi: malloc failed\n", progname);
+       fprintf(stderr, _("%s: xlog_print_trans_efi: malloc failed\n"), progname);
        exit(1);
     }
     if (xfs_efi_copy_format((char*)src_f, src_len, f)) {
@@ -529,7 +495,7 @@ xlog_print_trans_efi(xfs_caddr_t *ptr, uint src_len)
        goto error;
     }
 
-    printf("EFI:  #regs: %d    num_extents: %d  id: 0x%llx\n",
+    printf(_("EFI:  #regs: %d    num_extents: %d  id: 0x%llx\n"),
           f->efi_size, f->efi_nextents, (unsigned long long)f->efi_id);
     ex = f->efi_extents;
     for (i=0; i < f->efi_nextents; i++) {
@@ -556,33 +522,33 @@ xlog_print_trans_qoff(xfs_caddr_t *ptr, uint len)
     f = &lbuf;
     *ptr += len;
     if (len >= sizeof(xfs_qoff_logformat_t)) {
-       printf("QOFF:  #regs: %d    flags: 0x%x\n", f->qf_size, f->qf_flags);
+       printf(_("QOFF:  #regs: %d    flags: 0x%x\n"), f->qf_size, f->qf_flags);
        return 0;
     } else {
-       printf("QOFF: Not enough data to decode further\n");
+       printf(_("QOFF: Not enough data to decode further\n"));
        return 1;
     }
 }      /* xlog_print_trans_qoff */
 
 
 void
-xlog_print_trans_inode_core(xfs_dinode_core_t *ip)
+xlog_print_trans_inode_core(xfs_icdinode_t *ip)
 {
-    printf("INODE CORE\n");
-    printf("magic 0x%hx mode 0%ho version %d format %d\n",
+    printf(_("INODE CORE\n"));
+    printf(_("magic 0x%hx mode 0%ho version %d format %d\n"),
           ip->di_magic, ip->di_mode, (int)ip->di_version,
           (int)ip->di_format);
-    printf("nlink %hd uid %d gid %d\n",
+    printf(_("nlink %hd uid %d gid %d\n"),
           ip->di_nlink, ip->di_uid, ip->di_gid);
-    printf("atime 0x%x mtime 0x%x ctime 0x%x\n",
+    printf(_("atime 0x%x mtime 0x%x ctime 0x%x\n"),
           ip->di_atime.t_sec, ip->di_mtime.t_sec, ip->di_ctime.t_sec);
-    printf("size 0x%llx nblocks 0x%llx extsize 0x%x nextents 0x%x\n",
+    printf(_("size 0x%llx nblocks 0x%llx extsize 0x%x nextents 0x%x\n"),
           (unsigned long long)ip->di_size, (unsigned long long)ip->di_nblocks,
           ip->di_extsize, ip->di_nextents);
-    printf("naextents 0x%x forkoff %d dmevmask 0x%x dmstate 0x%hx\n",
+    printf(_("naextents 0x%x forkoff %d dmevmask 0x%x dmstate 0x%hx\n"),
           ip->di_anextents, (int)ip->di_forkoff, ip->di_dmevmask,
           ip->di_dmstate);
-    printf("flags 0x%x gen 0x%x\n",
+    printf(_("flags 0x%x gen 0x%x\n"),
           ip->di_flags, ip->di_gen);
 }
 
@@ -598,16 +564,16 @@ xlog_print_dir_sf(xfs_dir_shortform_t *sfp, int size)
        /* XXX need to determine whether this is v1 or v2, then
           print appropriate structure */
 
-       printf("SHORTFORM DIRECTORY size %d\n",
+       printf(_("SHORTFORM DIRECTORY size %d\n"),
                size);
        /* bail out for now */
 
        return;
 
-       printf("SHORTFORM DIRECTORY size %d count %d\n",
+       printf(_("SHORTFORM DIRECTORY size %d count %d\n"),
               size, sfp->hdr.count);
        memmove(&ino, &(sfp->hdr.parent), sizeof(ino));
-       printf(".. ino 0x%llx\n", (unsigned long long)INT_GET(ino, ARCH_CONVERT));
+       printf(_(".. ino 0x%llx\n"), be64_to_cpu(*(__be64 *)&ino));
 
        count = (uint)(sfp->hdr.count);
        sfep = &(sfp->list[0]);
@@ -615,16 +581,16 @@ xlog_print_dir_sf(xfs_dir_shortform_t *sfp, int size)
                memmove(&ino, &(sfep->inumber), sizeof(ino));
                memmove(namebuf, (sfep->name), sfep->namelen);
                namebuf[sfep->namelen] = '\0';
-               printf("%s ino 0x%llx namelen %d\n",
+               printf(_("%s ino 0x%llx namelen %d\n"),
                       namebuf, (unsigned long long)ino, sfep->namelen);
-               sfep = XFS_DIR_SF_NEXTENTRY(sfep);
+               sfep = xfs_dir_sf_nextentry(sfep);
        }
 }
 
 int
 xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops)
 {
-    xfs_dinode_core_t     dino;
+    xfs_icdinode_t        dino;
     xlog_op_header_t      *op_head;
     xfs_inode_log_format_t dst_lbuf;
     xfs_inode_log_format_64_t src_lbuf; /* buffer of biggest one */
@@ -647,16 +613,16 @@ xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops)
     if (len == sizeof(xfs_inode_log_format_32_t) ||
        len == sizeof(xfs_inode_log_format_64_t)) {
        f = xfs_inode_item_format_convert((char*)&src_lbuf, len, &dst_lbuf);
-       printf("INODE: ");
-       printf("#regs: %d   ino: 0x%llx  flags: 0x%x   dsize: %d\n",
+       printf(_("INODE: "));
+       printf(_("#regs: %d   ino: 0x%llx  flags: 0x%x   dsize: %d\n"),
               f->ilf_size, (unsigned long long)f->ilf_ino,
               f->ilf_fields, f->ilf_dsize);
-       printf("        blkno: %lld  len: %d  boff: %d\n",
+       printf(_("        blkno: %lld  len: %d  boff: %d\n"),
               (long long)f->ilf_blkno, f->ilf_len, f->ilf_boffset);
     } else {
        ASSERT(len >= 4);       /* must have at least 4 bytes if != 0 */
        f = (xfs_inode_log_format_t *)&src_lbuf;
-       printf("INODE: #regs: %d   Not printing rest of data\n",
+       printf(_("INODE: #regs: %d   Not printing rest of data\n"),
               f->ilf_size);
        return f->ilf_size;
     }
@@ -689,8 +655,8 @@ xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops)
            ASSERT(f->ilf_size == 3);
            (*i)++;
            xlog_print_op_header(op_head, *i, ptr);
-           printf("EXTENTS inode data\n");
-           *ptr += INT_GET(op_head->oh_len, ARCH_CONVERT);
+           printf(_("EXTENTS inode data\n"));
+           *ptr += be32_to_cpu(op_head->oh_len);
            if (XLOG_SET(op_head->oh_flags, XLOG_CONTINUE_TRANS))  {
                return 1;
            }
@@ -700,8 +666,8 @@ xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops)
            ASSERT(f->ilf_size == 3);
            (*i)++;
            xlog_print_op_header(op_head, *i, ptr);
-           printf("BTREE inode data\n");
-           *ptr += INT_GET(op_head->oh_len, ARCH_CONVERT);
+           printf(_("BTREE inode data\n"));
+           *ptr += be32_to_cpu(op_head->oh_len);
            if (XLOG_SET(op_head->oh_flags, XLOG_CONTINUE_TRANS))  {
                return 1;
            }
@@ -711,11 +677,11 @@ xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops)
            ASSERT(f->ilf_size == 3);
            (*i)++;
            xlog_print_op_header(op_head, *i, ptr);
-           printf("LOCAL inode data\n");
+           printf(_("LOCAL inode data\n"));
            if (mode == S_IFDIR) {
                xlog_print_dir_sf((xfs_dir_shortform_t*)*ptr, size);
            }
-           *ptr += INT_GET(op_head->oh_len, ARCH_CONVERT);
+           *ptr += be32_to_cpu(op_head->oh_len);
            if (XLOG_SET(op_head->oh_flags, XLOG_CONTINUE_TRANS)) {
                return 1;
            }
@@ -725,8 +691,8 @@ xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops)
            ASSERT(f->ilf_size == 3);
            (*i)++;
            xlog_print_op_header(op_head, *i, ptr);
-           printf("EXTENTS inode attr\n");
-           *ptr += INT_GET(op_head->oh_len, ARCH_CONVERT);
+           printf(_("EXTENTS inode attr\n"));
+           *ptr += be32_to_cpu(op_head->oh_len);
            if (XLOG_SET(op_head->oh_flags, XLOG_CONTINUE_TRANS))  {
                return 1;
            }
@@ -736,8 +702,8 @@ xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops)
            ASSERT(f->ilf_size == 3);
            (*i)++;
            xlog_print_op_header(op_head, *i, ptr);
-           printf("BTREE inode attr\n");
-           *ptr += INT_GET(op_head->oh_len, ARCH_CONVERT);
+           printf(_("BTREE inode attr\n"));
+           *ptr += be32_to_cpu(op_head->oh_len);
            if (XLOG_SET(op_head->oh_flags, XLOG_CONTINUE_TRANS))  {
                return 1;
            }
@@ -747,11 +713,11 @@ xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops)
            ASSERT(f->ilf_size == 3);
            (*i)++;
            xlog_print_op_header(op_head, *i, ptr);
-           printf("LOCAL inode attr\n");
+           printf(_("LOCAL inode attr\n"));
            if (mode == S_IFDIR) {
                xlog_print_dir_sf((xfs_dir_shortform_t*)*ptr, size);
            }
-           *ptr += INT_GET(op_head->oh_len, ARCH_CONVERT);
+           *ptr += be32_to_cpu(op_head->oh_len);
            if (XLOG_SET(op_head->oh_flags, XLOG_CONTINUE_TRANS)) {
                return 1;
            }
@@ -759,12 +725,12 @@ xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops)
        }
        case XFS_ILOG_DEV: {
            ASSERT(f->ilf_size == 2);
-           printf("DEV inode: no extra region\n");
+           printf(_("DEV inode: no extra region\n"));
            break;
        }
        case XFS_ILOG_UUID: {
            ASSERT(f->ilf_size == 2);
-           printf("UUID inode: no extra region\n");
+           printf(_("UUID inode: no extra region\n"));
            break;
        }
        case 0: {
@@ -772,7 +738,7 @@ xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops)
            break;
        }
        default: {
-           xlog_panic("xlog_print_trans_inode: illegal inode type");
+           xlog_panic(_("xlog_print_trans_inode: illegal inode type"));
        }
     }
     return 0;
@@ -800,12 +766,12 @@ xlog_print_trans_dquot(xfs_caddr_t *ptr, int len, int *i, int num_ops)
     *ptr += len;
 
     if (len == sizeof(xfs_dq_logformat_t)) {
-       printf("#regs: %d   id: 0x%x", f->qlf_size, f->qlf_id);
-       printf("  blkno: %lld  len: %d  boff: %d\n",
+       printf(_("#regs: %d   id: 0x%x"), f->qlf_size, f->qlf_id);
+       printf(_("  blkno: %lld  len: %d  boff: %d\n"),
                (long long)f->qlf_blkno, f->qlf_len, f->qlf_boffset);
     } else {
        ASSERT(len >= 4);       /* must have at least 4 bytes if != 0 */
-       printf("DQUOT: #regs: %d   Not printing rest of data\n",
+       printf(_("DQUOT: #regs: %d   Not printing rest of data\n"),
                f->qlf_size);
        return f->qlf_size;
     }
@@ -822,12 +788,11 @@ xlog_print_trans_dquot(xfs_caddr_t *ptr, int len, int *i, int num_ops)
     while (num-- > 0) {
        head = (xlog_op_header_t *)*ptr;
        xlog_print_op_header(head, *i, ptr);
-       ASSERT(INT_GET(head->oh_len, ARCH_CONVERT) == sizeof(xfs_disk_dquot_t));
+       ASSERT(be32_to_cpu(head->oh_len) == sizeof(xfs_disk_dquot_t));
        memmove(&ddq, *ptr, sizeof(xfs_disk_dquot_t));
-       printf("DQUOT: magic 0x%hx flags 0%ho\n",
-              INT_GET(ddq.d_magic, ARCH_CONVERT),
-              INT_GET(ddq.d_flags, ARCH_CONVERT));
-       *ptr += INT_GET(head->oh_len, ARCH_CONVERT);
+       printf(_("DQUOT: magic 0x%hx flags 0%ho\n"),
+              be16_to_cpu(ddq.d_magic), ddq.d_flags);
+       *ptr += be32_to_cpu(head->oh_len);
     }
     if (head && head->oh_flags & XLOG_CONTINUE_TRANS)
        skip++;
@@ -853,7 +818,7 @@ xlog_print_lseek(xlog_t *log, int fd, xfs_daddr_t blkno, int whence)
        else
                offset = BBTOOFF64(blkno);
        if (lseek64(fd, offset, whence) < 0) {
-               fprintf(stderr, "%s: lseek64 to %lld failed: %s\n",
+               fprintf(stderr, _("%s: lseek64 to %lld failed: %s\n"),
                        progname, (long long)offset, strerror(errno));
                exit(1);
        }
@@ -862,11 +827,10 @@ xlog_print_lseek(xlog_t *log, int fd, xfs_daddr_t blkno, int whence)
 
 void
 print_lsn(xfs_caddr_t  string,
-         xfs_lsn_t     *lsn,
-         xfs_arch_t    arch)
+         __be64        *lsn)
 {
     printf("%s: %u,%u", string,
-           CYCLE_LSN(INT_GET(*lsn, arch)), BLOCK_LSN(INT_GET(*lsn, arch)));
+           CYCLE_LSN(be64_to_cpu(*lsn)), BLOCK_LSN(be64_to_cpu(*lsn)));
 }
 
 
@@ -897,7 +861,7 @@ xlog_print_record(int                         fd,
     /* read_type => don't malloc() new buffer, use old one */
     if (*read_type == FULL_READ) {
        if ((ptr = buf = (xfs_caddr_t)malloc(read_len)) == NULL) {
-           fprintf(stderr, "%s: xlog_print_record: malloc failed\n", progname);
+           fprintf(stderr, _("%s: xlog_print_record: malloc failed\n"), progname);
            exit(1);
        }
     } else {
@@ -906,14 +870,14 @@ xlog_print_record(int                       fd,
        ptr = *partial_buf;
     }
     if ((ret = (int) read(fd, buf, read_len)) == -1) {
-       fprintf(stderr, "%s: xlog_print_record: read error\n", progname);
+       fprintf(stderr, _("%s: xlog_print_record: read error\n"), progname);
        exit(1);
     }
     /* Did we overflow the end? */
     if (*read_type == FULL_READ &&
-       BLOCK_LSN(INT_GET(rhead->h_lsn, ARCH_CONVERT)) + BTOBB(read_len) >=
+       BLOCK_LSN(be64_to_cpu(rhead->h_lsn)) + BTOBB(read_len) >=
                logBBsize) {
-       *read_type = BBTOB(logBBsize - BLOCK_LSN(INT_GET(rhead->h_lsn, ARCH_CONVERT))-1);
+       *read_type = BBTOB(logBBsize - BLOCK_LSN(be64_to_cpu(rhead->h_lsn))-1);
        *partial_buf = buf;
        return PARTIAL_READ;
     }
@@ -937,7 +901,7 @@ xlog_print_record(int                         fd,
        xlog_rec_header_t *rechead = (xlog_rec_header_t *)ptr;
 
        /* sanity checks */
-       if (INT_GET(rechead->h_magicno, ARCH_CONVERT) == XLOG_HEADER_MAGIC_NUM) {
+       if (be32_to_cpu(rechead->h_magicno) == XLOG_HEADER_MAGIC_NUM) {
            /* data should not have magicno as first word
             * as it should by cycle#
             */
@@ -947,12 +911,12 @@ xlog_print_record(int                       fd,
            /* verify cycle#
             * FIXME: cycle+1 should be a macro pv#900369
             */
-           if (INT_GET(rhead->h_cycle, ARCH_CONVERT) !=
-                       INT_GET(*(uint *)ptr, ARCH_CONVERT)) {
+           if (be32_to_cpu(rhead->h_cycle) !=
+                       be32_to_cpu(*(__be32 *)ptr)) {
                if (*read_type == FULL_READ)
                    return -1;
-               else if (INT_GET(rhead->h_cycle, ARCH_CONVERT) + 1 !=
-                       INT_GET(*(uint *)ptr, ARCH_CONVERT))
+               else if (be32_to_cpu(rhead->h_cycle) + 1 !=
+                       be32_to_cpu(*(__be32 *)ptr))
                    return -1;
            }
        }
@@ -960,16 +924,14 @@ xlog_print_record(int                       fd,
        /* copy back the data from the header */
        if (i < XLOG_HEADER_CYCLE_SIZE / BBSIZE) {
                /* from 1st header */
-               INT_SET(*(uint *)ptr, ARCH_CONVERT,
-                       INT_GET(rhead->h_cycle_data[i], ARCH_CONVERT));
+               *(__be32 *)ptr = rhead->h_cycle_data[i];
        }
        else {
                ASSERT(xhdrs != NULL);
                /* from extra headers */
                j = i / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
                k = i % (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
-               INT_SET(*(uint *)ptr, ARCH_CONVERT,
-                       INT_GET(xhdrs[j-1].xh_cycle_data[k], ARCH_CONVERT));
+               *(__be32 *)ptr = xhdrs[j-1].xh_cycle_data[k];
        }
 
     }
@@ -985,80 +947,78 @@ xlog_print_record(int                       fd,
        if (print_no_data ||
            ((XLOG_SET(op_head->oh_flags, XLOG_WAS_CONT_TRANS) ||
              XLOG_SET(op_head->oh_flags, XLOG_CONTINUE_TRANS)) &&
-            INT_GET(op_head->oh_len, ARCH_CONVERT) == 0)) {
-           for (n = 0; n < INT_GET(op_head->oh_len, ARCH_CONVERT); n++) {
+            be32_to_cpu(op_head->oh_len) == 0)) {
+           for (n = 0; n < be32_to_cpu(op_head->oh_len); n++) {
                printf("%c", *ptr);
                ptr++;
            }
            printf("\n");
            continue;
        }
-       if (xlog_print_find_tid(INT_GET(op_head->oh_tid, ARCH_CONVERT),
+       if (xlog_print_find_tid(be32_to_cpu(op_head->oh_tid),
                                op_head->oh_flags & XLOG_WAS_CONT_TRANS)) {
-           printf("Left over region from split log item\n");
-           ptr += INT_GET(op_head->oh_len, ARCH_CONVERT);
+           printf(_("Left over region from split log item\n"));
+           ptr += be32_to_cpu(op_head->oh_len);
            continue;
        }
-       if (INT_GET(op_head->oh_len, ARCH_CONVERT) != 0) {
+       if (be32_to_cpu(op_head->oh_len) != 0) {
            if (*(uint *)ptr == XFS_TRANS_HEADER_MAGIC) {
                skip = xlog_print_trans_header(&ptr,
-                                       INT_GET(op_head->oh_len, ARCH_CONVERT));
+                                       be32_to_cpu(op_head->oh_len));
            } else {
                switch (*(unsigned short *)ptr) {
-                   case XFS_LI_5_3_BUF:
-                   case XFS_LI_6_1_BUF:
                    case XFS_LI_BUF: {
                        skip = xlog_print_trans_buffer(&ptr,
-                                       INT_GET(op_head->oh_len, ARCH_CONVERT),
+                                       be32_to_cpu(op_head->oh_len),
                                        &i, num_ops);
                        break;
                    }
                    case XFS_LI_INODE: {
                        skip = xlog_print_trans_inode(&ptr,
-                                       INT_GET(op_head->oh_len, ARCH_CONVERT),
+                                       be32_to_cpu(op_head->oh_len),
                                        &i, num_ops);
                        break;
                    }
                    case XFS_LI_DQUOT: {
                        skip = xlog_print_trans_dquot(&ptr,
-                                       INT_GET(op_head->oh_len, ARCH_CONVERT),
+                                       be32_to_cpu(op_head->oh_len),
                                        &i, num_ops);
                        break;
                    }
                    case XFS_LI_EFI: {
                        skip = xlog_print_trans_efi(&ptr,
-                                       INT_GET(op_head->oh_len, ARCH_CONVERT));
+                                       be32_to_cpu(op_head->oh_len));
                        break;
                    }
                    case XFS_LI_EFD: {
                        skip = xlog_print_trans_efd(&ptr,
-                                       INT_GET(op_head->oh_len, ARCH_CONVERT));
+                                       be32_to_cpu(op_head->oh_len));
                        break;
                    }
                    case XFS_LI_QUOTAOFF: {
                        skip = xlog_print_trans_qoff(&ptr,
-                                       INT_GET(op_head->oh_len, ARCH_CONVERT));
+                                       be32_to_cpu(op_head->oh_len));
                        break;
                    }
                    case XLOG_UNMOUNT_TYPE: {
-                       printf("Unmount filesystem\n");
+                       printf(_("Unmount filesystem\n"));
                        skip = 0;
                        break;
                    }
                    default: {
-                       fprintf(stderr, "%s: unknown log operation type (%x)\n",
+                       fprintf(stderr, _("%s: unknown log operation type (%x)\n"),
                                progname, *(unsigned short *)ptr);
                        if (print_exit) {
                                free(buf);
                                return BAD_HEADER;
                        }
                        skip = 0;
-                       ptr += INT_GET(op_head->oh_len, ARCH_CONVERT);
+                       ptr += be32_to_cpu(op_head->oh_len);
                    }
                } /* switch */
            } /* else */
            if (skip != 0)
-               xlog_print_add_to_trans(INT_GET(op_head->oh_tid, ARCH_CONVERT), skip);
+               xlog_print_add_to_trans(be32_to_cpu(op_head->oh_tid), skip);
        }
     }
     printf("\n");
@@ -1075,14 +1035,14 @@ xlog_print_rec_head(xlog_rec_header_t *head, int *len)
     int datalen,bbs;
 
     if (print_no_print)
-           return INT_GET(head->h_num_logops, ARCH_CONVERT);
+           return be32_to_cpu(head->h_num_logops);
 
     if (!head->h_magicno)
        return ZEROED_LOG;
 
-    if (INT_GET(head->h_magicno, ARCH_CONVERT) != XLOG_HEADER_MAGIC_NUM) {
-       printf("Header 0x%x wanted 0x%x\n",
-               INT_GET(head->h_magicno, ARCH_CONVERT),
+    if (be32_to_cpu(head->h_magicno) != XLOG_HEADER_MAGIC_NUM) {
+       printf(_("Header 0x%x wanted 0x%x\n"),
+               be32_to_cpu(head->h_magicno),
                XLOG_HEADER_MAGIC_NUM);
        return BAD_HEADER;
     }
@@ -1092,52 +1052,52 @@ xlog_print_rec_head(xlog_rec_header_t *head, int *len)
        !head->h_num_logops && !head->h_size)
        return CLEARED_BLKS;
 
-    datalen=INT_GET(head->h_len, ARCH_CONVERT);
+    datalen=be32_to_cpu(head->h_len);
     bbs=BTOBB(datalen);
 
-    printf("cycle: %d  version: %d     ",
-           INT_GET(head->h_cycle, ARCH_CONVERT),
-           INT_GET(head->h_version, ARCH_CONVERT));
-    print_lsn("        lsn", &head->h_lsn, ARCH_CONVERT);
-    print_lsn("        tail_lsn", &head->h_tail_lsn, ARCH_CONVERT);
+    printf(_("cycle: %d        version: %d     "),
+           be32_to_cpu(head->h_cycle),
+           be32_to_cpu(head->h_version));
+    print_lsn("        lsn", &head->h_lsn);
+    print_lsn("        tail_lsn", &head->h_tail_lsn);
     printf("\n");
-    printf("length of Log Record: %d   prev offset: %d         num ops: %d\n",
+    printf(_("length of Log Record: %d prev offset: %d         num ops: %d\n"),
           datalen,
-           INT_GET(head->h_prev_block, ARCH_CONVERT),
-           INT_GET(head->h_num_logops, ARCH_CONVERT));
+           be32_to_cpu(head->h_prev_block),
+           be32_to_cpu(head->h_num_logops));
 
     if (print_overwrite) {
-       printf("cycle num overwrites: ");
+       printf(_("cycle num overwrites: "));
        for (i=0; i< MIN(bbs, XLOG_HEADER_CYCLE_SIZE / BBSIZE); i++)
            printf("%d - 0x%x  ",
                    i,
-                   INT_GET(head->h_cycle_data[i], ARCH_CONVERT));
+                   be32_to_cpu(head->h_cycle_data[i]));
        printf("\n");
     }
 
     platform_uuid_unparse(&head->h_fs_uuid, uub);
-    printf("uuid: %s   format: ", uub);
-    switch (INT_GET(head->h_fmt, ARCH_CONVERT)) {
+    printf(_("uuid: %s   format: "), uub);
+    switch (be32_to_cpu(head->h_fmt)) {
        case XLOG_FMT_UNKNOWN:
-           printf("unknown\n");
+           printf(_("unknown\n"));
            break;
        case XLOG_FMT_LINUX_LE:
-           printf("little endian linux\n");
+           printf(_("little endian linux\n"));
            break;
        case XLOG_FMT_LINUX_BE:
-           printf("big endian linux\n");
+           printf(_("big endian linux\n"));
            break;
        case XLOG_FMT_IRIX_BE:
-           printf("big endian irix\n");
+           printf(_("big endian irix\n"));
            break;
        default:
-           printf("? (%d)\n", INT_GET(head->h_fmt, ARCH_CONVERT));
+           printf("? (%d)\n", be32_to_cpu(head->h_fmt));
            break;
     }
-    printf("h_size: %d\n", INT_GET(head->h_size, ARCH_CONVERT));
+    printf(_("h_size: %d\n"), be32_to_cpu(head->h_size));
 
-    *len = INT_GET(head->h_len, ARCH_CONVERT);
-    return(INT_GET(head->h_num_logops, ARCH_CONVERT));
+    *len = be32_to_cpu(head->h_len);
+    return(be32_to_cpu(head->h_num_logops));
 }      /* xlog_print_rec_head */
 
 void
@@ -1146,14 +1106,14 @@ xlog_print_rec_xhead(xlog_rec_ext_header_t *head, int coverage)
     int i;
 
     print_xlog_xhdr_line();
-    printf("extended-header: cycle: %d\n", INT_GET(head->xh_cycle, ARCH_CONVERT));
+    printf(_("extended-header: cycle: %d\n"), be32_to_cpu(head->xh_cycle));
 
     if (print_overwrite) {
-       printf("cycle num overwrites: ");
+       printf(_("cycle num overwrites: "));
        for (i = 0; i < coverage; i++)
            printf("%d - 0x%x  ",
                    i,
-                   INT_GET(head->xh_cycle_data[i], ARCH_CONVERT));
+                   be32_to_cpu(head->xh_cycle_data[i]));
        printf("\n");
     }
 }      /* xlog_print_rec_xhead */
@@ -1162,7 +1122,7 @@ static void
 print_xlog_bad_zeroed(xfs_daddr_t blkno)
 {
        print_stars();
-       printf("* ERROR: found data after zeroed blocks block=%-21lld  *\n",
+       printf(_("* ERROR: found data after zeroed blocks block=%-21lld  *\n"),
                (long long)blkno);
        print_stars();
        if (print_exit)
@@ -1173,8 +1133,8 @@ static void
 print_xlog_bad_header(xfs_daddr_t blkno, xfs_caddr_t buf)
 {
        print_stars();
-       printf("* ERROR: header cycle=%-11d block=%-21lld        *\n",
-               GET_CYCLE(buf, ARCH_CONVERT), (long long)blkno);
+       printf(_("* ERROR: header cycle=%-11d block=%-21lld        *\n"),
+               xlog_get_cycle(buf), (long long)blkno);
        print_stars();
        if (print_exit)
            xlog_exit("Bad log record header");
@@ -1184,7 +1144,7 @@ void
 print_xlog_bad_data(xfs_daddr_t blkno)
 {
        print_stars();
-       printf("* ERROR: data block=%-21lld                             *\n",
+       printf(_("* ERROR: data block=%-21lld                             *\n"),
                (long long)blkno);
        print_stars();
        if (print_exit)
@@ -1195,13 +1155,13 @@ static void
 print_xlog_bad_reqd_hdrs(xfs_daddr_t blkno, int num_reqd, int num_hdrs)
 {
        print_stars();
-       printf("* ERROR: for header block=%lld\n"
+       printf(_("* ERROR: for header block=%lld\n"
               "*        not enough hdrs for data length, "
-               "required num = %d, hdr num = %d\n",
+               "required num = %d, hdr num = %d\n"),
                (long long)blkno, num_reqd, num_hdrs);
        print_stars();
        if (print_exit)
-           xlog_exit("Not enough headers for data length.");
+           xlog_exit(_("Not enough headers for data length."));
 }      /* print_xlog_bad_reqd_hdrs */
 
 static void
@@ -1211,7 +1171,7 @@ xlog_reallocate_xhdrs(int num_hdrs, xlog_rec_ext_header_t **ret_xhdrs)
 
        *ret_xhdrs = (xlog_rec_ext_header_t *)realloc(*ret_xhdrs, len);
        if (*ret_xhdrs == NULL) {
-               fprintf(stderr, "%s: xlog_print: malloc failed for ext hdrs\n", progname);
+               fprintf(stderr, _("%s: xlog_print: malloc failed for ext hdrs\n"), progname);
                exit(1);
        }
 }
@@ -1234,7 +1194,7 @@ xlog_print_extended_headers(
        xlog_rec_ext_header_t   *x;
 
        num_required = howmany(len, XLOG_HEADER_CYCLE_SIZE);
-       num_hdrs = INT_GET(hdr->h_size, ARCH_CONVERT) / XLOG_HEADER_CYCLE_SIZE;
+       num_hdrs = be32_to_cpu(hdr->h_size) / XLOG_HEADER_CYCLE_SIZE;
 
        if (num_required > num_hdrs) {
            print_xlog_bad_reqd_hdrs((*blkno)-1, num_required, num_hdrs);
@@ -1257,13 +1217,13 @@ xlog_print_extended_headers(
        for (i = 1, x = *ret_xhdrs; i < num_hdrs; i++, (*blkno)++, x++) {
            /* read one extra header blk */
            if (read(fd, xhbuf, 512) == 0) {
-               printf("%s: physical end of log\n", progname);
+               printf(_("%s: physical end of log\n"), progname);
                print_xlog_record_line();
                /* reached the end so return 1 */
                return 1;
            }
            if (print_only_data) {
-               printf("BLKNO: %lld\n", (long long)*blkno);
+               printf(_("BLKNO: %lld\n"), (long long)*blkno);
                xlog_recover_print_data(xhbuf, 512);
            }
            else {
@@ -1320,7 +1280,7 @@ void xfs_log_print(xlog_t       *log,
      * we still end at the end of the logical log.
      */
     if ((error = xlog_print_find_oldest(log, &block_end))) {
-       fprintf(stderr, "%s: problem finding oldest LR\n", progname);
+       fprintf(stderr, _("%s: problem finding oldest LR\n"), progname);
        return;
     }
     if (print_block_start == -1)
@@ -1332,12 +1292,12 @@ void xfs_log_print(xlog_t       *log,
 
     for (;;) {
        if (read(fd, hbuf, 512) == 0) {
-           printf("%s: physical end of log\n", progname);
+           printf(_("%s: physical end of log\n"), progname);
            print_xlog_record_line();
            break;
        }
        if (print_only_data) {
-           printf("BLKNO: %lld\n", (long long)blkno);
+           printf(_("BLKNO: %lld\n"), (long long)blkno);
            xlog_recover_print_data(hbuf, 512);
            blkno++;
            goto loop;
@@ -1346,7 +1306,7 @@ void xfs_log_print(xlog_t       *log,
        blkno++;
 
        if (zeroed && num_ops != ZEROED_LOG) {
-           printf("%s: after %d zeroed blocks\n", progname, zeroed);
+           printf(_("%s: after %d zeroed blocks\n"), progname, zeroed);
            /* once we find zeroed blocks - that's all we expect */
            print_xlog_bad_zeroed(blkno-1);
            /* reset count since we're assuming previous zeroed blocks
@@ -1374,7 +1334,7 @@ void xfs_log_print(xlog_t       *log,
            goto loop;
        }
 
-       if (INT_GET(hdr->h_version, ARCH_CONVERT) == 2) {
+       if (be32_to_cpu(hdr->h_version) == 2) {
            if (xlog_print_extended_headers(fd, len, &blkno, hdr, &num_hdrs, &xhdrs) != 0)
                break;
        }
@@ -1398,7 +1358,7 @@ void xfs_log_print(xlog_t       *log,
            }
            case PARTIAL_READ: {
                print_xlog_record_line();
-               printf("%s: physical end of log\n", progname);
+               printf(_("%s: physical end of log\n"), progname);
                print_xlog_record_line();
                blkno = 0;
                xlog_print_lseek(log, fd, 0, SEEK_SET);
@@ -1410,32 +1370,32 @@ void xfs_log_print(xlog_t       *log,
                        goto end;
                goto partial_log_read;
            }
-           default: xlog_panic("illegal value");
+           default: xlog_panic(_("illegal value"));
        }
        print_xlog_record_line();
 loop:
        if (blkno >= logBBsize) {
            if (cleared) {
-               printf("%s: skipped %d cleared blocks in range: %lld - %lld\n",
+               printf(_("%s: skipped %d cleared blocks in range: %lld - %lld\n"),
                        progname, cleared,
                        (long long)(cleared_blkno),
                        (long long)(cleared + cleared_blkno - 1));
                if (cleared == logBBsize)
-                   printf("%s: totally cleared log\n", progname);
+                   printf(_("%s: totally cleared log\n"), progname);
 
                cleared=0;
            }
            if (zeroed) {
-               printf("%s: skipped %d zeroed blocks in range: %lld - %lld\n",
+               printf(_("%s: skipped %d zeroed blocks in range: %lld - %lld\n"),
                        progname, zeroed,
                        (long long)(zeroed_blkno),
                        (long long)(zeroed + zeroed_blkno - 1));
                if (zeroed == logBBsize)
-                   printf("%s: totally zeroed log\n", progname);
+                   printf(_("%s: totally zeroed log\n"), progname);
 
                zeroed=0;
            }
-           printf("%s: physical end of log\n", progname);
+           printf(_("%s: physical end of log\n"), progname);
            print_xlog_record_line();
            break;
        }
@@ -1447,10 +1407,10 @@ loop:
        xlog_print_lseek(log, fd, 0, SEEK_SET);
        for (;;) {
            if (read(fd, hbuf, 512) == 0) {
-               xlog_panic("xlog_find_head: bad read");
+               xlog_panic(_("xlog_find_head: bad read"));
            }
            if (print_only_data) {
-               printf("BLKNO: %lld\n", (long long)blkno);
+               printf(_("BLKNO: %lld\n"), (long long)blkno);
                xlog_recover_print_data(hbuf, 512);
                blkno++;
                goto loop2;
@@ -1472,7 +1432,7 @@ loop:
                continue;
            }
 
-           if (INT_GET(hdr->h_version, ARCH_CONVERT) == 2) {
+           if (be32_to_cpu(hdr->h_version) == 2) {
                if (xlog_print_extended_headers(fd, len, &blkno, hdr, &num_hdrs, &xhdrs) != 0)
                    break;
            }
@@ -1503,7 +1463,7 @@ loop2:
     }
 
 end:
-    printf("%s: logical end of log\n", progname);
+    printf(_("%s: logical end of log\n"), progname);
     print_xlog_record_line();
 }
 
@@ -1595,7 +1555,7 @@ xfs_efi_copy_format(char *buf, uint len, xfs_efi_log_format_t *dst_efi_fmt)
                 }
                 return 0;
         }
-       fprintf(stderr, "%s: bad size of efi format: %u; expected %u or %u; nextents = %u\n",
+       fprintf(stderr, _("%s: bad size of efi format: %u; expected %u or %u; nextents = %u\n"),
                progname, len, len32, len64, nextents);
         return 1;
 }