svn commit: samba r21041 - in branches/SAMBA_4_0/source/ntvfs/sysdep: .

vlendec at samba.org vlendec at samba.org
Sun Jan 28 17:03:10 GMT 2007


Author: vlendec
Date: 2007-01-28 17:03:10 +0000 (Sun, 28 Jan 2007)
New Revision: 21041

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21041

Log:
Change some "private" to "private_data", and change one (void **) function
parameter to (void *). void** in function parameters leads to type-punned
warnings.

Volker


Modified:
   branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c
   branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.c
   branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.h


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c	2007-01-28 13:14:52 UTC (rev 21040)
+++ branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c	2007-01-28 17:03:10 UTC (rev 21041)
@@ -72,7 +72,7 @@
 	struct inotify_private *in;
 	int wd;
 	sys_notify_callback_t callback;
-	void *private;
+	void *private_data;
 	uint32_t mask; /* the inotify mask */
 	uint32_t filter; /* the windows completion filter */
 	const char *path;
@@ -175,7 +175,7 @@
 	for (w=in->watches;w;w=next) {
 		next = w->next;
 		if (w->wd == e->wd && filter_match(w, e)) {
-			w->callback(in->ctx, w->private, &ne);
+			w->callback(in->ctx, w->private_data, &ne);
 		}
 	}
 
@@ -194,7 +194,7 @@
 		next = w->next;
 		if (w->wd == e->wd && filter_match(w, e) &&
 		    !(w->filter & FILE_NOTIFY_CHANGE_CREATION)) {
-			w->callback(in->ctx, w->private, &ne);
+			w->callback(in->ctx, w->private_data, &ne);
 		}
 	}
 }
@@ -203,9 +203,10 @@
   called when the kernel has some events for us
 */
 static void inotify_handler(struct event_context *ev, struct fd_event *fde,
-			    uint16_t flags, void *private)
+			    uint16_t flags, void *private_data)
 {
-	struct inotify_private *in = talloc_get_type(private, struct inotify_private);
+	struct inotify_private *in = talloc_get_type(private_data,
+						     struct inotify_private);
 	int bufsize = 0;
 	struct inotify_event *e0, *e;
 	uint32_t prev_cookie=0;
@@ -268,7 +269,7 @@
 	in->ctx = ctx;
 	in->watches = NULL;
 
-	ctx->private = in;
+	ctx->private_data = in;
 	talloc_set_destructor(in, inotify_destructor);
 
 	/* add a event waiting for the inotify fd to be readable */
@@ -332,24 +333,27 @@
   add a watch. The watch is removed when the caller calls
   talloc_free() on *handle
 */
-static NTSTATUS inotify_watch(struct sys_notify_context *ctx, struct notify_entry *e,
-			      sys_notify_callback_t callback, void *private, 
-			      void **handle)
+static NTSTATUS inotify_watch(struct sys_notify_context *ctx,
+			      struct notify_entry *e,
+			      sys_notify_callback_t callback,
+			      void *private_data, 
+			      void *handle_p)
 {
 	struct inotify_private *in;
 	int wd;
 	uint32_t mask;
 	struct watch_context *w;
 	uint32_t filter = e->filter;
+	void **handle = (void **)handle_p;
 
 	/* maybe setup the inotify fd */
-	if (ctx->private == NULL) {
+	if (ctx->private_data == NULL) {
 		NTSTATUS status;
 		status = inotify_setup(ctx);
 		NT_STATUS_NOT_OK_RETURN(status);
 	}
 
-	in = talloc_get_type(ctx->private, struct inotify_private);
+	in = talloc_get_type(ctx->private_data, struct inotify_private);
 
 	mask = inotify_map(e);
 	if (mask == 0) {
@@ -378,7 +382,7 @@
 	w->in = in;
 	w->wd = wd;
 	w->callback = callback;
-	w->private = private;
+	w->private_data = private_data;
 	w->mask = mask;
 	w->filter = filter;
 	w->path = talloc_strdup(w, e->path);

Modified: branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.c	2007-01-28 13:14:52 UTC (rev 21040)
+++ branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.c	2007-01-28 17:03:10 UTC (rev 21041)
@@ -95,13 +95,15 @@
   bits to remove ones handled by this backend. Any remaining bits will
   be handled by the generic notify layer
 */
-_PUBLIC_ NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, struct notify_entry *e,
-				   sys_notify_callback_t callback, void *private, void **handle)
+_PUBLIC_ NTSTATUS sys_notify_watch(struct sys_notify_context *ctx,
+				   struct notify_entry *e,
+				   sys_notify_callback_t callback,
+				   void *private_data, void *handle)
 {
 	if (!ctx->notify_watch) {
 		return NT_STATUS_INVALID_SYSTEM_SERVICE;
 	}
-	return ctx->notify_watch(ctx, e, callback, private, handle);
+	return ctx->notify_watch(ctx, e, callback, private_data, handle);
 }
 
 /*

Modified: branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.h
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.h	2007-01-28 13:14:52 UTC (rev 21040)
+++ branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.h	2007-01-28 17:03:10 UTC (rev 21041)
@@ -28,12 +28,13 @@
 
 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 @@
 						     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);



More information about the samba-cvs mailing list