s4: ntvfs: Add a TALLOC_CTX * to sys_notify_register().
authorJeremy Allison <jra@samba.org>
Thu, 11 May 2017 22:50:08 +0000 (15:50 -0700)
committerRalph Boehme <slow@samba.org>
Sat, 13 May 2017 14:50:13 +0000 (16:50 +0200)
Pass in the TALLOC_CTX * from the module init to remove
another talloc_autofree_context() use.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/ntvfs/sysdep/inotify.c
source4/ntvfs/sysdep/sys_notify.c
source4/ntvfs/sysdep/sys_notify.h

index c769618cf42e8320902fedc741a94f50ea116765..ba4b336c44e0d93409922129fdc97171d33086f8 100644 (file)
@@ -394,5 +394,5 @@ NTSTATUS sys_notify_inotify_init(TALLOC_CTX *);
 NTSTATUS sys_notify_inotify_init(TALLOC_CTX *ctx)
 {
        /* register ourselves as a system inotify module */
-       return sys_notify_register(&inotify);
+       return sys_notify_register(ctx, &inotify);
 }
index aad3b900dd17c9014798f1e98d42d498670f7882..7e00032959a11e8dd06c9d5963d3aaf03d1c51b9 100644 (file)
@@ -120,10 +120,11 @@ _PUBLIC_ NTSTATUS sys_notify_watch(struct sys_notify_context *ctx,
 /*
   register a notify backend
 */
-_PUBLIC_ NTSTATUS sys_notify_register(struct sys_notify_backend *backend)
+_PUBLIC_ NTSTATUS sys_notify_register(TALLOC_CTX *ctx,
+                       struct sys_notify_backend *backend)
 {
        struct sys_notify_backend *b;
-       b = talloc_realloc(talloc_autofree_context(), backends, 
+       b = talloc_realloc(ctx, backends,
                           struct sys_notify_backend, num_backends+1);
        NT_STATUS_HAVE_NO_MEMORY(b);
        backends = b;
index d912a9bdaf63c6aab370044e469020a693576769..9e10f1446bf583bb7ff0721ed311eba56f833b27 100644 (file)
@@ -43,7 +43,8 @@ struct sys_notify_backend {
        notify_watch_t notify_watch;
 };
 
-NTSTATUS sys_notify_register(struct sys_notify_backend *backend);
+NTSTATUS sys_notify_register(TALLOC_CTX *ctx,
+                       struct sys_notify_backend *backend);
 struct sys_notify_context *sys_notify_context_create(struct share_config *scfg,
                                                     TALLOC_CTX *mem_ctx, 
                                                     struct tevent_context *ev);