Use Dma APIs for virtio-block driver

This commit is contained in:
LI Qing
2024-02-22 14:53:40 +09:00
committed by Tate, Hongliang Tian
parent d8a841f88a
commit c3c6b0c19d
6 changed files with 243 additions and 217 deletions

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
use aster_frame::vm::{DmaCoherent, DmaStream, HasDaddr};
use aster_frame::vm::{DmaCoherent, DmaStream, DmaStreamSlice, HasDaddr};
/// A DMA-capable buffer.
///
@ -18,6 +18,12 @@ impl DmaBuf for DmaStream {
}
}
impl DmaBuf for DmaStreamSlice<'_> {
fn len(&self) -> usize {
self.nbytes()
}
}
impl DmaBuf for DmaCoherent {
fn len(&self) -> usize {
self.nbytes()