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

Commit a3932d9f authored by Daniel Zheng's avatar Daniel Zheng
Browse files

libsnapshot: use handler options

handler options was not actually used within snpuaserd_core.

Bug: 411280637
Test: ota on cvd
Change-Id: Ib9bc176e3d45d827e8f1ac1c8c11bf129c031a48
parent 709d9844
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -37,8 +37,7 @@ DEFINE_bool(io_uring, false, "If true, io_uring feature is enabled");
DEFINE_bool(o_direct, false, "If true, enable direct reads on source device");
DEFINE_bool(skip_verification, false, "If true, skip verification of partitions");
DEFINE_int32(cow_op_merge_size, 0, "number of operations to be processed at once");
DEFINE_int32(worker_count, android::snapshot::kNumWorkerThreads,
             "number of worker threads used to serve I/O requests to dm-user");
DEFINE_int32(worker_count, 4, "number of worker threads used to serve I/O requests to dm-user");
DEFINE_int32(verify_block_size, 1_MiB, "block sized used during verification of snapshots");
DEFINE_int32(num_verify_threads, 3, "number of threads used during verification phase");

+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ SnapshotHandler::SnapshotHandler(std::string misc_name, std::string cow_device,
}

bool SnapshotHandler::InitializeWorkers() {
    for (int i = 0; i < num_worker_threads_; i++) {
    for (int i = 0; i < handler_options_.num_worker_threads; i++) {
        auto wt = std::make_unique<ReadWorker>(cow_device_, backing_store_device_, misc_name_,
                                               base_path_merge_, GetSharedPtr(),
                                               block_server_opener_, handler_options_.o_direct);
+0 −3
Original line number Diff line number Diff line
@@ -58,8 +58,6 @@ using namespace android::storage_literals;
static constexpr size_t PAYLOAD_BUFFER_SZ = (1UL << 20);
static_assert(PAYLOAD_BUFFER_SZ >= BLOCK_SZ);

static constexpr int kNumWorkerThreads = 4;

#define SNAP_LOG(level) LOG(level) << misc_name_ << ": "
#define SNAP_PLOG(level) PLOG(level) << misc_name_ << ": "

@@ -245,7 +243,6 @@ class SnapshotHandler : public std::enable_shared_from_this<SnapshotHandler> {
    bool merge_monitored_ = false;
    bool attached_ = false;
    bool scratch_space_ = false;
    int num_worker_threads_ = kNumWorkerThreads;
    bool perform_verification_ = true;
    bool resume_merge_ = false;
    bool merge_complete_ = false;
+2 −2
Original line number Diff line number Diff line
@@ -732,7 +732,7 @@ void SnapuserdTest::InitCowDevice() {
    handlers_->DisableVerification();
    const TestParam params = GetParam();
    HandlerOptions options = {
            .num_worker_threads = params.num_threads,
            .num_worker_threads = 1,
            .use_iouring = params.io_uring,
            .o_direct = params.o_direct,
            .cow_op_merge_size = params.cow_op_merge_size,
@@ -1282,7 +1282,7 @@ void HandlerTest::InitializeDevice() {

    const TestParam params = GetParam();
    HandlerOptions options = {
            .num_worker_threads = params.num_threads,
            .num_worker_threads = 1,
            .use_iouring = params.io_uring,
            .o_direct = params.o_direct,
            .cow_op_merge_size = params.cow_op_merge_size,