Bind mount Android/ directory in FUSE.
For apps seeing the FUSE filesystem, we want to bind-mount the Android/
directory to the lower filesystem. The main reason for this is game
performance - Android/ contains both OBBs and app-private external data,
and both are heavily accessed during game startup. This is a pretty
straightforward bind-mount on top of /mnt/user.
Bug: 137890172
Test: Running the following:
df /storge/emulated/0 ==> /dev/fuse (FUSE)
df /storage/emulated/0/Android ==> /data/media (sdcardfs)
Test: atest AdoptableHostTest
Change-Id: Ic17a5751b5a94846ee565ff935644a078044ab06
diff --git a/Utils.cpp b/Utils.cpp
index 841aab6..d483418 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -1076,6 +1076,7 @@
if (status != android::OK) {
LOG(ERROR) << "Failed to unmount " << pass_through_path;
}
+ rmdir(pass_through_path.c_str());
LOG(INFO) << "Unmounting fuse path " << fuse_path;
android::status_t result = ForceUnmount(fuse_path);
@@ -1089,8 +1090,10 @@
PLOG(ERROR) << "Failed to unmount with MNT_DETACH " << fuse_path;
return -errno;
}
- return android::OK;
+ result = android::OK;
}
+ rmdir(fuse_path.c_str());
+
return result;
}