mirror of
https://github.com/samba-team/samba.git
synced 2025-11-02 20:23:50 +03:00
r21212: detect if the kernel does not support integrated epoll/aio when the
event context is created. This allows the LOCAL-EVENT test to pass on systems with have libaio but not the necessary kernel patches
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
e680656419
commit
2ff8abf002
@@ -324,15 +324,25 @@ static int aio_event_context_init(struct event_context *ev)
|
|||||||
aio_ev->epoll_iocb = talloc(aio_ev, struct iocb);
|
aio_ev->epoll_iocb = talloc(aio_ev, struct iocb);
|
||||||
|
|
||||||
if (io_queue_init(MAX_AIO_QUEUE_DEPTH, &aio_ev->ioctx) != 0) {
|
if (io_queue_init(MAX_AIO_QUEUE_DEPTH, &aio_ev->ioctx) != 0) {
|
||||||
|
talloc_free(aio_ev);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
aio_ev->epoll_fd = epoll_create(MAX_AIO_QUEUE_DEPTH);
|
aio_ev->epoll_fd = epoll_create(MAX_AIO_QUEUE_DEPTH);
|
||||||
if (aio_ev->epoll_fd == -1) return -1;
|
if (aio_ev->epoll_fd == -1) {
|
||||||
|
talloc_free(aio_ev);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
talloc_set_destructor(aio_ev, aio_ctx_destructor);
|
talloc_set_destructor(aio_ev, aio_ctx_destructor);
|
||||||
|
|
||||||
ev->additional_data = aio_ev;
|
ev->additional_data = aio_ev;
|
||||||
|
|
||||||
|
if (setup_epoll_wait(aio_ev) < 0) {
|
||||||
|
talloc_free(aio_ev);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user