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

Method removeEvent

src/iocore/cache/CacheVC.cc:540–621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538}
539
540int
541CacheVC::removeEvent(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
542{
543 cancel_trigger();
544 set_io_not_in_progress();
545 {
546 MUTEX_TRY_LOCK(lock, stripe->mutex, mutex->thread_holding);
547 if (!lock.is_locked()) {
548 VC_SCHED_LOCK_RETRY();
549 }
550 if (_action.cancelled) {
551 if (od) {
552 stripe->close_write(this);
553 od = nullptr;
554 }
555 goto Lfree;
556 }
557 if (!f.remove_aborted_writers) {
558 if (stripe->open_write(this, true, 1)) {
559 // writer exists
560 od = stripe->open_read(&key);
561 ink_release_assert(od);
562 od->dont_update_directory = true;
563 od = nullptr;
564 } else {
565 od->dont_update_directory = true;
566 }
567 f.remove_aborted_writers = 1;
568 }
569 Lread:
570 SET_HANDLER(&CacheVC::removeEvent);
571 if (!buf) {
572 goto Lcollision;
573 }
574 if (!stripe->dir_valid(&dir)) {
575 last_collision = nullptr;
576 goto Lcollision;
577 }
578 // check read completed correct FIXME: remove bad vols
579 if (!io.ok()) {
580 goto Ldone;
581 }
582 {
583 // verify that this is our document
584 Doc *doc = reinterpret_cast<Doc *>(buf->data());
585 /* should be first_key not key..right?? */
586 if (doc->first_key == key) {
587 ink_assert(doc->magic == DOC_MAGIC);
588 if (dir_delete(&key, stripe, &dir) > 0) {
589 if (od) {
590 stripe->close_write(this);
591 }
592 od = nullptr;
593 goto Lremoved;
594 }
595 goto Ldone;
596 }
597 }

Callers 1

removeMethod · 0.80

Calls 12

dir_deleteFunction · 0.85
dir_probeFunction · 0.85
incrementFunction · 0.85
this_ethreadFunction · 0.85
free_CacheVCFunction · 0.85
close_writeMethod · 0.45
open_writeMethod · 0.45
open_readMethod · 0.45
dir_validMethod · 0.45
okMethod · 0.45
dataMethod · 0.45
handleEventMethod · 0.45

Tested by

no test coverage detected