Merge "autfs: Replace use of cfg_if with hardened cast" into main
diff --git a/guest/authfs/Android.bp b/guest/authfs/Android.bp
index b11da3d..d7a8322 100644
--- a/guest/authfs/Android.bp
+++ b/guest/authfs/Android.bp
@@ -13,7 +13,6 @@
"libanyhow",
"libauthfs_fsverity_metadata",
"libbinder_rs",
- "libcfg_if",
"libclap",
"libfsverity_digests_proto_rust",
"libfuse_rust",
diff --git a/guest/authfs/src/fusefs.rs b/guest/authfs/src/fusefs.rs
index 618b8ac..fa4076d 100644
--- a/guest/authfs/src/fusefs.rs
+++ b/guest/authfs/src/fusefs.rs
@@ -385,15 +385,6 @@
}
}
-cfg_if::cfg_if! {
- if #[cfg(all(any(target_arch = "aarch64", target_arch = "riscv64"),
- target_pointer_width = "64"))] {
- fn blk_size() -> libc::c_int { CHUNK_SIZE as libc::c_int }
- } else {
- fn blk_size() -> libc::c_long { CHUNK_SIZE as libc::c_long }
- }
-}
-
#[allow(clippy::enum_variant_names)]
enum AccessMode {
ReadOnly,
@@ -421,7 +412,7 @@
st.st_gid = 0;
st.st_size = libc::off64_t::try_from(file_size)
.map_err(|_| io::Error::from_raw_os_error(libc::EFBIG))?;
- st.st_blksize = blk_size();
+ st.st_blksize = CHUNK_SIZE.try_into().unwrap();
// Per man stat(2), st_blocks is "Number of 512B blocks allocated".
st.st_blocks = libc::c_longlong::try_from(divide_roundup(file_size, 512))
.map_err(|_| io::Error::from_raw_os_error(libc::EFBIG))?;