block_util: convert aligned_operations to SmallVec
The number of aligned operations can not be larger than the number of
descriptors. Initializing the capacity to 1 is good enough per the
observation that most of time there is only one data descriptor in a
given request.
@@ -201,7 +201,7 @@ pub struct Request {
pub data_descriptors: SmallVec<[(GuestAddress, u32); 1]>,
pub status_addr: GuestAddress,
pub writeback: bool,
- pub aligned_operations: Vec<AlignedOperation>,
+ pub aligned_operations: SmallVec<[AlignedOperation; 1]>,
pub start: Instant,
}
@@ -233,7 +233,7 @@ impl Request {
data_descriptors: SmallVec::with_capacity(1),
status_addr: GuestAddress(0),
writeback: true,
- aligned_operations: Vec::new(),
+ aligned_operations: SmallVec::with_capacity(1),
start: Instant::now(),
};
