block: Extract the BlockAcctStats structure
Extract the block accounting statistics into a structure so the block device
models can hold them in the future.
CC: Kevin Wolf <kwolf@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
CC: Max Reitz <mreitz@redhat.com>
CC: Eric Blake <eblake@redhat.com>
Signed-off-by: Benoît Canet <benoit.canet@nodalink.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
diff --git a/include/block/block.h b/include/block/block.h
index 8f4ad16..f47d66f 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -492,6 +492,13 @@
BDRV_MAX_IOTYPE,
};
+typedef struct BlockAcctStats {
+ uint64_t nr_bytes[BDRV_MAX_IOTYPE];
+ uint64_t nr_ops[BDRV_MAX_IOTYPE];
+ uint64_t total_time_ns[BDRV_MAX_IOTYPE];
+ uint64_t wr_highest_sector;
+} BlockAcctStats;
+
typedef struct BlockAcctCookie {
int64_t bytes;
int64_t start_time_ns;
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 8a61215..20954f3 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -359,10 +359,7 @@
bool io_limits_enabled;
/* I/O stats (display with "info blockstats"). */
- uint64_t nr_bytes[BDRV_MAX_IOTYPE];
- uint64_t nr_ops[BDRV_MAX_IOTYPE];
- uint64_t total_time_ns[BDRV_MAX_IOTYPE];
- uint64_t wr_highest_sector;
+ BlockAcctStats stats;
/* I/O Limits */
BlockLimits bl;