smbd: Pass timespec_current through the notify_callback
authorVolker Lendecke <vl@samba.org>
Fri, 4 Apr 2014 15:11:51 +0000 (15:11 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 23 Apr 2014 20:33:08 +0000 (22:33 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/notify.c
source3/smbd/notify_internal.c
source3/smbd/proto.h

index 693418a4cc6fe9288f36b87fb788e94f8a6ea2f5..b8085dd6c429ce93e4d49968b854a224bfedd746 100644 (file)
@@ -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,
index 4d885651bae89aa189e57b0c4a5c69468125c0dc..69f937774f77c14b27c99e6bfa2e45d5aeb64db3 100644 (file)
@@ -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;
                }
        }
index d9b86b6f539dd9707282428356ab8b59e81575b7..bc15f159ab570f5b46ea64dfb70029185c0c46b2 100644 (file)
@@ -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,