summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-01-21 11:49:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:21 -0500
commitd5206610cd67f88e2cc7d5b2b434e320e81c29d5 (patch)
tree5b085416bd4403cea107f73a1e874199fd1284b1 /source3/include
parent57881f749495825f61f8affce921eee46fc7b728 (diff)
downloadsamba-d5206610cd67f88e2cc7d5b2b434e320e81c29d5.tar.gz
samba-d5206610cd67f88e2cc7d5b2b434e320e81c29d5.tar.bz2
samba-d5206610cd67f88e2cc7d5b2b434e320e81c29d5.zip
r20931: This changes the notify infrastructure from a polling-based to an event-driven
based approach. The only remaining hook into the backend is now void *(*notify_add)(TALLOC_CTX *mem_ctx, struct event_context *event_ctx, files_struct *fsp, uint32 *filter); (Should we put this through the VFS, so that others can more easily plug in?) The trick here is that the backend can pick filter bits that the main smbd should not handle anymore. Thanks to tridge for this idea. The backend can notify the main smbd process via void notify_fsp(files_struct *fsp, uint32 action, char *name); The core patch is not big, what makes this more than 1800 lines are the individual backends that are considerably changed but can be reviewed one by one. Based on this I'll continue with inotify now. Volker (This used to be commit 9cd6a8a82792b7b6967141565d043b6337836a5d)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/event.h5
-rw-r--r--source3/include/smb.h18
2 files changed, 12 insertions, 11 deletions
diff --git a/source3/include/event.h b/source3/include/event.h
index f3c468c9b8..ce687eca6d 100644
--- a/source3/include/event.h
+++ b/source3/include/event.h
@@ -19,11 +19,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-struct event_context;
-struct timed_event;
-
-struct fd_event;
-
/* bits for file descriptor event flags */
#define EVENT_FD_READ 1
#define EVENT_FD_WRITE 2
diff --git a/source3/include/smb.h b/source3/include/smb.h
index df4f47f12c..21643c64a1 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -421,6 +421,8 @@ struct fd_handle {
unsigned long file_id;
};
+struct event_context;
+struct fd_event;
struct timed_event;
struct idle_event;
struct share_mode_entry;
@@ -451,6 +453,7 @@ struct notify_change_request {
uint32 filter;
uint32 max_param_count;
struct notify_mid_map *mid_map;
+ void *backend_data;
};
struct notify_change_buf {
@@ -458,7 +461,12 @@ struct notify_change_buf {
* If no requests are pending, changes are queued here. Simple array,
* we only append.
*/
- unsigned num_changes;
+
+ /*
+ * num_changes == -1 means that we have got a catch-all change, when
+ * asked we just return NT_STATUS_OK without specific changes.
+ */
+ int num_changes;
struct notify_change *changes;
/*
@@ -1672,11 +1680,9 @@ struct kernel_oplocks {
/* this structure defines the functions for doing change notify in
various implementations */
struct cnotify_fns {
- void * (*register_notify)(connection_struct *conn, char *path, uint32 flags);
- BOOL (*check_notify)(connection_struct *conn, uint16 vuid, char *path, uint32 flags, void *data, time_t t);
- void (*remove_notify)(void *data);
- int select_time;
- int notification_fd;
+ void *(*notify_add)(TALLOC_CTX *mem_ctx,
+ struct event_context *event_ctx,
+ files_struct *fsp, uint32 *filter);
};
#include "smb_macros.h"