client: fix missing pdu->log_offset endianness conversion
authorJens Axboe <axboe@fb.com>
Tue, 1 Jul 2014 14:47:11 +0000 (08:47 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 1 Jul 2014 14:47:11 +0000 (08:47 -0600)
Make the iolog sample number uint64_t as well, so we have
the same size across 32 and 64-bit archs.

Signed-off-by: Jens Axboe <axboe@fb.com>
client.c
iolog.h

index 4587824b9c1daba3fab4ecc59069af939bbd7c66..6e7ed6d58441819d0df6359876d880a9a17d3b1e 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1154,9 +1154,9 @@ static struct cmd_iolog_pdu *convert_iolog_gz(struct fio_net_cmd *cmd,
        /*
         * Get header first, it's not compressed
         */
-       nr_samples = le32_to_cpu(pdu->nr_samples);
+       nr_samples = le64_to_cpu(pdu->nr_samples);
 
-       total = nr_samples * __log_entry_sz(pdu->log_offset);
+       total = nr_samples * __log_entry_sz(le32_to_cpu(pdu->log_offset));
        ret = malloc(total + sizeof(*pdu));
        ret->nr_samples = nr_samples;
 
diff --git a/iolog.h b/iolog.h
index b387f48d1600b651a47f7969e0ab3c9ea8ffe49b..eed92971062b7dc058fc777b4c746826e59a1ec4 100644 (file)
--- a/iolog.h
+++ b/iolog.h
@@ -48,8 +48,8 @@ struct io_log {
        /*
         * Entries already logged
         */
-       unsigned long nr_samples;
-       unsigned long max_samples;
+       uint64_t nr_samples;
+       uint64_t max_samples;
        void *log;
 
        unsigned int log_type;