]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_logprint: fix up the RUI printing code to reflect new format
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 25 Oct 2016 22:14:30 +0000 (15:14 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 25 Oct 2016 22:14:30 +0000 (15:14 -0700)
We changed the RUI format to use a variable length array, so update
the logprint code to reflect that.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
logprint/log_redo.c

index add0764ef078a445dde0163aef617f92abf88eeb..40e072725760139f938608678a325dc992ef3a7d 100644 (file)
@@ -240,8 +240,7 @@ xfs_rui_copy_format(
        int                       continued)
 {
        uint nextents = ((struct xfs_rui_log_format *)buf)->rui_nextents;
-       uint dst_len = sizeof(struct xfs_rui_log_format) +
-                       (nextents - 1) * sizeof(struct xfs_map_extent);
+       uint dst_len = xfs_rui_log_format_sizeof(nextents);
 
        if (len == dst_len || continued) {
                memcpy((char *)dst_fmt, buf, len);
@@ -283,8 +282,7 @@ xlog_print_trans_rui(
 
        /* convert to native format */
        nextents = src_f->rui_nextents;
-       dst_len = sizeof(struct xfs_rui_log_format) +
-                       (nextents - 1) * sizeof(struct xfs_map_extent);
+       dst_len = xfs_rui_log_format_sizeof(nextents);
 
        if (continued && src_len < core_size) {
                printf(_("RUI: Not enough data to decode further\n"));