summaryrefslogtreecommitdiff
path: root/Checkpoint.cpp
diff options
context:
space:
mode:
authorDaniel Rosenberg <drosen@google.com>2019-02-01 19:25:47 -0800
committerDaniel Rosenberg <drosen@google.com>2019-02-01 19:41:46 -0800
commit253b44ea6d0c0b4a955552fc6d28196bd82256e9 (patch)
tree3ad836113489263fbbc68f8c264fec6ce998111a /Checkpoint.cpp
parentb6d5cd20d7911be03b2d86f47c0579e20f2d9dec (diff)
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
Diffstat (limited to 'Checkpoint.cpp')
-rw-r--r--Checkpoint.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/Checkpoint.cpp b/Checkpoint.cpp
index 633bd1f..a9bcbf4 100644
--- a/Checkpoint.cpp
+++ b/Checkpoint.cpp
@@ -16,6 +16,7 @@
#define LOG_TAG "Checkpoint"
#include "Checkpoint.h"
+#include "VoldUtil.h"
#include <fstream>
#include <list>
@@ -72,10 +73,6 @@ bool setBowState(std::string const& block_device, std::string const& state) {
Status cp_supportsCheckpoint(bool& result) {
result = false;
- Fstab fstab_default;
- if (!ReadDefaultFstab(&fstab_default)) {
- return Status::fromExceptionCode(EINVAL, "Failed to get fstab");
- }
for (const auto& entry : fstab_default) {
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
// the original flags
std::string err_str;
- Fstab fstab_default;
- if (!ReadDefaultFstab(&fstab_default)) {
- return Status::fromExceptionCode(EINVAL, "Failed to get fstab");
- }
Fstab mounts;
if (!ReadFstabFromFile("/proc/mounts", &mounts)) {
@@ -197,11 +190,6 @@ bool cp_needsCheckpoint() {
}
Status cp_prepareCheckpoint() {
- Fstab fstab_default;
- if (!ReadDefaultFstab(&fstab_default)) {
- return Status::fromExceptionCode(EINVAL, "Failed to get fstab");
- }
-
Fstab mounts;
if (!ReadFstabFromFile("/proc/mounts", &mounts)) {
return Status::fromExceptionCode(EINVAL, "Failed to get /proc/mounts");