| 550 | } |
| 551 | |
| 552 | Status BufferPool::Client::StartMoveEvictedToPinned( |
| 553 | unique_lock<mutex>* client_lock, ClientHandle* client, Page* page) { |
| 554 | DCHECK(!page->buffer.is_open()); |
| 555 | |
| 556 | // Safe to modify the page's buffer handle without holding the page lock because no |
| 557 | // concurrent operations can modify evicted pages. |
| 558 | BufferHandle buffer; |
| 559 | RETURN_IF_ERROR(pool_->allocator_->Allocate(client, page->len, &page->buffer)); |
| 560 | COUNTER_ADD(counters().bytes_read, page->len); |
| 561 | COUNTER_ADD(counters().read_io_ops, 1); |
| 562 | RETURN_IF_ERROR( |
| 563 | file_group_->ReadAsync(page->write_handle.get(), page->buffer.mem_range())); |
| 564 | pinned_pages_.Enqueue(page); |
| 565 | page->pin_in_flight.Store(true); |
| 566 | DCHECK_CONSISTENCY(); |
| 567 | return Status::OK(); |
| 568 | } |
| 569 | |
| 570 | void BufferPool::Client::UndoMoveEvictedToPinned(Page* page) { |
| 571 | // We need to get the page back to the evicted state where: |