[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] xen_disk: add discard support
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-devel] [PATCH] xen_disk: add discard support |
Date: |
Tue, 4 Feb 2014 15:49:55 +0000 |
User-agent: |
Alpine 2.02 (DEB 1266 2009-07-14) |
On Tue, 4 Feb 2014, Olaf Hering wrote:
> On Mon, Feb 03, Kevin Wolf wrote:
>
> > Am 30.01.2014 um 16:02 hat Olaf Hering geschrieben:
> > > +++ b/hw/block/xen_disk.c
>
> > > + case BLKIF_OP_DISCARD:
> > > + {
> > > + struct blkif_request_discard *discard_req = (void *)&ioreq->req;
> > > + bdrv_acct_start(blkdev->bs, &ioreq->acct,
> > > + discard_req->nr_sectors * BLOCK_SIZE,
> > > BDRV_ACCT_WRITE);
> >
> > Neither SCSI nor IDE account for discards. I think we should keep the
> > behaviour consistent across devices.
>
> Stefano,did you already put this change into your queue?
> I will resubmit the patch with the change below.
Go ahead and resubmit. Thanks.
> Olaf
>
>
> diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
> index e74efc7..69ecc98 100644
> --- a/hw/block/xen_disk.c
> +++ b/hw/block/xen_disk.c
> @@ -527,8 +527,6 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
> case BLKIF_OP_DISCARD:
> {
> struct blkif_request_discard *discard_req = (void *)&ioreq->req;
> - bdrv_acct_start(blkdev->bs, &ioreq->acct,
> - discard_req->nr_sectors * BLOCK_SIZE,
> BDRV_ACCT_WRITE);
> ioreq->aio_inflight++;
> bdrv_aio_discard(blkdev->bs,
> discard_req->sector_number, discard_req->nr_sectors,
>