@@ -207,7 +207,7 @@ class VolumeIOImpl {
207207 vol_mgr->write (m_vol_ptr, req)
208208 .via (&folly::InlineExecutor::instance ())
209209 .thenValue ([this , data, req, latch, expect_failure](auto && result) {
210- ASSERT_EQ (result.hasError (), expect_failure);
210+ ASSERT_EQ (! result.has_value (), expect_failure);
211211 {
212212 std::lock_guard lock (m_mutex);
213213 m_inflight_ios.erase (boost::icl::interval< int >::closed (req->lba , req->lba + req->nlbas - 1 ));
@@ -245,7 +245,7 @@ class VolumeIOImpl {
245245 vol_mgr->write (m_vol_ptr, req)
246246 .via (&folly::InlineExecutor::instance ())
247247 .thenValue ([this , req, data](auto && result) {
248- RELEASE_ASSERT (! result.hasError (), " Write failed with error={}" , result.error ());
248+ RELEASE_ASSERT (result.has_value (), " Write failed with error={}" , result.error ());
249249 {
250250 std::lock_guard lock (m_mutex);
251251 m_inflight_ios.erase (boost::icl::interval< int >::closed (req->lba , req->lba + req->nlbas - 1 ));
@@ -262,8 +262,8 @@ class VolumeIOImpl {
262262 auto buf = read_blob.bytes ();
263263 vol_interface_req_ptr req (new vol_interface_req{buf, start_lba, nlbas, m_vol_ptr});
264264 auto read_resp = g_helper->inst ()->volume_manager ()->read (m_vol_ptr, req).get ();
265- if (read_resp.hasError ()) { LOGERROR (" Read failed with error={}" , read_resp.error ()); }
266- RELEASE_ASSERT (! read_resp.hasError (), " Read failed with error={}" , read_resp.error ());
265+ if (! read_resp.has_value ()) { LOGERROR (" Read failed with error={}" , read_resp.error ()); }
266+ RELEASE_ASSERT (read_resp.has_value (), " Read failed with error={}" , read_resp.error ());
267267 }
268268
269269 void read_and_verify (lba_t start_lba, uint32_t nlbas) {
@@ -273,8 +273,8 @@ class VolumeIOImpl {
273273 auto buf = read_blob.bytes ();
274274 vol_interface_req_ptr req (new vol_interface_req{buf, start_lba, nlbas, m_vol_ptr});
275275 auto read_resp = g_helper->inst ()->volume_manager ()->read (m_vol_ptr, req).get ();
276- if (read_resp.hasError ()) { LOGERROR (" Read failed with error={}" , read_resp.error ()); }
277- RELEASE_ASSERT (! read_resp.hasError (), " Read failed with error={}" , read_resp.error ());
276+ if (! read_resp.has_value ()) { LOGERROR (" Read failed with error={}" , read_resp.error ()); }
277+ RELEASE_ASSERT (read_resp.has_value (), " Read failed with error={}" , read_resp.error ());
278278 auto read_sz = m_vol_ptr->info ()->page_size ;
279279 for (auto lba = start_lba; lba < start_lba + nlbas; lba++, buf += read_sz) {
280280 uint64_t data_pattern = 0 ;
@@ -305,7 +305,7 @@ class VolumeIOImpl {
305305 ->read (m_vol_ptr, req)
306306 .via (&folly::InlineExecutor::instance ())
307307 .thenValue ([this , read_blob = std::move (read_blob), req](auto && result) {
308- RELEASE_ASSERT (! result.hasError (), " Read failed with error={}" , result.error ());
308+ RELEASE_ASSERT (result.has_value (), " Read failed with error={}" , result.error ());
309309 {
310310 std::lock_guard lock (m_mutex);
311311 m_inflight_ios.erase (boost::icl::interval< int >::closed (req->lba , req->lba + req->nlbas - 1 ));
0 commit comments