mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 11:04:58 -06:00
block: Convert BB interface to byte-based discards
Change sector-based blk_discard(), blk_co_discard(), and blk_aio_discard() to instead be byte-based blk_pdiscard(), blk_co_pdiscard(), and blk_aio_pdiscard(). NBD gets a lot simpler now that ignoring the unaligned portion of a byte-based discard request is handled under the hood by the block layer. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1468624988-423-6-git-send-email-eblake@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
60ebac16bc
commit
1c6c4bb7f0
8 changed files with 36 additions and 46 deletions
|
@ -1609,10 +1609,10 @@ static void scsi_unmap_complete_noio(UnmapCBData *data, int ret)
|
|||
goto done;
|
||||
}
|
||||
|
||||
r->req.aiocb = blk_aio_discard(s->qdev.conf.blk,
|
||||
sector_num * (s->qdev.blocksize / 512),
|
||||
nb_sectors * (s->qdev.blocksize / 512),
|
||||
scsi_unmap_complete, data);
|
||||
r->req.aiocb = blk_aio_pdiscard(s->qdev.conf.blk,
|
||||
sector_num * s->qdev.blocksize,
|
||||
nb_sectors * s->qdev.blocksize,
|
||||
scsi_unmap_complete, data);
|
||||
data->count--;
|
||||
data->inbuf += 16;
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue