change sm->new_block() to return an optional

This commit is contained in:
Joe Thornber
2011-11-16 12:53:37 +00:00
parent 404ca5ba30
commit 876dd2427f
6 changed files with 59 additions and 22 deletions

View File

@@ -167,7 +167,11 @@ thin_pool::get_held_root() const
block_address
thin_pool::alloc_data_block()
{
return md_->data_sm_->new_block();
optional<block_address> mb = md_->data_sm_->new_block();
if (!mb)
throw runtime_error("couldn't allocate new block");
return *mb;
}
void