| 318 | } |
| 319 | |
| 320 | int |
| 321 | CacheVC::openWriteCloseHeadDone(int event, Event *e) |
| 322 | { |
| 323 | if (event == AIO_EVENT_DONE) { |
| 324 | set_io_not_in_progress(); |
| 325 | } else if (is_io_in_progress()) { |
| 326 | return EVENT_CONT; |
| 327 | } |
| 328 | { |
| 329 | CACHE_TRY_LOCK(lock, stripe->mutex, mutex->thread_holding); |
| 330 | if (!lock.is_locked()) { |
| 331 | VC_LOCK_RETRY_EVENT(); |
| 332 | } |
| 333 | od->writing_vec = false; |
| 334 | if (!io.ok()) { |
| 335 | goto Lclose; |
| 336 | } |
| 337 | ink_assert(f.use_first_key); |
| 338 | if (!od->dont_update_directory) { |
| 339 | if (dir_is_empty(&od->first_dir)) { |
| 340 | dir_insert(&first_key, stripe, &dir); |
| 341 | } else { |
| 342 | // multiple fragment vector write |
| 343 | dir_overwrite(&first_key, stripe, &dir, &od->first_dir, false); |
| 344 | // insert moved resident alternate |
| 345 | if (od->move_resident_alt) { |
| 346 | if (stripe->dir_valid(&od->single_doc_dir)) { |
| 347 | dir_insert(&od->single_doc_key, stripe, &od->single_doc_dir); |
| 348 | } |
| 349 | od->move_resident_alt = false; |
| 350 | } |
| 351 | } |
| 352 | od->first_dir = dir; |
| 353 | if (frag_type == CACHE_FRAG_TYPE_HTTP && f.single_fragment) { |
| 354 | // fragment is tied to the vector |
| 355 | od->move_resident_alt = true; |
| 356 | if (!f.rewrite_resident_alt) { |
| 357 | od->single_doc_key = earliest_key; |
| 358 | } |
| 359 | dir_assign(&od->single_doc_dir, &dir); |
| 360 | dir_set_tag(&od->single_doc_dir, od->single_doc_key.slice32(2)); |
| 361 | } |
| 362 | } |
| 363 | } |
| 364 | Lclose: |
| 365 | return openWriteCloseDir(event, e); |
| 366 | } |
| 367 | |
| 368 | int |
| 369 | CacheVC::openWriteCloseHead(int event, Event *e) |
nothing calls this directly
no test coverage detected