Implement VFS Deduplication (block-level)
- Add DedupStore with content-addressable storage: - SHA-256 hash-based block storage - Reference counting for block lifecycle - dedup_file() and restore_file() operations - DedupManifest for file reconstruction - DedupStats for storage statistics - Add VfsDedupConfig: - block_size (default 4KB) - min_file_size threshold - store_path for dedup directory - Add hex crate for hash encoding - Block-level dedup foundation for SMB/ZFS All 229 tests pass.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
pub mod compression;
|
||||
pub mod dedup;
|
||||
pub mod local_fs;
|
||||
pub mod open_flags;
|
||||
pub mod s3_fs;
|
||||
@@ -430,3 +431,24 @@ pub struct VfsCompressionConfig {
|
||||
/// 最小压缩大小(字节),小于此大小不压缩
|
||||
pub min_size: u64,
|
||||
}
|
||||
|
||||
/// 去重配置
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct VfsDedupConfig {
|
||||
/// 块大小(字节),默认4KB
|
||||
pub block_size: usize,
|
||||
/// 最小文件大小(字节),小于此大小不去重
|
||||
pub min_file_size: u64,
|
||||
/// 去重存储路径
|
||||
pub store_path: PathBuf,
|
||||
}
|
||||
|
||||
impl Default for VfsDedupConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
block_size: 4096,
|
||||
min_file_size: 1024,
|
||||
store_path: PathBuf::from(".dedup"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user