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

Method dir_delete_entry

src/traffic_cache_tool/CacheDefs.cc:497–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497CacheDirEntry *
498StripeSM::dir_delete_entry(CacheDirEntry *e, CacheDirEntry *p, int s)
499{
500 CacheDirEntry *seg = this->dir_segment(s);
501 int no = dir_next(e);
502 this->_meta[0][0].dirty = 1;
503 if (p) {
504 unsigned int fo = this->freelist[s];
505 unsigned int eo = dir_to_offset(e, seg);
506 dir_clear(e);
507 dir_set_next(p, no);
508 dir_set_next(e, fo);
509 if (fo) {
510 dir_set_prev(dir_from_offset(fo, seg), eo);
511 }
512 this->freelist[s] = eo;
513 } else {
514 CacheDirEntry *n = next_dir(e, seg);
515 if (n) {
516 dir_assign(e, n);
517 dir_delete_entry(n, e, s);
518 return e;
519 } else {
520 dir_clear(e);
521 return nullptr;
522 }
523 }
524 return dir_from_offset(no, seg);
525}
526
527void
528StripeSM::walk_all_buckets()

Callers

nothing calls this directly

Calls 5

dir_segmentMethod · 0.95
dir_delete_entryFunction · 0.85
dir_to_offsetFunction · 0.70
dir_from_offsetFunction · 0.70
next_dirFunction · 0.70

Tested by

no test coverage detected