From c953d6eb5f0e80a39642e442d7dff06746910715 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 8 Nov 2021 16:38:53 -0800 Subject: [PATCH] fs_mgr: remove FDE fields from FstabEntry Remove the now-unused FDE fields from struct FstabEntry. Bug: 191796797 Change-Id: Iab11a1fe86ac9d06beef68dc7e3c543f48ce0ac6 --- fs_mgr/include_fstab/fstab/fstab.h | 9 ++------- fs_mgr/tests/fs_mgr_test.cpp | 4 ---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/fs_mgr/include_fstab/fstab/fstab.h b/fs_mgr/include_fstab/fstab/fstab.h index d0f32a364..d9c326d42 100644 --- a/fs_mgr/include_fstab/fstab/fstab.h +++ b/fs_mgr/include_fstab/fstab/fstab.h @@ -37,7 +37,6 @@ struct FstabEntry { unsigned long flags = 0; std::string fs_options; std::string fs_checkpoint_opts; - std::string key_loc; std::string metadata_key_dir; std::string metadata_encryption; off64_t length = 0; @@ -60,19 +59,17 @@ struct FstabEntry { struct FsMgrFlags { bool wait : 1; bool check : 1; - bool crypt : 1; + bool crypt : 1; // Now only used to identify adoptable storage volumes bool nonremovable : 1; bool vold_managed : 1; bool recovery_only : 1; bool verify : 1; - bool force_crypt : 1; bool no_emulated_sd : 1; // No emulated sdcard daemon; sd card is the only external // storage. bool no_trim : 1; bool file_encryption : 1; bool formattable : 1; bool slot_select : 1; - bool force_fde_or_fbe : 1; bool late_mount : 1; bool no_fail : 1; bool verify_at_boot : 1; @@ -89,9 +86,7 @@ struct FstabEntry { bool overlayfs_remove_missing_lowerdir : 1; } fs_mgr_flags = {}; - bool is_encryptable() const { - return fs_mgr_flags.crypt || fs_mgr_flags.force_crypt || fs_mgr_flags.force_fde_or_fbe; - } + bool is_encryptable() const { return fs_mgr_flags.crypt; } }; // An Fstab is a collection of FstabEntry structs. diff --git a/fs_mgr/tests/fs_mgr_test.cpp b/fs_mgr/tests/fs_mgr_test.cpp index c77874a93..d631d7a16 100644 --- a/fs_mgr/tests/fs_mgr_test.cpp +++ b/fs_mgr/tests/fs_mgr_test.cpp @@ -193,13 +193,11 @@ bool CompareFlags(FstabEntry::FsMgrFlags& lhs, FstabEntry::FsMgrFlags& rhs) { lhs.vold_managed == rhs.vold_managed && lhs.recovery_only == rhs.recovery_only && lhs.verify == rhs.verify && - lhs.force_crypt == rhs.force_crypt && lhs.no_emulated_sd == rhs.no_emulated_sd && lhs.no_trim == rhs.no_trim && lhs.file_encryption == rhs.file_encryption && lhs.formattable == rhs.formattable && lhs.slot_select == rhs.slot_select && - lhs.force_fde_or_fbe == rhs.force_fde_or_fbe && lhs.late_mount == rhs.late_mount && lhs.no_fail == rhs.no_fail && lhs.verify_at_boot == rhs.verify_at_boot && @@ -505,7 +503,6 @@ source none1 swap defaults fileencryption=,keydirectory=,length=,sw FstabEntry::FsMgrFlags flags = {}; EXPECT_TRUE(CompareFlags(flags, entry->fs_mgr_flags)); } - EXPECT_EQ("", entry->key_loc); EXPECT_EQ("", entry->metadata_key_dir); EXPECT_EQ(0, entry->length); EXPECT_EQ("", entry->label); @@ -528,7 +525,6 @@ source none1 swap defaults fileencryption=,keydirectory=,length=,sw flags.avb = true; EXPECT_TRUE(CompareFlags(flags, entry->fs_mgr_flags)); } - EXPECT_EQ("", entry->key_loc); EXPECT_EQ("", entry->metadata_key_dir); EXPECT_EQ(0, entry->length); EXPECT_EQ("", entry->label);