Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d939449b authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12573674 from 766c0e53 to 25Q1-release

Change-Id: I83cc49014f6fb4746e8af9b65db74532aae386af
parents dfe574cc 766c0e53
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -1603,7 +1603,8 @@ int fs_mgr_mount_all(Fstab* fstab, int mount_mode) {
                                   attempted_entry.fs_type,
                                   attempted_entry.fs_mgr_flags.is_zoned ? "true" : "false",
                                   std::to_string(attempted_entry.length),
                                   android::base::Join(attempted_entry.user_devices, ' ')},
                                   android::base::Join(attempted_entry.user_devices, ' '),
                                   android::base::Join(attempted_entry.device_aliased, ' ')},
                                  nullptr)) {
                        LERROR << "Encryption failed";
                        set_type_property(encryptable);
@@ -1655,7 +1656,8 @@ int fs_mgr_mount_all(Fstab* fstab, int mount_mode) {
                               formattable_entry->fs_type,
                               formattable_entry->fs_mgr_flags.is_zoned ? "true" : "false",
                               std::to_string(formattable_entry->length),
                               android::base::Join(formattable_entry->user_devices, ' ')},
                               android::base::Join(formattable_entry->user_devices, ' '),
                               android::base::Join(formattable_entry->device_aliased, ' ')},
                              nullptr)) {
                    LERROR << "Encryption failed";
                } else {
@@ -2314,6 +2316,14 @@ std::string fs_mgr_get_context(const std::string& mount_point) {
    return context;
}

int fs_mgr_f2fs_ideal_block_size() {
#if defined(__i386__) || defined(__x86_64__)
    return 4096;
#else
    return getpagesize();
#endif
}

namespace android {
namespace fs_mgr {

+12 −4
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#include <selinux/android.h>
#include <selinux/label.h>
#include <selinux/selinux.h>
#include <filesystem>
#include <string>

#include "fs_mgr_priv.h"
@@ -126,7 +127,8 @@ static int format_ext4(const std::string& fs_blkdev, const std::string& fs_mnt_p

static int format_f2fs(const std::string& fs_blkdev, uint64_t dev_sz, bool needs_projid,
                       bool needs_casefold, bool fs_compress, bool is_zoned,
                       const std::vector<std::string>& user_devices) {
                       const std::vector<std::string>& user_devices,
                       const std::vector<int>& device_aliased) {
    if (!dev_sz) {
        int rc = get_dev_sz(fs_blkdev, &dev_sz);
        if (rc) {
@@ -164,9 +166,15 @@ static int format_f2fs(const std::string& fs_blkdev, uint64_t dev_sz, bool needs
    if (is_zoned) {
        args.push_back("-m");
    }
    for (auto& device : user_devices) {
    for (size_t i = 0; i < user_devices.size(); i++) {
        std::string device_name = user_devices[i];

        args.push_back("-c");
        args.push_back(device.c_str());
        if (device_aliased[i]) {
            std::filesystem::path path = device_name;
            device_name += "@" + path.filename().string();
        }
        args.push_back(device_name.c_str());
    }

    if (user_devices.empty()) {
@@ -191,7 +199,7 @@ int fs_mgr_do_format(const FstabEntry& entry) {
    if (entry.fs_type == "f2fs") {
        return format_f2fs(entry.blk_device, entry.length, needs_projid, needs_casefold,
                           entry.fs_mgr_flags.fs_compress, entry.fs_mgr_flags.is_zoned,
                           entry.user_devices);
                           entry.user_devices, entry.device_aliased);
    } else if (entry.fs_type == "ext4") {
        return format_ext4(entry.blk_device, entry.mount_point, needs_projid,
                           entry.fs_mgr_flags.ext_meta_csum);
+1 −3
Original line number Diff line number Diff line
@@ -387,10 +387,8 @@ bool MakeScratchFilesystem(const std::string& scratch_device) {
    auto command = ""s;
    if (!access(kMkF2fs, X_OK) && fs_mgr_filesystem_available("f2fs")) {
        fs_type = "f2fs";
        command = kMkF2fs + " -w "s;
        command += std::to_string(getpagesize());
        command = kMkF2fs + " -b "s;
        command += std::to_string(getpagesize());
        command += std::to_string(fs_mgr_f2fs_ideal_block_size());
        command += " -f -d1 -l" + android::base::Basename(kScratchMountPoint);
    } else if (!access(kMkExt4, X_OK) && fs_mgr_filesystem_available("ext4")) {
        fs_type = "ext4";
+3 −0
Original line number Diff line number Diff line
@@ -137,3 +137,6 @@ bool fs_mgr_mount_overlayfs_fstab_entry(const android::fs_mgr::FstabEntry& entry
// File name used to track if encryption was interrupted, leading to a known bad fs state
std::string fs_mgr_metadata_encryption_in_progress_file_name(
        const android::fs_mgr::FstabEntry& entry);

// Returns the ideal block size for make_f2fs. Returns -1 on failure.
int fs_mgr_f2fs_ideal_block_size();
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ void ParseUserDevices(const std::string& arg, FstabEntry* entry) {
        entry->fs_mgr_flags.is_zoned = true;
    }
    entry->user_devices.push_back(param[1]);
    entry->device_aliased.push_back(param[0] == "exp_alias" ? 1 : 0);
}

bool ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) {
Loading