xen/blkback: Report VBD_WSECT (wr_sect) properly.

We did not increment the amount of sectors written to disk
b/c we tested for the == WRITE which is incorrect - as the
operations are more of WRITE_FLUSH, WRITE_ODIRECT. This patch
fixes it by doing a & WRITE check.

CC: [email protected]
Reported-by: Andy Burns <[email protected]>
Suggested-by: Ian Campbell <[email protected]>
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
This commit is contained in:
Konrad Rzeszutek Wilk 2011-10-10 12:33:21 -04:00
commit 5c62cb4860

View file

@ -776,7 +776,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
if (operation == READ)
blkif->st_rd_sect += preq.nr_sects;
else if (operation == WRITE || operation == WRITE_FLUSH)
else if (operation & WRITE)
blkif->st_wr_sect += preq.nr_sects;
return 0;