summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-04-04 15:11:51 +0000
committerJeremy Allison <jra@samba.org>2014-04-23 22:33:08 +0200
commitda1778f4458d6be61b1a1b74c18367e98d6065e0 (patch)
tree696f5d4cd7c5ba953f644e41798d54300b7262de
parent892bec88a3c4842d1b8d43dd9984eada99eab810 (diff)
downloadsamba-da1778f4458d6be61b1a1b74c18367e98d6065e0.tar.gz
samba-da1778f4458d6be61b1a1b74c18367e98d6065e0.tar.xz
samba-da1778f4458d6be61b1a1b74c18367e98d6065e0.zip
smbd: Pass timespec_current through the notify_callback
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/smbd/notify.c5
-rw-r--r--source3/smbd/notify_internal.c8
-rw-r--r--source3/smbd/proto.h3
3 files changed, 10 insertions, 6 deletions
diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c
index 693418a4cc6..b8085dd6c42 100644
--- a/source3/smbd/notify.c
+++ b/source3/smbd/notify.c
@@ -211,11 +211,12 @@ void change_notify_reply(struct smb_request *req,
notify_buf->num_changes = 0;
}
-static void notify_callback(void *private_data, const struct notify_event *e)
+static void notify_callback(void *private_data, struct timespec when,
+ const struct notify_event *e)
{
files_struct *fsp = (files_struct *)private_data;
DEBUG(10, ("notify_callback called for %s\n", fsp_str_dbg(fsp)));
- notify_fsp(fsp, timespec_current(), e->action, e->path);
+ notify_fsp(fsp, when, e->action, e->path);
}
static void sys_notify_callback(struct sys_notify_context *ctx,
diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c
index 4d885651bae..69f937774f7 100644
--- a/source3/smbd/notify_internal.c
+++ b/source3/smbd/notify_internal.c
@@ -44,7 +44,7 @@
struct notify_list {
struct notify_list *next, *prev;
const char *path;
- void (*callback)(void *, const struct notify_event *);
+ void (*callback)(void *, struct timespec, const struct notify_event *);
void *private_data;
};
@@ -194,7 +194,8 @@ static int notify_context_destructor(struct notify_context *notify)
NTSTATUS notify_add(struct notify_context *notify,
const char *path, uint32_t filter, uint32_t subdir_filter,
- void (*callback)(void *, const struct notify_event *),
+ void (*callback)(void *, struct timespec,
+ const struct notify_event *),
void *private_data)
{
struct notify_db_entry e;
@@ -820,7 +821,8 @@ static void notify_handler(struct messaging_context *msg_ctx,
for (listel=notify->list;listel;listel=listel->next) {
if (listel->private_data == n->private_data) {
- listel->callback(listel->private_data, n);
+ listel->callback(listel->private_data,
+ timespec_current(), n);
break;
}
}
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index d9b86b6f539..bc15f159ab5 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -552,7 +552,8 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx,
struct tevent_context *ev);
NTSTATUS notify_add(struct notify_context *notify,
const char *path, uint32_t filter, uint32_t subdir_filter,
- void (*callback)(void *, const struct notify_event *),
+ void (*callback)(void *, struct timespec,
+ const struct notify_event *),
void *private_data);
NTSTATUS notify_remove(struct notify_context *notify, void *private_data);
void notify_trigger(struct notify_context *notify,