summaryrefslogtreecommitdiff
path: root/lib/tevent/tevent_aio.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tevent/tevent_aio.c')
-rw-r--r--lib/tevent/tevent_aio.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/lib/tevent/tevent_aio.c b/lib/tevent/tevent_aio.c
index b3cd126a34..746e96060b 100644
--- a/lib/tevent/tevent_aio.c
+++ b/lib/tevent/tevent_aio.c
@@ -45,10 +45,10 @@
struct aio_event_context {
/* a pointer back to the generic event_context */
- struct event_context *ev;
+ struct tevent_context *ev;
/* list of filedescriptor events */
- struct fd_event *fd_events;
+ struct tevent_fd *fd_events;
/* number of registered fd event handlers */
int num_fd_events;
@@ -67,7 +67,7 @@ struct aio_event_context {
};
struct aio_event {
- struct event_context *event_ctx;
+ struct tevent_context *event_ctx;
struct iocb iocb;
void *private_data;
event_aio_handler_t handler;
@@ -95,7 +95,7 @@ static int aio_ctx_destructor(struct aio_event_context *aio_ev)
return 0;
}
-static void epoll_add_event(struct aio_event_context *aio_ev, struct fd_event *fde);
+static void epoll_add_event(struct aio_event_context *aio_ev, struct tevent_fd *fde);
/*
reopen the epoll handle when our pid changes
@@ -104,7 +104,7 @@ static void epoll_add_event(struct aio_event_context *aio_ev, struct fd_event *f
*/
static void epoll_check_reopen(struct aio_event_context *aio_ev)
{
- struct fd_event *fde;
+ struct tevent_fd *fde;
if (aio_ev->pid == getpid()) {
return;
@@ -129,7 +129,7 @@ static void epoll_check_reopen(struct aio_event_context *aio_ev)
/*
add the epoll event to the given fd_event
*/
-static void epoll_add_event(struct aio_event_context *aio_ev, struct fd_event *fde)
+static void epoll_add_event(struct aio_event_context *aio_ev, struct tevent_fd *fde)
{
struct epoll_event event;
if (aio_ev->epoll_fd == -1) return;
@@ -154,7 +154,7 @@ static void epoll_add_event(struct aio_event_context *aio_ev, struct fd_event *f
/*
delete the epoll event for given fd_event
*/
-static void epoll_del_event(struct aio_event_context *aio_ev, struct fd_event *fde)
+static void epoll_del_event(struct aio_event_context *aio_ev, struct tevent_fd *fde)
{
struct epoll_event event;
@@ -178,7 +178,7 @@ static void epoll_del_event(struct aio_event_context *aio_ev, struct fd_event *f
/*
change the epoll event to the given fd_event
*/
-static void epoll_mod_event(struct aio_event_context *aio_ev, struct fd_event *fde)
+static void epoll_mod_event(struct aio_event_context *aio_ev, struct tevent_fd *fde)
{
struct epoll_event event;
if (aio_ev->epoll_fd == -1) return;
@@ -196,7 +196,7 @@ static void epoll_mod_event(struct aio_event_context *aio_ev, struct fd_event *f
}
}
-static void epoll_change_event(struct aio_event_context *aio_ev, struct fd_event *fde)
+static void epoll_change_event(struct aio_event_context *aio_ev, struct tevent_fd *fde)
{
bool got_error = (fde->additional_flags & EPOLL_ADDITIONAL_FD_FLAG_GOT_ERROR);
bool want_read = (fde->flags & EVENT_FD_READ);
@@ -308,7 +308,7 @@ static int aio_event_loop(struct aio_event_context *aio_ev, struct timeval *tval
}
case IOCB_CMD_EPOLL_WAIT: {
struct epoll_event *ep = (struct epoll_event *)finished->u.c.buf;
- struct fd_event *fde;
+ struct tevent_fd *fde;
uint16_t flags = 0;
int j;
@@ -316,7 +316,7 @@ static int aio_event_loop(struct aio_event_context *aio_ev, struct timeval *tval
for (j=0; j<event->res; j++, ep++) {
fde = talloc_get_type(ep->data.ptr,
- struct fd_event);
+ struct tevent_fd);
if (fde == NULL) {
return -1;
}
@@ -348,7 +348,7 @@ static int aio_event_loop(struct aio_event_context *aio_ev, struct timeval *tval
/*
create a aio_event_context structure.
*/
-static int aio_event_context_init(struct event_context *ev)
+static int aio_event_context_init(struct tevent_context *ev)
{
struct aio_event_context *aio_ev;
@@ -385,9 +385,9 @@ static int aio_event_context_init(struct event_context *ev)
/*
destroy an fd_event
*/
-static int aio_event_fd_destructor(struct fd_event *fde)
+static int aio_event_fd_destructor(struct tevent_fd *fde)
{
- struct event_context *ev = fde->event_ctx;
+ struct tevent_context *ev = fde->event_ctx;
struct aio_event_context *aio_ev = talloc_get_type(ev->additional_data,
struct aio_event_context);
@@ -410,18 +410,18 @@ static int aio_event_fd_destructor(struct fd_event *fde)
add a fd based event
return NULL on failure (memory allocation error)
*/
-static struct fd_event *aio_event_add_fd(struct event_context *ev, TALLOC_CTX *mem_ctx,
+static struct tevent_fd *aio_event_add_fd(struct tevent_context *ev, TALLOC_CTX *mem_ctx,
int fd, uint16_t flags,
event_fd_handler_t handler,
void *private_data)
{
struct aio_event_context *aio_ev = talloc_get_type(ev->additional_data,
struct aio_event_context);
- struct fd_event *fde;
+ struct tevent_fd *fde;
epoll_check_reopen(aio_ev);
- fde = talloc(mem_ctx?mem_ctx:ev, struct fd_event);
+ fde = talloc(mem_ctx?mem_ctx:ev, struct tevent_fd);
if (!fde) return NULL;
fde->event_ctx = ev;
@@ -445,7 +445,7 @@ static struct fd_event *aio_event_add_fd(struct event_context *ev, TALLOC_CTX *m
/*
return the fd event flags
*/
-static uint16_t aio_event_get_fd_flags(struct fd_event *fde)
+static uint16_t aio_event_get_fd_flags(struct tevent_fd *fde)
{
return fde->flags;
}
@@ -453,9 +453,9 @@ static uint16_t aio_event_get_fd_flags(struct fd_event *fde)
/*
set the fd event flags
*/
-static void aio_event_set_fd_flags(struct fd_event *fde, uint16_t flags)
+static void aio_event_set_fd_flags(struct tevent_fd *fde, uint16_t flags)
{
- struct event_context *ev;
+ struct tevent_context *ev;
struct aio_event_context *aio_ev;
if (fde->flags == flags) return;
@@ -473,7 +473,7 @@ static void aio_event_set_fd_flags(struct fd_event *fde, uint16_t flags)
/*
do a single event loop using the events defined in ev
*/
-static int aio_event_loop_once(struct event_context *ev)
+static int aio_event_loop_once(struct tevent_context *ev)
{
struct aio_event_context *aio_ev = talloc_get_type(ev->additional_data,
struct aio_event_context);
@@ -492,7 +492,7 @@ static int aio_event_loop_once(struct event_context *ev)
/*
return on failure or (with 0) if all fd events are removed
*/
-static int aio_event_loop_wait(struct event_context *ev)
+static int aio_event_loop_wait(struct tevent_context *ev)
{
struct aio_event_context *aio_ev = talloc_get_type(ev->additional_data,
struct aio_event_context);
@@ -510,7 +510,7 @@ static int aio_event_loop_wait(struct event_context *ev)
*/
static int aio_destructor(struct aio_event *ae)
{
- struct event_context *ev = ae->event_ctx;
+ struct tevent_context *ev = ae->event_ctx;
struct aio_event_context *aio_ev = talloc_get_type(ev->additional_data,
struct aio_event_context);
struct io_event result;
@@ -520,7 +520,7 @@ static int aio_destructor(struct aio_event *ae)
}
/* submit an aio disk IO event */
-static struct aio_event *aio_event_add_aio(struct event_context *ev,
+static struct aio_event *aio_event_add_aio(struct tevent_context *ev,
TALLOC_CTX *mem_ctx,
struct iocb *iocb,
event_aio_handler_t handler,