Skip to content

Commit

Permalink
Make define name clear
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Dec 19, 2012
1 parent 1747fbe commit 59e1cf5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions libknet/handle.c
Expand Up @@ -106,9 +106,9 @@ knet_handle_t knet_handle_new(uint16_t host_id,
goto exit_fail5;
}

knet_h->tap_to_links_epollfd = epoll_create(KNET_MAX_EVENTS);
knet_h->recv_from_links_epollfd = epoll_create(KNET_MAX_EVENTS);
knet_h->dst_link_handler_epollfd = epoll_create(KNET_MAX_EVENTS);
knet_h->tap_to_links_epollfd = epoll_create(KNET_EPOLL_MAX_EVENTS);
knet_h->recv_from_links_epollfd = epoll_create(KNET_EPOLL_MAX_EVENTS);
knet_h->dst_link_handler_epollfd = epoll_create(KNET_EPOLL_MAX_EVENTS);

if ((knet_h->tap_to_links_epollfd < 0) ||
(knet_h->recv_from_links_epollfd < 0) ||
Expand Down
12 changes: 6 additions & 6 deletions libknet/threads.c
Expand Up @@ -632,15 +632,15 @@ void *_handle_heartbt_thread(void *data)
void *_handle_tap_to_links_thread(void *data)
{
knet_handle_t knet_h = (knet_handle_t) data;
struct epoll_event events[KNET_MAX_EVENTS];
struct epoll_event events[KNET_EPOLL_MAX_EVENTS];
int i, nev;

/* preparing data buffer */
knet_h->tap_to_links_buf->kf_version = KNET_FRAME_VERSION;
knet_h->tap_to_links_buf->kf_node = htons(knet_h->host_id);

while (1) {
nev = epoll_wait(knet_h->tap_to_links_epollfd, events, KNET_MAX_EVENTS, -1);
nev = epoll_wait(knet_h->tap_to_links_epollfd, events, KNET_EPOLL_MAX_EVENTS, -1);

for (i = 0; i < nev; i++) {
if (events[i].data.fd == knet_h->sockfd) {
Expand All @@ -660,10 +660,10 @@ void *_handle_recv_from_links_thread(void *data)
{
int i, nev;
knet_handle_t knet_h = (knet_handle_t) data;
struct epoll_event events[KNET_MAX_EVENTS];
struct epoll_event events[KNET_EPOLL_MAX_EVENTS];

while (1) {
nev = epoll_wait(knet_h->recv_from_links_epollfd, events, KNET_MAX_EVENTS, -1);
nev = epoll_wait(knet_h->recv_from_links_epollfd, events, KNET_EPOLL_MAX_EVENTS, -1);

for (i = 0; i < nev; i++) {
_handle_recv_from_links(knet_h, events[i].data.fd);
Expand All @@ -676,10 +676,10 @@ void *_handle_recv_from_links_thread(void *data)
void *_handle_dst_link_handler_thread(void *data)
{
knet_handle_t knet_h = (knet_handle_t) data;
struct epoll_event events[KNET_MAX_EVENTS];
struct epoll_event events[KNET_EPOLL_MAX_EVENTS];

while (1) {
if (epoll_wait(knet_h->dst_link_handler_epollfd, events, KNET_MAX_EVENTS, -1) >= 1)
if (epoll_wait(knet_h->dst_link_handler_epollfd, events, KNET_EPOLL_MAX_EVENTS, -1) >= 1)
_handle_dst_link_updates(knet_h);
}

Expand Down
2 changes: 1 addition & 1 deletion libknet/threads.h
Expand Up @@ -10,7 +10,7 @@
#ifndef __THREADS_H__
#define __THREADS_H__

#define KNET_MAX_EVENTS 8
#define KNET_EPOLL_MAX_EVENTS 8

void *_handle_tap_to_links_thread(void *data);
void *_handle_recv_from_links_thread(void *data);
Expand Down

0 comments on commit 59e1cf5

Please sign in to comment.