Skip to content

Commit a4f204b

Browse files
committed
fixup! *RFL import: kernel::io_buffer
1 parent 5e8e061 commit a4f204b

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

rust/kernel/io_buffer.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
//! Buffers used in IO.
44
5-
use crate::alloc::{flags::*, vec_ext::VecExt};
6-
use crate::error::Result;
7-
use alloc::vec::Vec;
5+
use crate::{
6+
error::Result,
7+
prelude::{KVec, GFP_KERNEL},
8+
};
89
use core::mem::{size_of, MaybeUninit};
910

1011
/// Represents a buffer to be read from during IO.
@@ -29,8 +30,8 @@ pub trait IoBufferReader {
2930
/// Reads all data remaining in the io buffer.
3031
///
3132
/// Returns `EFAULT` if the address does not currently point to mapped, readable memory.
32-
fn read_all(&mut self) -> Result<Vec<u8>> {
33-
let mut data = Vec::<u8>::with_capacity(self.len(), GFP_KERNEL)?;
33+
fn read_all(&mut self) -> Result<KVec<u8>> {
34+
let mut data = KVec::<u8>::with_capacity(self.len(), GFP_KERNEL)?;
3435
// FIXME? data.resize(self.len(), 0);
3536
for _ in 0..self.len() {
3637
data.push(0, GFP_KERNEL)?

0 commit comments

Comments
 (0)