mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
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. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
1325c76525
commit
427a2bacf5
@ -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(),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user