add legalhold api

This commit is contained in:
weisd
2025-05-09 16:56:42 +08:00
committed by houseme
parent 9e9f721c08
commit 44958797e5
3 changed files with 127 additions and 1 deletions
+17
View File
@@ -4320,6 +4320,23 @@ impl StorageAPI for SetDisks {
fi.metadata = Some(metadata)
}
if let Some(mt) = &opts.eval_metadata {
if let Some(ref mut metadata) = fi.metadata {
for (k, v) in mt {
metadata.insert(k.clone(), v.clone());
}
fi.metadata = Some(metadata.clone())
} else {
let mut metadata = HashMap::new();
for (k, v) in mt {
metadata.insert(k.clone(), v.clone());
}
fi.metadata = Some(metadata)
}
}
fi.mod_time = opts.mod_time;
if let Some(ref version_id) = opts.version_id {
fi.version_id = Uuid::parse_str(version_id).ok();
+3 -1
View File
@@ -18,7 +18,7 @@ use uuid::Uuid;
pub const ERASURE_ALGORITHM: &str = "rs-vandermonde";
pub const BLOCK_SIZE_V2: usize = 1024 * 1024; // 1M
pub const RESERVED_METADATA_PREFIX: &str = "X-Rustfs-Internal-";
pub const RESERVED_METADATA_PREFIX_LOWER: &str = "X-Rustfs-Internal-";
pub const RESERVED_METADATA_PREFIX_LOWER: &str = "x-rustfs-internal-";
pub const RUSTFS_HEALING: &str = "X-Rustfs-Internal-healing";
pub const RUSTFS_DATA_MOVE: &str = "X-Rustfs-Internal-data-mov";
@@ -602,6 +602,8 @@ pub struct ObjectOptions {
pub replication_request: bool,
pub delete_marker: bool,
pub eval_metadata: Option<HashMap<String, String>>,
}
// impl Default for ObjectOptions {