Merge changes Idc575106,Id6457a2b am: 3e0e53dbe5

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1462712

Change-Id: If01239e184cd19de660fa158d599c9826ea0cf71
This commit is contained in:
Eric Biggers 2020-10-19 16:26:21 +00:00 committed by Automerger Merge Worker
commit 8671044a64
2 changed files with 11 additions and 15 deletions

View file

@ -47,7 +47,6 @@ using android::base::GetUintProperty;
using android::base::SetProperty;
using android::binder::Status;
using android::fs_mgr::Fstab;
using android::fs_mgr::ReadDefaultFstab;
using android::fs_mgr::ReadFstabFromFile;
using android::hardware::hidl_string;
using android::hardware::boot::V1_0::BoolResult;

View file

@ -17,6 +17,7 @@
#include "IdleMaint.h"
#include "FileDeviceUtils.h"
#include "Utils.h"
#include "VoldUtil.h"
#include "VolumeManager.h"
#include "model/PrivateVolume.h"
@ -45,8 +46,6 @@ using android::base::Realpath;
using android::base::StringPrintf;
using android::base::Timer;
using android::base::WriteStringToFile;
using android::fs_mgr::Fstab;
using android::fs_mgr::ReadDefaultFstab;
using android::hardware::Return;
using android::hardware::Void;
using android::hardware::health::storage::V1_0::IStorage;
@ -104,17 +103,18 @@ static void addFromVolumeManager(std::list<std::string>* paths, PathTypes path_t
}
static void addFromFstab(std::list<std::string>* paths, PathTypes path_type) {
Fstab fstab;
ReadDefaultFstab(&fstab);
std::string previous_mount_point;
for (const auto& entry : fstab) {
// Skip raw partitions.
if (entry.fs_type == "emmc" || entry.fs_type == "mtd") {
for (const auto& entry : fstab_default) {
// Skip raw partitions and swap space.
if (entry.fs_type == "emmc" || entry.fs_type == "mtd" || entry.fs_type == "swap") {
continue;
}
// Skip read-only filesystems
if (entry.flags & MS_RDONLY) {
// Skip read-only filesystems and bind mounts.
if (entry.flags & (MS_RDONLY | MS_BIND)) {
continue;
}
// Skip anything without an underlying block device, e.g. virtiofs.
if (entry.blk_device[0] != '/') {
continue;
}
if (entry.fs_mgr_flags.vold_managed) {
@ -253,11 +253,8 @@ static int stopGc(const std::list<std::string>& paths) {
}
static void runDevGcFstab(void) {
Fstab fstab;
ReadDefaultFstab(&fstab);
std::string path;
for (const auto& entry : fstab) {
for (const auto& entry : fstab_default) {
if (!entry.sysfs_path.empty()) {
path = entry.sysfs_path;
break;