File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ } ;
89use 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 ) ?
You can’t perform that action at this time.
0 commit comments