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

Commit f16b2f79 authored by David Anderson's avatar David Anderson Committed by Gerrit Code Review
Browse files

Merge "snapuserd: Remove dead code from legacy snapuserd."

parents b8304d15 5c4a2655
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -509,10 +509,8 @@ bool Snapuserd::ReadMetadata() {
            // in the file.
            //===========================================================
            uint64_t block_source = cow_op->source;
            uint64_t block_offset = 0;
            if (prev_id.has_value()) {
                if (dest_blocks.count(cow_op->new_block) || source_blocks.count(block_source) ||
                    (block_offset > 0 && source_blocks.count(block_source + 1))) {
                if (dest_blocks.count(cow_op->new_block) || source_blocks.count(block_source)) {
                    break;
                }
            }
@@ -520,9 +518,6 @@ bool Snapuserd::ReadMetadata() {
            pending_ordered_ops -= 1;
            vec.push_back(cow_op);
            dest_blocks.insert(block_source);
            if (block_offset > 0) {
                dest_blocks.insert(block_source + 1);
            }
            source_blocks.insert(cow_op->new_block);
            prev_id = cow_op->new_block;
            cowop_rm_iter->Next();
+1 −6
Original line number Diff line number Diff line
@@ -173,16 +173,11 @@ ReadAheadThread::ReadAheadThread(const std::string& cow_device, const std::strin

void ReadAheadThread::CheckOverlap(const CowOperation* cow_op) {
    uint64_t source_block = cow_op->source;
    uint64_t source_offset = 0;
    if (dest_blocks_.count(cow_op->new_block) || source_blocks_.count(source_block) ||
        (source_offset > 0 && source_blocks_.count(source_block + 1))) {
    if (dest_blocks_.count(cow_op->new_block) || source_blocks_.count(source_block)) {
        overlap_ = true;
    }

    dest_blocks_.insert(source_block);
    if (source_offset > 0) {
        dest_blocks_.insert(source_block + 1);
    }
    source_blocks_.insert(cow_op->new_block);
}