Skip to content

Commit

Permalink
Use unique StatusCode for IoRing shutdown (handlers for incomplete ops).
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyastolfi committed Feb 29, 2024
1 parent 2a19883 commit 1191725
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/llfs/ioring_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ IoRingImpl::~IoRingImpl() noexcept
}

batt::invoke_all_handlers(&this->completions_, //
StatusOr<i32>{Status{batt::StatusCode::kClosed}});
StatusOr<i32>{::llfs::make_status(StatusCode::kIoRingShutDown)});
}

//==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - -
Expand Down
3 changes: 2 additions & 1 deletion src/llfs/ioring_log_flush_op.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@ inline bool BasicIoRingLogFlushOp<DriverImpl>::handle_errors(const StatusOr<i32>
}
return true;
}
if (!this->quiet_failure_logging) {
if (!this->quiet_failure_logging &&
result.status() != ::llfs::make_status(StatusCode::kIoRingShutDown)) {
LLFS_LOG_INFO() << "flush failed: " << result.status();
} else {
LLFS_VLOG(1) << "flush failed: " << result.status();
Expand Down
3 changes: 3 additions & 0 deletions src/llfs/status_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ bool initialize_status_codes()
"PageCache::put_view failed; page layout id is not registered"), // 62,
CODE_WITH_MSG_(StatusCode::kPageCacheSlotNotInitialized,
"The page cache slot for this PageId is not initialized"), // 63,
CODE_WITH_MSG_(
StatusCode::kIoRingShutDown,
"The operation could not be completed because the IoRing was shut down"), // 64,
});
return initialized;
}
Expand Down
1 change: 1 addition & 0 deletions src/llfs/status_code.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ enum struct StatusCode {
kPageHeaderBadLayoutId = 61,
kPutViewUnknownLayoutId = 62,
kPageCacheSlotNotInitialized = 63,
kIoRingShutDown = 64,
};

bool initialize_status_codes();
Expand Down

0 comments on commit 1191725

Please sign in to comment.