MCPcopy Create free account
hub / github.com/apache/trafficserver / acquire

Method acquire

src/iocore/cache/PreservationTable.cc:121–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121int
122PreservationTable::acquire(Dir const &dir, CacheKey const &key)
123{
124 int bucket = dir_evac_bucket(&dir);
125 if (EvacuationBlock * b{this->find(dir, bucket)}; nullptr != b) {
126 if (b->readers) {
127 ++b->readers;
128 }
129 return 0;
130 }
131 // we don't actually need to preserve this block as it is already in
132 // memory, but this is easier, and evacuations are rare
133 EvacuationBlock *b = new_EvacuationBlock();
134 b->readers = 1;
135 b->dir = dir;
136 b->evac_frags.key = key;
137 this->evacuate[bucket].push(b);
138 return 1;
139}
140
141void
142PreservationTable::release(Dir const &dir)

Callers 1

begin_readMethod · 0.45

Calls 3

findMethod · 0.95
new_EvacuationBlockFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected