Lines Matching refs:volume_uuid

638 static std::string volkey_path(const std::string& misc_path, const std::string& volume_uuid) {  in volkey_path()  argument
639 return misc_path + "/vold/volume_keys/" + volume_uuid + "/default"; in volkey_path()
642 static std::string volume_secdiscardable_path(const std::string& volume_uuid) { in volume_secdiscardable_path() argument
643 return systemwide_volume_key_dir + "/" + volume_uuid + "/secdiscardable"; in volume_secdiscardable_path()
646 static bool read_or_create_volkey(const std::string& misc_path, const std::string& volume_uuid, in read_or_create_volkey() argument
648 auto secdiscardable_path = volume_secdiscardable_path(volume_uuid); in read_or_create_volkey()
658 auto key_path = volkey_path(misc_path, volume_uuid); in read_or_create_volkey()
667 if (!install_storage_key(BuildDataPath(volume_uuid), options, key, policy)) return false; in read_or_create_volkey()
671 static bool destroy_volkey(const std::string& misc_path, const std::string& volume_uuid) { in destroy_volkey() argument
672 auto path = volkey_path(misc_path, volume_uuid); in destroy_volkey()
789 static bool prepare_subdirs(const std::string& action, const std::string& volume_uuid, in prepare_subdirs() argument
792 std::vector<std::string>{prepare_subdirs_path, action, volume_uuid, in prepare_subdirs()
800 bool fscrypt_prepare_user_storage(const std::string& volume_uuid, userid_t user_id, int serial, in fscrypt_prepare_user_storage() argument
802 LOG(DEBUG) << "fscrypt_prepare_user_storage for volume " << escape_empty(volume_uuid) in fscrypt_prepare_user_storage()
815 auto user_de_path = android::vold::BuildDataUserDePath(volume_uuid, user_id); in fscrypt_prepare_user_storage()
817 if (volume_uuid.empty()) { in fscrypt_prepare_user_storage()
834 if (volume_uuid.empty()) { in fscrypt_prepare_user_storage()
840 if (!read_or_create_volkey(misc_de_path, volume_uuid, &de_policy)) return false; in fscrypt_prepare_user_storage()
851 auto media_ce_path = android::vold::BuildDataMediaCePath(volume_uuid, user_id); in fscrypt_prepare_user_storage()
852 auto user_ce_path = android::vold::BuildDataUserCePath(volume_uuid, user_id); in fscrypt_prepare_user_storage()
854 if (volume_uuid.empty()) { in fscrypt_prepare_user_storage()
873 if (volume_uuid.empty()) { in fscrypt_prepare_user_storage()
879 if (!read_or_create_volkey(misc_ce_path, volume_uuid, &ce_policy)) return false; in fscrypt_prepare_user_storage()
885 if (volume_uuid.empty()) { in fscrypt_prepare_user_storage()
894 if (!prepare_subdirs("prepare", volume_uuid, user_id, flags)) return false; in fscrypt_prepare_user_storage()
899 bool fscrypt_destroy_user_storage(const std::string& volume_uuid, userid_t user_id, int flags) { in fscrypt_destroy_user_storage() argument
900 LOG(DEBUG) << "fscrypt_destroy_user_storage for volume " << escape_empty(volume_uuid) in fscrypt_destroy_user_storage()
904 res &= prepare_subdirs("destroy", volume_uuid, user_id, flags); in fscrypt_destroy_user_storage()
911 auto media_ce_path = android::vold::BuildDataMediaCePath(volume_uuid, user_id); in fscrypt_destroy_user_storage()
912 auto user_ce_path = android::vold::BuildDataUserCePath(volume_uuid, user_id); in fscrypt_destroy_user_storage()
916 if (volume_uuid.empty()) { in fscrypt_destroy_user_storage()
922 res &= destroy_volkey(misc_ce_path, volume_uuid); in fscrypt_destroy_user_storage()
937 auto user_de_path = android::vold::BuildDataUserDePath(volume_uuid, user_id); in fscrypt_destroy_user_storage()
940 if (volume_uuid.empty()) { in fscrypt_destroy_user_storage()
951 res &= destroy_volkey(misc_de_path, volume_uuid); in fscrypt_destroy_user_storage()
959 static bool destroy_volume_keys(const std::string& directory_path, const std::string& volume_uuid) { in destroy_volume_keys() argument
981 res &= destroy_volkey(directory_path + "/" + entry->d_name, volume_uuid); in destroy_volume_keys()
986 bool fscrypt_destroy_volume_keys(const std::string& volume_uuid) { in fscrypt_destroy_volume_keys() argument
988 LOG(DEBUG) << "fscrypt_destroy_volume_keys for volume " << escape_empty(volume_uuid); in fscrypt_destroy_volume_keys()
989 auto secdiscardable_path = volume_secdiscardable_path(volume_uuid); in fscrypt_destroy_volume_keys()
991 res &= destroy_volume_keys("/data/misc_ce", volume_uuid); in fscrypt_destroy_volume_keys()
992 res &= destroy_volume_keys("/data/misc_de", volume_uuid); in fscrypt_destroy_volume_keys()