refactor(cli): move LZ4 block-size policy leaf to Rust

Export FIO_LZ4_GetBlockSize_FromBlockId directly from Rust under the existing
caller symbol and remove the redundant C forwarding wrapper. Preserve the
block-ID formula and cover its boundary values in the focused Rust test.

Test Plan:
- worker capped nightly rustfmt check
- worker git diff --check
- full serial capped native and upstream suites to run at the next parent gate
This commit is contained in:
2026-07-20 10:16:12 +02:00
parent 9110af5f9e
commit 7692f7a6c5
2 changed files with 7 additions and 12 deletions
+6 -6
View File
@@ -2012,7 +2012,7 @@ fn lz4_block_size_from_block_id(id: c_int) -> c_int {
}
#[no_mangle]
pub extern "C" fn FIO_rust_LZ4_GetBlockSize_FromBlockId(id: c_int) -> c_int {
pub extern "C" fn FIO_LZ4_GetBlockSize_FromBlockId(id: c_int) -> c_int {
lz4_block_size_from_block_id(id)
}
@@ -3678,11 +3678,11 @@ mod tests {
}
#[test]
fn lz4_block_size_shim_preserves_the_block_id_formula() {
assert_eq!(FIO_rust_LZ4_GetBlockSize_FromBlockId(0), 1 << 8);
assert_eq!(FIO_rust_LZ4_GetBlockSize_FromBlockId(1), 1 << 10);
assert_eq!(FIO_rust_LZ4_GetBlockSize_FromBlockId(3), 1 << 14);
assert_eq!(FIO_rust_LZ4_GetBlockSize_FromBlockId(4), 1 << 16);
fn lz4_block_size_policy_preserves_block_id_boundaries() {
assert_eq!(FIO_LZ4_GetBlockSize_FromBlockId(0), 1 << 8);
assert_eq!(FIO_LZ4_GetBlockSize_FromBlockId(1), 1 << 10);
assert_eq!(FIO_LZ4_GetBlockSize_FromBlockId(3), 1 << 14);
assert_eq!(FIO_LZ4_GetBlockSize_FromBlockId(4), 1 << 16);
}
#[test]