Helper function to allocate the memory for a reading buffer block. Caller should hold both physical_file_lock_ and the lock of the read buffer block.
| 428 | // Helper function to allocate the memory for a reading buffer block. |
| 429 | // Caller should hold both physical_file_lock_ and the lock of the read buffer block. |
| 430 | Status AllocReadBufferBlockLocked(MemBlock* read_buffer_block, int64_t size, |
| 431 | const boost::shared_lock<boost::shared_mutex>& file_lock, |
| 432 | const std::unique_lock<SpinLock>& block_lock) { |
| 433 | DCheckMemBlock(file_lock, read_buffer_block); |
| 434 | return read_buffer_block->AllocLocked(block_lock, size); |
| 435 | } |
| 436 | |
| 437 | // Helper function to set the status of a memory block. |
| 438 | // Caller should hold the physical_file_lock_. |