Lines Matching full:duplicate
42 * data_vios in the lock, so the lock will send the agent to the duplicate zone to acquire the PBN
48 * lock on the duplicate block (UNLOCKING), and if the agent is the last data_vio referencing the
243 /* True if the advice has been verified to be a true duplicate */
253 * If verified is false, this is the location of a possible duplicate. If verified is true,
254 * it is the verified location of a true duplicate.
256 struct zoned_pbn duplicate; member
258 /* The PBN lock on the block containing the duplicate data */
267 * against an existing duplicate on disk.
352 * vdo_get_duplicate_lock() - Get the PBN lock on the duplicate data location for a data_vio from
356 * Return: The PBN lock on the data_vio's duplicate location.
405 * set_duplicate_lock() - Set the duplicate lock held by a hash lock. May only be called in the
408 * @pbn_lock: The PBN read lock to use as the duplicate lock.
413 "hash lock must not already hold a duplicate lock"); in set_duplicate_lock()
504 * set_duplicate_location() - Set the location of the duplicate block for data_vio, updating the
505 * is_duplicate and duplicate fields from a zoned_pbn.
507 * @source: The location of the duplicate.
513 data_vio->duplicate = source; in set_duplicate_location()
531 set_duplicate_location(new_agent, lock->duplicate); in retire_lock_agent()
611 /* The agent must reference the duplicate zone to launch it. */ in vdo_clean_failed_hash_lock()
612 data_vio->duplicate = lock->duplicate; in vdo_clean_failed_hash_lock()
624 * duplicate candidate.
637 "must have released the duplicate lock for the hash lock"); in finish_unlocking()
651 * With the lock released, the verified duplicate block may already have changed and will in finish_unlocking()
660 * re-lock and re-verify the duplicate location. in finish_unlocking()
679 * contained duplicate data.
692 "must have a duplicate lock to release"); in unlock_duplicate_pbn()
694 vdo_release_physical_zone_pbn_lock(agent->duplicate.zone, agent->duplicate.pbn, in unlock_duplicate_pbn()
706 * contained duplicate data.
752 * UDS was updated successfully, so don't update again unless the duplicate location in finish_updating()
770 * duplicate PBN lock, so go release it. in finish_updating()
787 * the duplicate that should be returned as advice in the future.
832 * DEDUPING -> UPDATING transition: The location of the duplicate block changed in finish_deduping()
841 * DEDUPING -> UNLOCKING transition: Release the PBN read lock on the duplicate in finish_deduping()
934 * fork_hash_lock() - Fork a hash lock because it has run out of increments on the duplicate PBN.
974 * @has_claim: true if the data_vio already has claimed an increment from the duplicate lock.
989 set_duplicate_location(data_vio, lock->duplicate); in launch_dedupe()
990 data_vio->new_mapped = data_vio->duplicate; in launch_dedupe()
1002 * from the duplicate lock, ensuring the hash lock will still have a data_vio holding it.
1017 "agent must have written the new duplicate"); in start_deduping()
1068 * duplicate candidate.
1095 * Even if the block is a verified duplicate, we can't start to deduplicate unless we can in finish_verifying()
1105 * VERIFYING -> DEDUPING transition: The advice is for a true duplicate, so start in finish_verifying()
1147 result = uncompress_data_vio(agent, agent->duplicate.state, in uncompress_and_verify()
1170 if (vdo_is_state_compressed(agent->duplicate.state)) { in verify_endio()
1186 * decompress) the data at the candidate duplicate location, comparing it to the data in the agent
1195 char *buffer = (vdo_is_state_compressed(agent->duplicate.state) ? in start_verifying()
1204 agent->duplicate.pbn); in start_verifying()
1217 * lock on the candidate duplicate block.
1231 "must not hold duplicate_lock if not flagged as a duplicate"); in finish_locking()
1244 "must hold duplicate_lock if flagged as a duplicate"); in finish_locking()
1249 * the candidate duplicate and comparing it to the agent's data to decide whether in finish_locking()
1250 * it is a true duplicate or stale advice. in finish_locking()
1280 struct vdo_slab *slab = vdo_get_slab(depot, agent->duplicate.pbn); in acquire_provisional_reference()
1281 int result = vdo_acquire_provisional_reference(slab, agent->duplicate.pbn, lock); in acquire_provisional_reference()
1289 vdo_release_physical_zone_pbn_lock(agent->duplicate.zone, in acquire_provisional_reference()
1290 agent->duplicate.pbn, lock); in acquire_provisional_reference()
1297 * duplicate data (compressed or uncompressed).
1313 struct physical_zone *zone = agent->duplicate.zone; in lock_duplicate_pbn()
1321 * the block if it turns out to truly be a duplicate. in lock_duplicate_pbn()
1323 increment_limit = vdo_get_increment_limit(depot, agent->duplicate.pbn); in lock_duplicate_pbn()
1334 result = vdo_attempt_physical_zone_pbn_lock(zone, agent->duplicate.pbn, in lock_duplicate_pbn()
1408 * potential duplicate through its agent.
1415 "must not acquire a duplicate lock when already holding it"); in start_locking()
1420 * TODO: Optimization: If we arrange to continue on the duplicate zone thread when in start_locking()
1448 lock->duplicate = agent->new_mapped; in finish_writing()
1451 if (vdo_is_state_compressed(lock->duplicate.state) && lock->registered) { in finish_writing()
1485 * compressed write gave us a shared duplicate lock that we must release. in finish_writing()
1487 set_duplicate_location(agent, lock->duplicate); in finish_writing()
1492 * duplicate lock held, so both the agent and lock have no more work to do. The in finish_writing()
1547 * start_writing() - Begin the non-duplicate write path.
1551 * Begins the non-duplicate write path for a hash lock that had no advice, selecting a data_vio
1594 * Decode VDO duplicate advice from the old_metadata field of a UDS request.
1604 struct zoned_pbn *advice = &data_vio->duplicate; in decode_uds_advice()
1673 lock->duplicate = agent->duplicate; in finish_querying()
1682 * The agent will be used as the duplicate if has an allocation; if it does, that in finish_querying()
1954 * data_vio's hash lock, converting it to a duplicate PBN lock.
1970 hash_lock->duplicate = data_vio->new_mapped; in transfer_allocation_lock()
1971 data_vio->duplicate = data_vio->new_mapped; in transfer_allocation_lock()
1995 "a duplicate PBN lock should not exist when writing"); in vdo_share_compressed_write_lock()
2008 data_vio->duplicate = data_vio->new_mapped; in vdo_share_compressed_write_lock()
2009 data_vio->hash_lock->duplicate = data_vio->new_mapped; in vdo_share_compressed_write_lock()
2755 (unsigned long long) lock->duplicate.pbn, in dump_hash_lock()
2756 lock->duplicate.state, lock->reference_count, in dump_hash_lock()