Merge changes Idc575106,Id6457a2b
* changes: IdleMaint: skip swap space, bind mounts, and virtual filesystems IdleMaint: use fstab_default from VoldUtil
This commit is contained in:
commit
3e0e53dbe5
2 changed files with 11 additions and 15 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue