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

Method check_loop

src/traffic_cache_tool/CacheDefs.cc:687–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

685}
686
687int
688StripeSM::check_loop(int s)
689{
690 // look for loop in the segment
691 // rewrite the freelist if loop is present
692 CacheDirEntry *seg = this->dir_segment(s);
693 CacheDirEntry *e = dir_from_offset(this->freelist[s], seg);
694 std::bitset<65536> f_bitset;
695 f_bitset.reset();
696 while (e) {
697 int i = dir_next(e);
698 if (f_bitset.test(i)) {
699 // bit was set in a previous round so a loop is present
700 std::cout << "<check_loop> Loop present in Span" << this->_span->_path.string() << " Stripe: " << this->hashText
701 << "Segment: " << s << std::endl;
702 this->dir_init_segment(s);
703 return 1;
704 }
705 f_bitset[i] = true;
706 e = dir_from_offset(i, seg);
707 }
708
709 return 0;
710}
711
712int
713compare_ushort(void const *a, void const *b)

Callers 2

dir_freelist_lengthMethod · 0.95
Check_FreelistFunction · 0.80

Calls 6

dir_segmentMethod · 0.95
dir_init_segmentMethod · 0.95
dir_from_offsetFunction · 0.70
resetMethod · 0.45
testMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected