authfs: support resizing file

There are three major changes:
1. Add resize() to MerkleLeaves as the simple hash container.
2. Handle resize for a writable file. The special case is that the hash
   of the new last chunk can change, and the only way to calculate is to
   read the original data back.
3. Handle the size change in FUSE.

Bug: 186265793
Test: atest
Test: dex2oat succeeds (with more local changes)

Change-Id: I1ec20b6f0c69fd3ec24a6d04fc34583962265479
diff --git a/authfs/src/main.rs b/authfs/src/main.rs
index 60f603f..b30195a 100644
--- a/authfs/src/main.rs
+++ b/authfs/src/main.rs
@@ -82,6 +82,10 @@
     /// Debug only. A read-only local file without integrity check. Can be multiple.
     #[structopt(long, parse(try_from_str = parse_local_ro_file_unverified_ro_option))]
     local_ro_file_unverified: Vec<OptionLocalRoFileUnverified>,
+
+    /// Enable debugging features.
+    #[structopt(long)]
+    debug: bool,
 }
 
 struct OptionRemoteRoFile {
@@ -294,6 +298,12 @@
 
 fn main() -> Result<()> {
     let args = Args::from_args();
+
+    let log_level = if args.debug { log::Level::Debug } else { log::Level::Info };
+    android_logger::init_once(
+        android_logger::Config::default().with_tag("authfs").with_min_level(log_level),
+    );
+
     let file_pool = prepare_file_pool(&args)?;
     fusefs::loop_forever(file_pool, &args.mount_point)?;
     bail!("Unexpected exit after the handler loop")