block: Drop use of Stat64

The Stat64 structure is an aid for 32-bit hosts, and
is no longer required.  Use plain 64-bit types.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson
2026-01-08 12:53:21 +11:00
parent a2bd1e766c
commit d9fe147955
3 changed files with 11 additions and 4 deletions

View File

@@ -39,6 +39,7 @@
#include "qemu/main-loop.h"
#include "system/replay.h"
#include "qemu/units.h"
#include "qemu/atomic.h"
/* Maximum bounce buffer for copy-on-read and write zeroes, in bytes */
#define MAX_BOUNCE_BUFFER (32768 << BDRV_SECTOR_BITS)
@@ -2044,7 +2045,14 @@ bdrv_co_write_req_finish(BdrvChild *child, int64_t offset, int64_t bytes,
if (req->bytes) {
switch (req->type) {
case BDRV_TRACKED_WRITE:
stat64_max(&bs->wr_highest_offset, offset + bytes);
{
uint64_t new = offset + bytes;
uint64_t old = qatomic_read(&bs->wr_highest_offset);
while (old < new) {
old = qatomic_cmpxchg(&bs->wr_highest_offset, old, new);
}
}
/* fall through, to set dirty bits */
case BDRV_TRACKED_DISCARD:
bdrv_set_dirty(bs, offset, bytes);

View File

@@ -651,7 +651,7 @@ bdrv_query_bds_stats(BlockDriverState *bs, bool blk_level)
s->node_name = g_strdup(bdrv_get_node_name(bs));
}
s->stats->wr_highest_offset = stat64_get(&bs->wr_highest_offset);
s->stats->wr_highest_offset = qatomic_read(&bs->wr_highest_offset);
s->driver_specific = bdrv_get_specific_stats(bs);

View File

@@ -30,7 +30,6 @@
#include "qemu/aiocb.h"
#include "qemu/iov.h"
#include "qemu/rcu.h"
#include "qemu/stats64.h"
#define BLOCK_FLAG_LAZY_REFCOUNTS 8
@@ -1246,7 +1245,7 @@ struct BlockDriverState {
QLIST_HEAD(, BdrvDirtyBitmap) dirty_bitmaps;
/* Offset after the highest byte written to */
Stat64 wr_highest_offset;
uint64_t wr_highest_offset;
/*
* If true, copy read backing sectors into image. Can be >1 if more