Skip to content

Commit

Permalink
renames
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-oo committed Nov 11, 2024
1 parent efc700a commit 4b42e26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions openhcl/shared_pool_alloc/src/device_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use crate::PagePoolHandle;
use user_driver::memory::MappedDmaTarget;

/// Shared memory representing a DMA buffer useable by devices.
pub struct SharedDmaBuffer {
/// Page pool memory representing a DMA buffer useable by devices.
pub struct PagePoolDmaBuffer {
pub(crate) mapping: sparse_mmap::SparseMapping,
// Holds allocation until dropped.
pub(crate) _alloc: PagePoolHandle,
Expand All @@ -22,7 +22,7 @@ pub struct SharedDmaBuffer {
/// SAFETY: This struct keeps both the shared memory region which the sparse
/// mapping maps, along with the sparse mapping itself until the struct is drop,
/// satisfying the trait.
unsafe impl MappedDmaTarget for SharedDmaBuffer {
unsafe impl MappedDmaTarget for PagePoolDmaBuffer {
fn base(&self) -> *const u8 {
self.mapping.as_ptr() as *const u8
}
Expand Down
4 changes: 2 additions & 2 deletions openhcl/shared_pool_alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

mod device_dma;

pub use device_dma::SharedDmaBuffer;
pub use device_dma::PagePoolDmaBuffer;

#[cfg(feature = "vfio")]
use anyhow::Context;
Expand Down Expand Up @@ -338,7 +338,7 @@ impl user_driver::vfio::VfioDmaBuffer for PagePoolAllocator {

let pfns: Vec<_> = (alloc.base_pfn()..alloc.base_pfn() + alloc.size_pages).collect();

Ok(user_driver::memory::MemoryBlock::new(SharedDmaBuffer {
Ok(user_driver::memory::MemoryBlock::new(PagePoolDmaBuffer {
mapping,
_alloc: alloc,
pfns,
Expand Down

0 comments on commit 4b42e26

Please sign in to comment.