summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/blocking.c4
-rw-r--r--source3/smbd/fileio.c3
-rw-r--r--source3/smbd/oplock.c3
-rw-r--r--source3/smbd/process.c27
4 files changed, 21 insertions, 16 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/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;
}