From 6d98076c15e8726606da0a99714cd3382d82f9ac Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 3 Apr 2006 06:46:55 +0000 Subject: r14877: added support for the kernel inotify mechanism. This passes basic tests, but still needs some more work to ensure we correctly cope with events that may generate both a system inotify event and a internal notify event. The system inotify events won't handle recursion, and don't understand things like streams. This also adds the ntvfs/sysdep/ directory, which is meant for system dependent code that is not tied to a particular ntvfs backend. The inotify code is a good example of that. (This used to be commit eadadbb44adb3c4081d6ff1d85a9b850a0227059) --- source4/ntvfs/sysdep/sys_notify.h | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 source4/ntvfs/sysdep/sys_notify.h (limited to 'source4/ntvfs/sysdep/sys_notify.h') diff --git a/source4/ntvfs/sysdep/sys_notify.h b/source4/ntvfs/sysdep/sys_notify.h new file mode 100644 index 0000000000..9ad5ed7555 --- /dev/null +++ b/source4/ntvfs/sysdep/sys_notify.h @@ -0,0 +1,52 @@ +/* + Unix SMB/CIFS implementation. + + Copyright (C) Andrew Tridgell 2006 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "librpc/gen_ndr/notify.h" + +struct sys_notify_context; + +typedef void (*sys_notify_callback_t)(struct sys_notify_context *, + void *, struct notify_event *ev); + +struct sys_notify_context { + struct event_context *ev; + void *private; /* for use of backend */ + NTSTATUS (*notify_watch)(struct sys_notify_context *ctx, const char *dirpath, + uint32_t filter, sys_notify_callback_t callback, + void *private, void **handle); + const char *name; +}; + +struct sys_notify_backend { + struct sys_notify_backend *next, *prev; + const char *name; + NTSTATUS (*notify_watch)(struct sys_notify_context *ctx, const char *dirpath, + uint32_t filter, sys_notify_callback_t callback, + void *private, void **handle); +}; + +NTSTATUS sys_notify_register(struct sys_notify_backend *backend); +struct sys_notify_context *sys_notify_init(int snum, + TALLOC_CTX *mem_ctx, + struct event_context *ev); +NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, const char *dirpath, + uint32_t filter, sys_notify_callback_t callback, + void *private, void **handle); + -- cgit From 416d7b421001d00c4d494fceb4f2d0ab3e30cfaf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 5 Apr 2006 05:54:10 +0000 Subject: r14920: allow a notify backend to separately specify if it has handled the given mask for the current directory and sub-directories. This allows us to setup the less efficient internal handling for subdirectories, while using the kernel inotify service for the current directory if available. It also allows inotify to handle only some of the filter bits, leaving the other filter bits for the user space handler. (This used to be commit 7c3d989fa44c7f57853a825337159f476d7dff80) --- source4/ntvfs/sysdep/sys_notify.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'source4/ntvfs/sysdep/sys_notify.h') diff --git a/source4/ntvfs/sysdep/sys_notify.h b/source4/ntvfs/sysdep/sys_notify.h index 9ad5ed7555..9cb01a1db4 100644 --- a/source4/ntvfs/sysdep/sys_notify.h +++ b/source4/ntvfs/sysdep/sys_notify.h @@ -25,28 +25,27 @@ struct sys_notify_context; typedef void (*sys_notify_callback_t)(struct sys_notify_context *, void *, struct notify_event *ev); +typedef NTSTATUS (*notify_watch_t)(struct sys_notify_context *ctx, + struct notify_event *e, + sys_notify_callback_t callback, void *private, + void **handle); + struct sys_notify_context { struct event_context *ev; void *private; /* for use of backend */ - NTSTATUS (*notify_watch)(struct sys_notify_context *ctx, const char *dirpath, - uint32_t filter, sys_notify_callback_t callback, - void *private, void **handle); const char *name; + notify_watch_t notify_watch; }; struct sys_notify_backend { - struct sys_notify_backend *next, *prev; const char *name; - NTSTATUS (*notify_watch)(struct sys_notify_context *ctx, const char *dirpath, - uint32_t filter, sys_notify_callback_t callback, - void *private, void **handle); + notify_watch_t notify_watch; }; NTSTATUS sys_notify_register(struct sys_notify_backend *backend); struct sys_notify_context *sys_notify_init(int snum, TALLOC_CTX *mem_ctx, struct event_context *ev); -NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, const char *dirpath, - uint32_t filter, sys_notify_callback_t callback, - void *private, void **handle); - +NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, struct notify_entry *e, + sys_notify_callback_t callback, void *private, + void **handle); -- cgit From 2e894625e7c951b5ee66670124b4bef82a8129d9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 7 Apr 2006 13:15:46 +0000 Subject: r14964: - move sidmap code from ntvfs_common to SAMDB - make ntvfs_common a library - create sys_notify library metze (This used to be commit a3e1d56cf7b688c515f5d6d4d43e0b24c2261d15) --- source4/ntvfs/sysdep/sys_notify.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source4/ntvfs/sysdep/sys_notify.h') diff --git a/source4/ntvfs/sysdep/sys_notify.h b/source4/ntvfs/sysdep/sys_notify.h index 9cb01a1db4..6f8e91efec 100644 --- a/source4/ntvfs/sysdep/sys_notify.h +++ b/source4/ntvfs/sysdep/sys_notify.h @@ -26,7 +26,7 @@ typedef void (*sys_notify_callback_t)(struct sys_notify_context *, void *, struct notify_event *ev); typedef NTSTATUS (*notify_watch_t)(struct sys_notify_context *ctx, - struct notify_event *e, + struct notify_entry *e, sys_notify_callback_t callback, void *private, void **handle); @@ -43,9 +43,10 @@ struct sys_notify_backend { }; NTSTATUS sys_notify_register(struct sys_notify_backend *backend); -struct sys_notify_context *sys_notify_init(int snum, - TALLOC_CTX *mem_ctx, - struct event_context *ev); +struct sys_notify_context *sys_notify_context_create(int snum, + TALLOC_CTX *mem_ctx, + struct event_context *ev); NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, struct notify_entry *e, sys_notify_callback_t callback, void *private, void **handle); +NTSTATUS sys_notify_init(void); -- cgit From 9c66f601f1520a99b9236c32bc9f03a33bd4b2aa Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 23 Jul 2006 18:43:07 +0000 Subject: r17206: Add a modular API for share configuration. Commit the classic backwards compatible module which is the default one (This used to be commit a89cc346b9296cb49929898d257a064a6c2bae86) --- source4/ntvfs/sysdep/sys_notify.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/sysdep/sys_notify.h') diff --git a/source4/ntvfs/sysdep/sys_notify.h b/source4/ntvfs/sysdep/sys_notify.h index 6f8e91efec..6db10fe02c 100644 --- a/source4/ntvfs/sysdep/sys_notify.h +++ b/source4/ntvfs/sysdep/sys_notify.h @@ -19,6 +19,7 @@ */ #include "librpc/gen_ndr/notify.h" +#include "param/share.h" struct sys_notify_context; @@ -43,7 +44,7 @@ struct sys_notify_backend { }; NTSTATUS sys_notify_register(struct sys_notify_backend *backend); -struct sys_notify_context *sys_notify_context_create(int snum, +struct sys_notify_context *sys_notify_context_create(struct share_config *scfg, TALLOC_CTX *mem_ctx, struct event_context *ev); NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, struct notify_entry *e, -- cgit From 1fbb49a3e7ed78582e283060b6624c57f30d13dd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 28 Jan 2007 17:03:10 +0000 Subject: r21041: Change some "private" to "private_data", and change one (void **) function parameter to (void *). void** in function parameters leads to type-punned warnings. Volker (This used to be commit 57979d89c53b4363e4b447205703579df6756653) --- source4/ntvfs/sysdep/sys_notify.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source4/ntvfs/sysdep/sys_notify.h') diff --git a/source4/ntvfs/sysdep/sys_notify.h b/source4/ntvfs/sysdep/sys_notify.h index 6db10fe02c..a660ee7de5 100644 --- a/source4/ntvfs/sysdep/sys_notify.h +++ b/source4/ntvfs/sysdep/sys_notify.h @@ -28,12 +28,13 @@ typedef void (*sys_notify_callback_t)(struct sys_notify_context *, typedef NTSTATUS (*notify_watch_t)(struct sys_notify_context *ctx, struct notify_entry *e, - sys_notify_callback_t callback, void *private, - void **handle); + sys_notify_callback_t callback, + void *private_data, + void *handle_p); struct sys_notify_context { struct event_context *ev; - void *private; /* for use of backend */ + void *private_data; /* for use of backend */ const char *name; notify_watch_t notify_watch; }; @@ -48,6 +49,6 @@ struct sys_notify_context *sys_notify_context_create(struct share_config *scfg, TALLOC_CTX *mem_ctx, struct event_context *ev); NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, struct notify_entry *e, - sys_notify_callback_t callback, void *private, - void **handle); + sys_notify_callback_t callback, void *private_data, + void *handle); NTSTATUS sys_notify_init(void); -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/ntvfs/sysdep/sys_notify.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/ntvfs/sysdep/sys_notify.h') diff --git a/source4/ntvfs/sysdep/sys_notify.h b/source4/ntvfs/sysdep/sys_notify.h index a660ee7de5..63d4282e7c 100644 --- a/source4/ntvfs/sysdep/sys_notify.h +++ b/source4/ntvfs/sysdep/sys_notify.h @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "librpc/gen_ndr/notify.h" -- cgit