authfs: Replace a trait bound const w/ a simple const
fs-verity assumes block/page/chunk size to be 4K, and the assumption
may not change for the foreseeable future. Remove the const from the
trait and use a simple const for simplicity.
Bug: 171279640
Test: atest
Change-Id: I8e47acb1869b15dab676dfb10449d2800f3aca73
diff --git a/authfs/src/remote_file.rs b/authfs/src/remote_file.rs
index 7c3d12e..01e803c 100644
--- a/authfs/src/remote_file.rs
+++ b/authfs/src/remote_file.rs
@@ -19,6 +19,7 @@
use std::io::Write;
use std::sync::{Arc, Mutex};
+use crate::common::CHUNK_SIZE;
use crate::reader::ReadOnlyDataByChunk;
use authfs_aidl_interface::aidl::com::android::virt::fs::IVirtFdService;
@@ -49,7 +50,7 @@
impl ReadOnlyDataByChunk for RemoteChunkedFileReader {
fn read_chunk(&self, chunk_index: u64, mut buf: &mut [u8]) -> io::Result<usize> {
- let offset = i64::try_from(chunk_index * Self::CHUNK_SIZE)
+ let offset = i64::try_from(chunk_index * CHUNK_SIZE)
.map_err(|_| io::Error::from_raw_os_error(libc::EOVERFLOW))?;
let service = Arc::clone(&self.service);
@@ -77,7 +78,7 @@
impl ReadOnlyDataByChunk for RemoteFsverityMerkleTreeReader {
fn read_chunk(&self, chunk_index: u64, mut buf: &mut [u8]) -> io::Result<usize> {
- let offset = i64::try_from(chunk_index * Self::CHUNK_SIZE)
+ let offset = i64::try_from(chunk_index * CHUNK_SIZE)
.map_err(|_| io::Error::from_raw_os_error(libc::EOVERFLOW))?;
let service = Arc::clone(&self.service);