Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unique StatusCode for IoRing shutdown (handlers for incomplete ops). #142

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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