mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 02:24:51 +00:00
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:
10
block/io.c
10
block/io.c
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user