msg/async/rdma: initialize some variables in-class

1. initialize RDMAServerSocketImpl member

2. initialize RDMAConnectedSocketImpl member

3. pollfd::revents
   Though it won't result in any error here, it's better to
   initialize the pollfd structure obj's revents to be 0.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
This commit is contained in:
Changcheng Liu 2019-09-10 18:54:10 +08:00
parent d557e649c8
commit 30a35bd58f
2 changed files with 7 additions and 6 deletions

View File

@ -60,6 +60,7 @@ int RDMAIWARPServerSocketImpl::accept(ConnectedSocket *sock, const SocketOptions
struct pollfd pfd = {
.fd = cm_channel->fd,
.events = POLLIN,
.revents = 0,
};
int ret = poll(&pfd, 1, 0);
ceph_assert(ret >= 0);

View File

@ -274,13 +274,13 @@ class RDMAIWARPConnectedSocketImpl : public RDMAConnectedSocketImpl {
void close_notify();
private:
rdma_cm_id *cm_id;
rdma_event_channel *cm_channel;
rdma_cm_id *cm_id = nullptr;
rdma_event_channel *cm_channel = nullptr;
EventCallbackRef cm_con_handler;
std::mutex close_mtx;
std::condition_variable close_condition;
bool closed;
RDMA_CM_STATUS status;
bool closed = false;
RDMA_CM_STATUS status = IDLE;
class C_handle_cm_connection : public EventCallback {
@ -324,8 +324,8 @@ class RDMAIWARPServerSocketImpl : public RDMAServerSocketImpl {
virtual int accept(ConnectedSocket *s, const SocketOptions &opts, entity_addr_t *out, Worker *w) override;
virtual void abort_accept() override;
private:
rdma_cm_id *cm_id;
rdma_event_channel *cm_channel;
rdma_cm_id *cm_id = nullptr;
rdma_event_channel *cm_channel = nullptr;
};
class RDMAStack : public NetworkStack {