mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
ide: add TRIM support
Add support for TRIM sub function of the data set management command, and wire it up to the qemu discard infrastructure. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
4e1e00515e
commit
d353fb72f5
5 changed files with 124 additions and 5 deletions
|
@ -200,8 +200,13 @@ static void bmdma_restart_bh(void *opaque)
|
|||
is_read = !!(bus->error_status & BM_STATUS_RETRY_READ);
|
||||
|
||||
if (bus->error_status & BM_STATUS_DMA_RETRY) {
|
||||
bus->error_status &= ~(BM_STATUS_DMA_RETRY | BM_STATUS_RETRY_READ);
|
||||
bmdma_restart_dma(bm, is_read ? IDE_DMA_READ : IDE_DMA_WRITE);
|
||||
if (bus->error_status & BM_STATUS_RETRY_TRIM) {
|
||||
bus->error_status &= ~BM_STATUS_RETRY_TRIM;
|
||||
bmdma_restart_dma(bm, IDE_DMA_TRIM);
|
||||
} else {
|
||||
bus->error_status &= ~(BM_STATUS_DMA_RETRY | BM_STATUS_RETRY_READ);
|
||||
bmdma_restart_dma(bm, is_read ? IDE_DMA_READ : IDE_DMA_WRITE);
|
||||
}
|
||||
} else if (bus->error_status & BM_STATUS_PIO_RETRY) {
|
||||
bus->error_status &= ~(BM_STATUS_PIO_RETRY | BM_STATUS_RETRY_READ);
|
||||
if (is_read) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue