On 22/1/2018 11:48 PM, Eric Blake wrote:
On 01/19/2018 06:50 AM, Anton Nefedov wrote:
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com>
---
  hw/ide/core.c | 13 +++++++++++++
  1 file changed, 13 insertions(+)


@@ -460,10 +468,15 @@ static void ide_issue_trim_cb(void *opaque, int ret)
                  }
if (!ide_sect_range_ok(s, sector, count)) {
+                    block_acct_invalid(blk_get_stats(s->blk),
+                                       BLOCK_ACCT_UNMAP);
                      iocb->is_invalid = true;
                      goto done;
                  }
+ block_acct_start(blk_get_stats(s->blk), &s->acct,
+                                 count << BDRV_SECTOR_BITS, BLOCK_ACCT_UNMAP);

We're still mixing bytes- and block-based reporting; how easy or hard
would it be to flip block_acct_start() and friends to be byte-based?

Quite easy, they already are :)

Reply via email to