Commit 8228e607 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook GitHub Bot

Fix uninitialized maxSubmit_, maxGet_ member variables

Summary: Fix uninitialized maxSubmit_, maxGet_ member variables

Reviewed By: danobi

Differential Revision: D21645171

fbshipit-source-id: 094ba7b045010954fdebc249318191f956f5b7b2
parent 04b3ad7f
......@@ -102,8 +102,9 @@ IoUringBackend::IoUringBackend(Options options)
params_.cq_entries = options.capacity;
// allocate entries both for poll add and cancel
if (::io_uring_queue_init_params(2 * maxSubmit_, &ioRing_, &params_)) {
LOG(ERROR) << "io_uring_queue_init_params(" << 2 * maxSubmit_ << ","
if (::io_uring_queue_init_params(
2 * options_.maxSubmit, &ioRing_, &params_)) {
LOG(ERROR) << "io_uring_queue_init_params(" << 2 * options_.maxSubmit << ","
<< params_.cq_entries << ") "
<< "failed errno = " << errno << ":\"" << folly::errnoStr(errno)
<< "\" " << this;
......@@ -248,7 +249,7 @@ int IoUringBackend::getActiveEvents(WaitForEventsMode waitForEvents) {
} else {
::io_uring_peek_cqe(&ioRing_, &cqe);
}
while (cqe && (i < maxGet_)) {
while (cqe && (i < options_.maxGet)) {
i++;
IoSqe* sqe = reinterpret_cast<IoSqe*>(io_uring_cqe_get_data(cqe));
sqe->backendCb_(this, sqe, cqe->res);
......@@ -340,7 +341,7 @@ size_t IoUringBackend::submitList(
CHECK_EQ(num, i);
ret += i;
} else {
if (static_cast<size_t>(i) == maxSubmit_) {
if (static_cast<size_t>(i) == options_.maxSubmit) {
int num = submitBusyCheck(i, waitForEvents);
CHECK_EQ(num, i);
ret += i;
......
......@@ -156,12 +156,6 @@ class IoUringBackend : public PollIoBackend {
size_t submit_internal();
// submit
size_t maxSubmit_;
// process
size_t maxGet_;
std::unique_ptr<IoSqe[]> entries_;
// io_uring related
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment