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

Function dir_delete_entry

src/iocore/cache/CacheDir.cc:322–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320}
321
322inline Dir *
323dir_delete_entry(Dir *e, Dir *p, int s, Stripe *stripe)
324{
325 Dir *seg = stripe->directory.get_segment(s);
326 int no = dir_next(e);
327 stripe->directory.header->dirty = 1;
328 if (p) {
329 unsigned int fo = stripe->directory.header->freelist[s];
330 unsigned int eo = dir_to_offset(e, seg);
331 dir_clear(e);
332 dir_set_next(p, no);
333 dir_set_next(e, fo);
334 if (fo) {
335 dir_set_prev(dir_from_offset(fo, seg), eo);
336 }
337 stripe->directory.header->freelist[s] = eo;
338 } else {
339 Dir *n = next_dir(e, seg);
340 if (n) {
341 dir_assign(e, n);
342 dir_delete_entry(n, e, s, stripe);
343 return e;
344 } else {
345 dir_clear(e);
346 return nullptr;
347 }
348 }
349 return dir_from_offset(no, seg);
350}
351
352inline void
353dir_clean_bucket(Dir *b, int s, Stripe *stripe)

Callers 5

dir_clean_bucketFunction · 0.85
dir_probeFunction · 0.85
dir_deleteFunction · 0.85
dir_delete_entryMethod · 0.85
walk_bucket_chainMethod · 0.85

Calls 4

get_segmentMethod · 0.80
dir_to_offsetFunction · 0.70
dir_from_offsetFunction · 0.70
next_dirFunction · 0.70

Tested by

no test coverage detected