MCPcopy Create free account
hub / github.com/ceph/ceph / remove_if

Method remove_if

src/common/web_cache.h:427–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425
426template <typename Key, typename Value>
427bool WebCache<Key, Value>::remove_if(
428 const Key& key, const ValuePtr& expected_val) {
429 std::lock_guard<std::shared_mutex> lock(_cache_mutex);
430 if (auto search = _lookup.find(key);
431 (search != _lookup.end() && search->second.value == expected_val)) {
432 auto [_, hand_moved] =
433 sieve_remove_unmutexed(_sieve_queue, _sieve_hand, search->second);
434 _lookup.erase(search);
435 _sieve_hand = hand_moved;
436 return true;
437 }
438 return false;
439}
440
441template <typename Key, typename Value>
442std::optional<typename WebCache<Key, Value>::ValuePtr>

Callers 3

do_cacheMethod · 0.80
TEST_FFunction · 0.80
clear_queued_recoveryMethod · 0.80

Calls 3

findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by 1

TEST_FFunction · 0.64