fuchsia_storage_benchmarks/filesystems/
f2fs.rs1use crate::filesystems::FsManagementFilesystemInstance;
6use async_trait::async_trait;
7use storage_benchmarks::{BlockDeviceConfig, BlockDeviceFactory, FilesystemConfig};
8
9#[derive(Clone)]
11pub struct F2fs;
12
13#[async_trait]
14impl FilesystemConfig for F2fs {
15 type Filesystem = FsManagementFilesystemInstance;
16
17 async fn start_filesystem(
18 &self,
19 block_device_factory: &dyn BlockDeviceFactory,
20 ) -> FsManagementFilesystemInstance {
21 let block_device = block_device_factory
22 .create_block_device(&BlockDeviceConfig {
23 requires_fvm: true,
24 use_zxcrypt: true,
25 volume_size: Some(56 * 1024 * 1024),
28 })
29 .await;
30 FsManagementFilesystemInstance::new(
31 fs_management::F2fs::default(),
32 block_device,
33 None,
34 false,
35 )
36 .await
37 }
38
39 fn name(&self) -> String {
40 "f2fs".to_owned()
41 }
42}
43
44#[cfg(test)]
45mod tests {
46 use super::F2fs;
47 use crate::filesystems::testing::check_filesystem;
48
49 #[fuchsia::test]
50 async fn start_f2fs() {
51 check_filesystem(F2fs).await;
52 }
53}