svn commit: samba r20621 - in branches/SAMBA_4_0/source/lib/events:
.
tridge at samba.org
tridge at samba.org
Tue Jan 9 00:00:31 GMT 2007
Author: tridge
Date: 2007-01-09 00:00:30 +0000 (Tue, 09 Jan 2007)
New Revision: 20621
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20621
Log:
- enable the aio events backend on systems that support it
- allow the events backend to be chosen in smb.conf
Modified:
branches/SAMBA_4_0/source/lib/events/config.mk
branches/SAMBA_4_0/source/lib/events/events.c
branches/SAMBA_4_0/source/lib/events/events_aio.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/events/config.mk
===================================================================
--- branches/SAMBA_4_0/source/lib/events/config.mk 2007-01-08 23:36:55 UTC (rev 20620)
+++ branches/SAMBA_4_0/source/lib/events/config.mk 2007-01-09 00:00:30 UTC (rev 20621)
@@ -1,4 +1,12 @@
##############################
+[MODULE::EVENTS_AIO]
+OBJ_FILES = events_aio.o
+PRIVATE_DEPENDENCIES = LIBAIO_LINUX
+SUBSYSTEM = LIBEVENTS
+INIT_FUNCTION = events_aio_init
+##############################
+
+##############################
[MODULE::EVENTS_EPOLL]
OBJ_FILES = events_epoll.o
SUBSYSTEM = LIBEVENTS
@@ -24,6 +32,6 @@
# Start SUBSYSTEM LIBEVENTS
[SUBSYSTEM::LIBEVENTS]
OBJ_FILES = events.o events_timed.o
-PUBLIC_DEPENDENCIES = LIBTALLOC EVENTS_STANDARD EVENTS_EPOLL
+PUBLIC_DEPENDENCIES = LIBTALLOC EVENTS_STANDARD EVENTS_AIO EVENTS_EPOLL
# End SUBSYSTEM LIBEVENTS
##############################
Modified: branches/SAMBA_4_0/source/lib/events/events.c
===================================================================
--- branches/SAMBA_4_0/source/lib/events/events.c 2007-01-08 23:36:55 UTC (rev 20620)
+++ branches/SAMBA_4_0/source/lib/events/events.c 2007-01-09 00:00:30 UTC (rev 20621)
@@ -157,6 +157,10 @@
event_backend_init();
+ if (name == NULL) {
+ name = "standard";
+ }
+
for (e=event_backends;e;e=e->next) {
if (strcmp(name, e->name) == 0) {
return event_context_init_ops(mem_ctx, e->ops);
@@ -173,7 +177,7 @@
*/
struct event_context *event_context_init(TALLOC_CTX *mem_ctx)
{
- return event_context_init_byname(mem_ctx, "standard");
+ return event_context_init_byname(mem_ctx, NULL);
}
/*
@@ -246,6 +250,7 @@
return ev->ops->loop_wait(ev);
}
+#if _SAMBA_BUILD_
/*
find an event context that is a parent of the given memory context,
or create a new event context as a child of the given context if
@@ -258,8 +263,10 @@
struct event_context *event_context_find(TALLOC_CTX *mem_ctx)
{
struct event_context *ev = talloc_find_parent_bytype(mem_ctx, struct event_context);
- if (ev == NULL) {
- ev = event_context_init(mem_ctx);
+ if (ev == NULL) {
+ ev = event_context_init_byname(mem_ctx,
+ lp_parm_string(-1, "event", "backend"));
}
return ev;
}
+#endif
Modified: branches/SAMBA_4_0/source/lib/events/events_aio.c
===================================================================
--- branches/SAMBA_4_0/source/lib/events/events_aio.c 2007-01-08 23:36:55 UTC (rev 20620)
+++ branches/SAMBA_4_0/source/lib/events/events_aio.c 2007-01-09 00:00:30 UTC (rev 20621)
@@ -268,9 +268,6 @@
uint16_t flags = 0;
int j;
-// DEBUG(0,("EVENT finished=%p fde=%p ep=%p\n", finished, fde, ep));
- //printf("GOT %d aio epoll events\n", event->res);
-
aio_ev->is_epoll_set = 0;
for (j=0; j<event->res; j++, ep++) {
More information about the samba-cvs
mailing list