Use global default_fstab instead of re-reading
VoldUtils already has a pre-parsed fstab. Use it instead. Test: Checkpoint functions continue to work Change-Id: I96cbab467a7b809c92c4f6cdf7a06abca8c5aa5e
This commit is contained in:
parent
b6d5cd20d7
commit
253b44ea6d
1 changed files with 1 additions and 13 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#define LOG_TAG "Checkpoint"
|
#define LOG_TAG "Checkpoint"
|
||||||
#include "Checkpoint.h"
|
#include "Checkpoint.h"
|
||||||
|
#include "VoldUtil.h"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
@ -72,10 +73,6 @@ bool setBowState(std::string const& block_device, std::string const& state) {
|
||||||
|
|
||||||
Status cp_supportsCheckpoint(bool& result) {
|
Status cp_supportsCheckpoint(bool& result) {
|
||||||
result = false;
|
result = false;
|
||||||
Fstab fstab_default;
|
|
||||||
if (!ReadDefaultFstab(&fstab_default)) {
|
|
||||||
return Status::fromExceptionCode(EINVAL, "Failed to get fstab");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& entry : fstab_default) {
|
for (const auto& entry : fstab_default) {
|
||||||
if (entry.fs_mgr_flags.checkpoint_blk || entry.fs_mgr_flags.checkpoint_fs) {
|
if (entry.fs_mgr_flags.checkpoint_blk || entry.fs_mgr_flags.checkpoint_fs) {
|
||||||
|
@ -116,10 +113,6 @@ Status cp_commitChanges() {
|
||||||
// But we also need to get the matching fstab entries to see
|
// But we also need to get the matching fstab entries to see
|
||||||
// the original flags
|
// the original flags
|
||||||
std::string err_str;
|
std::string err_str;
|
||||||
Fstab fstab_default;
|
|
||||||
if (!ReadDefaultFstab(&fstab_default)) {
|
|
||||||
return Status::fromExceptionCode(EINVAL, "Failed to get fstab");
|
|
||||||
}
|
|
||||||
|
|
||||||
Fstab mounts;
|
Fstab mounts;
|
||||||
if (!ReadFstabFromFile("/proc/mounts", &mounts)) {
|
if (!ReadFstabFromFile("/proc/mounts", &mounts)) {
|
||||||
|
@ -197,11 +190,6 @@ bool cp_needsCheckpoint() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Status cp_prepareCheckpoint() {
|
Status cp_prepareCheckpoint() {
|
||||||
Fstab fstab_default;
|
|
||||||
if (!ReadDefaultFstab(&fstab_default)) {
|
|
||||||
return Status::fromExceptionCode(EINVAL, "Failed to get fstab");
|
|
||||||
}
|
|
||||||
|
|
||||||
Fstab mounts;
|
Fstab mounts;
|
||||||
if (!ReadFstabFromFile("/proc/mounts", &mounts)) {
|
if (!ReadFstabFromFile("/proc/mounts", &mounts)) {
|
||||||
return Status::fromExceptionCode(EINVAL, "Failed to get /proc/mounts");
|
return Status::fromExceptionCode(EINVAL, "Failed to get /proc/mounts");
|
||||||
|
|
Loading…
Reference in a new issue