summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-01-05 18:01:04 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-01-05 18:01:04 +0100
commit37e6849d451c4f49c6a0c96a78a5ef81baab83d4 (patch)
treed1e443f66fa367340ef04d39349e50e7100b9b5f /source3/smbd
parentde7dc2cec059305d28cc75a5347bfd88f3cb5c95 (diff)
parent0581094023ba5e561184a2ea57f6e905161de978 (diff)
downloadsamba-37e6849d451c4f49c6a0c96a78a5ef81baab83d4.tar.gz
samba-37e6849d451c4f49c6a0c96a78a5ef81baab83d4.tar.bz2
samba-37e6849d451c4f49c6a0c96a78a5ef81baab83d4.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/blocking.c4
-rw-r--r--source3/smbd/dnsregister.c1
-rw-r--r--source3/smbd/fileio.c3
-rw-r--r--source3/smbd/oplock.c3
-rw-r--r--source3/smbd/process.c27
-rw-r--r--source3/smbd/server.c7
6 files changed, 26 insertions, 19 deletions
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index 2237a89ace..2b90d24c87 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -68,7 +68,7 @@ static void process_blocking_lock_queue(void);
static void brl_timeout_fn(struct event_context *event_ctx,
struct timed_event *te,
- const struct timeval *now,
+ struct timeval now,
void *private_data)
{
SMB_ASSERT(brl_timeout == te);
@@ -123,7 +123,7 @@ static bool recalc_brl_timeout(void)
}
if (!(brl_timeout = event_add_timed(smbd_event_context(), NULL,
- next_timeout, "brl_timeout",
+ next_timeout,
brl_timeout_fn, NULL))) {
return False;
}
diff --git a/source3/smbd/dnsregister.c b/source3/smbd/dnsregister.c
index 2319097ca5..c092251fee 100644
--- a/source3/smbd/dnsregister.c
+++ b/source3/smbd/dnsregister.c
@@ -85,7 +85,6 @@ static void schedule_dns_register_smbd_retry(struct dns_reg_state *dns_state,
event= event_add_timed(smbd_event_context(),
NULL,
timeval_current_ofs(DNS_REG_RETRY_INTERVAL, 0),
- "DNS registration handler",
dns_register_smbd_retry,
dns_state);
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index e67f926a04..30253d4466 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -173,7 +173,7 @@ static int wcp_file_size_change(files_struct *fsp)
static void update_write_time_handler(struct event_context *ctx,
struct timed_event *te,
- const struct timeval *now,
+ struct timeval now,
void *private_data)
{
files_struct *fsp = (files_struct *)private_data;
@@ -221,7 +221,6 @@ void trigger_write_time_update(struct files_struct *fsp)
fsp->update_write_time_event =
event_add_timed(smbd_event_context(), NULL,
timeval_current_ofs(0, delay),
- "update_write_time_handler",
update_write_time_handler, fsp);
}
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 261d8fd670..6efa3dcfc6 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -346,7 +346,7 @@ static files_struct *initial_break_processing(struct file_id id, unsigned long f
static void oplock_timeout_handler(struct event_context *ctx,
struct timed_event *te,
- const struct timeval *now,
+ struct timeval now,
void *private_data)
{
files_struct *fsp = (files_struct *)private_data;
@@ -373,7 +373,6 @@ static void add_oplock_timeout_handler(files_struct *fsp)
fsp->oplock_timeout =
event_add_timed(smbd_event_context(), NULL,
timeval_current_ofs(OPLOCK_BREAK_TIMEOUT, 0),
- "oplock_timeout_handler",
oplock_timeout_handler, fsp);
if (fsp->oplock_timeout == NULL) {
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 67e6067b26..cd9eaa6b1e 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -583,26 +583,33 @@ struct idle_event {
void *private_data;
};
-static void idle_event_handler(struct event_context *ctx,
- struct timed_event *te,
- const struct timeval *now,
- void *private_data)
+static void smbd_idle_event_handler(struct event_context *ctx,
+ struct timed_event *te,
+ struct timeval now,
+ void *private_data)
{
struct idle_event *event =
talloc_get_type_abort(private_data, struct idle_event);
TALLOC_FREE(event->te);
- if (!event->handler(now, event->private_data)) {
+ DEBUG(10,("smbd_idle_event_handler: %s %p called\n",
+ event->name, event->te));
+
+ if (!event->handler(&now, event->private_data)) {
+ DEBUG(10,("smbd_idle_event_handler: %s %p stopped\n",
+ event->name, event->te));
/* Don't repeat, delete ourselves */
TALLOC_FREE(event);
return;
}
+ DEBUG(10,("smbd_idle_event_handler: %s %p rescheduled\n",
+ event->name, event->te));
+
event->te = event_add_timed(ctx, event,
- timeval_sum(now, &event->interval),
- event->name,
- idle_event_handler, event);
+ timeval_sum(&now, &event->interval),
+ smbd_idle_event_handler, event);
/* We can't do much but fail here. */
SMB_ASSERT(event->te != NULL);
@@ -637,14 +644,14 @@ struct idle_event *event_add_idle(struct event_context *event_ctx,
result->te = event_add_timed(event_ctx, result,
timeval_sum(&now, &interval),
- result->name,
- idle_event_handler, result);
+ smbd_idle_event_handler, result);
if (result->te == NULL) {
DEBUG(0, ("event_add_timed failed\n"));
TALLOC_FREE(result);
return NULL;
}
+ DEBUG(10,("event_add_idle: %s %p\n", result->name, result->te));
return result;
}
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 254180ae1c..a84b58a052 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -753,7 +753,9 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
false);
if (!reinit_after_fork(
- smbd_messaging_context(), true)) {
+ smbd_messaging_context(),
+ smbd_event_context(),
+ true)) {
DEBUG(0,("reinit_after_fork() failed\n"));
smb_panic("reinit_after_fork() failed");
}
@@ -1327,7 +1329,8 @@ extern void build_options(bool screen);
if (is_daemon)
pidfile_create("smbd");
- if (!reinit_after_fork(smbd_messaging_context(), false)) {
+ if (!reinit_after_fork(smbd_messaging_context(),
+ smbd_event_context(), false)) {
DEBUG(0,("reinit_after_fork() failed\n"));
exit(1);
}