diff options
author | Benoît Canet <benoit.canet@nodalink.com> | 2014-09-05 15:46:17 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-09-10 10:41:29 +0200 |
commit | 28298fd3d9df6685c069fa0d03398c8c585a83ea (patch) | |
tree | 4e5c76ee1d4670c760852ab78ff5b90c1fcc17a1 /block | |
parent | 5e5a94b60518002e8ecc7afa78a9e7565b23e38f (diff) |
block: rename BlockAcctType members to start with BLOCK_ instead of BDRV_
The middle term goal is to move the BlockAcctStats structure in the device models.
(Capturing I/O accounting statistics in the device models is good for billing)
This patch make a small step in this direction by removing a reference to BDRV.
CC: Kevin Wolf <kwolf@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
CC: Keith Busch <keith.busch@intel.com>
CC: Anthony Liguori <aliguori@amazon.com>
CC: "Michael S. Tsirkin" <mst@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: John Snow <jsnow@redhat.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Markus Armbruster <armbru@redhat.com>
CC: Alexander Graf <agraf@suse.de>i
Signed-off-by: Benoît Canet <benoit.canet@nodalink.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/accounting.c | 4 | ||||
-rw-r--r-- | block/qapi.c | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/block/accounting.c b/block/accounting.c index 702542e2a6..38932cac72 100644 --- a/block/accounting.c +++ b/block/accounting.c @@ -29,7 +29,7 @@ void bdrv_acct_start(BlockDriverState *bs, BlockAcctCookie *cookie, int64_t bytes, enum BlockAcctType type) { - assert(type < BDRV_MAX_IOTYPE); + assert(type < BLOCK_MAX_IOTYPE); cookie->bytes = bytes; cookie->start_time_ns = get_clock(); @@ -39,7 +39,7 @@ bdrv_acct_start(BlockDriverState *bs, BlockAcctCookie *cookie, int64_t bytes, void bdrv_acct_done(BlockDriverState *bs, BlockAcctCookie *cookie) { - assert(cookie->type < BDRV_MAX_IOTYPE); + assert(cookie->type < BLOCK_MAX_IOTYPE); bs->stats.nr_bytes[cookie->type] += cookie->bytes; bs->stats.nr_ops[cookie->type]++; diff --git a/block/qapi.c b/block/qapi.c index 3d3d30b004..9733ebd328 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -333,16 +333,16 @@ static BlockStats *bdrv_query_stats(const BlockDriverState *bs) } s->stats = g_malloc0(sizeof(*s->stats)); - s->stats->rd_bytes = bs->stats.nr_bytes[BDRV_ACCT_READ]; - s->stats->wr_bytes = bs->stats.nr_bytes[BDRV_ACCT_WRITE]; - s->stats->rd_operations = bs->stats.nr_ops[BDRV_ACCT_READ]; - s->stats->wr_operations = bs->stats.nr_ops[BDRV_ACCT_WRITE]; + s->stats->rd_bytes = bs->stats.nr_bytes[BLOCK_ACCT_READ]; + s->stats->wr_bytes = bs->stats.nr_bytes[BLOCK_ACCT_WRITE]; + s->stats->rd_operations = bs->stats.nr_ops[BLOCK_ACCT_READ]; + s->stats->wr_operations = bs->stats.nr_ops[BLOCK_ACCT_WRITE]; s->stats->wr_highest_offset = bs->stats.wr_highest_sector * BDRV_SECTOR_SIZE; - s->stats->flush_operations = bs->stats.nr_ops[BDRV_ACCT_FLUSH]; - s->stats->wr_total_time_ns = bs->stats.total_time_ns[BDRV_ACCT_WRITE]; - s->stats->rd_total_time_ns = bs->stats.total_time_ns[BDRV_ACCT_READ]; - s->stats->flush_total_time_ns = bs->stats.total_time_ns[BDRV_ACCT_FLUSH]; + s->stats->flush_operations = bs->stats.nr_ops[BLOCK_ACCT_FLUSH]; + s->stats->wr_total_time_ns = bs->stats.total_time_ns[BLOCK_ACCT_WRITE]; + s->stats->rd_total_time_ns = bs->stats.total_time_ns[BLOCK_ACCT_READ]; + s->stats->flush_total_time_ns = bs->stats.total_time_ns[BLOCK_ACCT_FLUSH]; if (bs->file) { s->has_parent = true; |