1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

22 Commits

Author SHA1 Message Date
Stefan Metzmacher
e29830a60f s3:include: avoid TEVENT_COMPAT_DEFINES
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:48:04 +01:00
Stefan Metzmacher
5743277ed6 s3:nmbd: s/struct event_context/struct tevent_context
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:53 +01:00
Stefan Metzmacher
36f4547401 s3:includes: remove event_context_init() define for s3_tevent_context_init()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:50 +01:00
Andrew Bartlett
c599d075cb s3-lib Move event_add_idle() to source3/lib/events.c
This allows libauth not to depend on smbd_base.

Andrew Bartlett
2011-07-04 18:53:59 +10:00
Günther Deschner
fbd0ff69ec s3: try to fix the build on some non-linux buildfarm machines.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Mar 30 11:39:31 CEST 2011 on sn-devel-104
2011-03-30 11:39:31 +02:00
Volker Lendecke
cf7d331511 s3: Remove select-based s3 event backend 2011-02-28 16:40:19 +01:00
Volker Lendecke
ea5e1c5ecb s3: Use poll for the event loop 2011-02-28 16:40:19 +01:00
Stefan Metzmacher
19d3779274 Revert "s3:events: Call all ready fd event handlers on each iteration of the main loop"
This reverts commit 455fccf86b.

I'll add a more generic fix for this problem.

metze
2011-01-31 16:16:09 +01:00
Jeremy Allison
30d29e64cb All calls to event_add_to_select_args() call GetTimeOfDay() and
pass this in as the &now parameter. Push this call inside of
event_add_to_select_args() to the correct point so it doesn't
get called unless needed.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Dec 23 01:08:11 CET 2010 on sn-devel-104
2010-12-23 01:08:11 +01:00
Steven Danneman
455fccf86b s3:events: Call all ready fd event handlers on each iteration of the main loop
Previously, only one fd handler was being called per main message loop
in all smbd child processes.

In the case where multiple fds are available for reading the fd
corresponding to the event closest to the beginning of the event list
would be run.  Obviously this is arbitrary and could cause unfairness.

Usually, the first event fd is the network socket, meaning heavy load
of client requests can starve out other fd events such as oplock
or notify upcalls from the kernel.

In this patch, I have changed the behavior of run_events() to unset
any fd that it has already called a handler function, as well
as decrement the number of fds that were returned from select().
This allows the caller of run_events() to iterate it, until all
available fds have been handled.

I then changed the main loop in smbd child processes to iterate
run_events().  This way, all available fds are handled on each wake
of select, while still checking for timed or signalled events between
each handler function call.  I also added an explicit check for
EINTR from select(), which previously was masked by the fact that
run_events() would handle any signal event before the return code
was checked.

This required a signature change to run_events() but all other callers
should have no change in their behavior.  I also fixed a bug in
run_events() where it could be called with a selrtn value of -1,
doing unecessary looping through the fd_event list when no fds were
available.

Also, remove the temporary echo handler hack, as all fds should be
treated fairly now.
2010-10-01 13:31:33 -07:00
Andrew Tridgell
772839640e s3-event: switch s3 to using tevent_re_initialise()
This correctly initialises the event backend, and checks for errors

(thanks to Metze for suggesting this)
2010-03-26 22:07:50 +11:00
Volker Lendecke
6c00a3db24 s3: Remove some unused code 2010-03-14 17:42:49 +01:00
Stefan Metzmacher
303c57ef78 s3:events: register as tevent backend
metze
2009-01-05 15:07:36 +01:00
Stefan Metzmacher
83ff9d3bcd s3:events: get rid of the stupid set_event_dispatch_time() function
metze
2009-01-05 15:07:35 +01:00
Stefan Metzmacher
f1aa4457c3 s3:events: get rid of the stupid cancel_named_event() function
metze
2009-01-05 15:07:35 +01:00
Stefan Metzmacher
c34d5f445a s3:events: change event_add_timed() prototype to match samba4
metze
2009-01-05 15:07:35 +01:00
Stefan Metzmacher
ee5be748e6 s3:events: move prototypes to event.h
metze
2009-01-05 15:07:34 +01:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
d5206610cd r20931: This changes the notify infrastructure from a polling-based to an event-driven
based approach. The only remaining hook into the backend is now

	void *(*notify_add)(TALLOC_CTX *mem_ctx,
			    struct event_context *event_ctx,
			    files_struct *fsp, uint32 *filter);

(Should we put this through the VFS, so that others can more easily plug in?)

The trick here is that the backend can pick filter bits that the main smbd
should not handle anymore. Thanks to tridge for this idea.

The backend can notify the main smbd process via

void notify_fsp(files_struct *fsp, uint32 action, char *name);

The core patch is not big, what makes this more than 1800 lines are the
individual backends that are considerably changed but can be reviewed
one by one.

Based on this I'll continue with inotify now.

Volker
(This used to be commit 9cd6a8a827)
2007-10-10 12:17:21 -05:00
Volker Lendecke
bf219447a3 r20846: Before this gets out of control...
This add a struct event_context and infrastructure for fd events to smbd. This
is step zero to import lib/events.

Jeremy, I rely on you to watch the change in receive_message_or_smb()
closely. For the normal code path this should be the only relevant change. The
rest is either not yet used or is cosmetic.

Volker
(This used to be commit cd07f93a8a)
2007-10-10 12:17:13 -05:00
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00