summaryrefslogtreecommitdiffstats
path: root/source4/ntvfs/sysdep
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-01-28 17:03:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:44:24 -0500
commit1fbb49a3e7ed78582e283060b6624c57f30d13dd (patch)
tree97daec6c1b1ae050fa364ed8230b3cf3ed4419bc /source4/ntvfs/sysdep
parentd3400402d57eaaf56c8436aafd92d9768eee31e7 (diff)
downloadsamba-1fbb49a3e7ed78582e283060b6624c57f30d13dd.tar.gz
samba-1fbb49a3e7ed78582e283060b6624c57f30d13dd.tar.xz
samba-1fbb49a3e7ed78582e283060b6624c57f30d13dd.zip
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)
Diffstat (limited to 'source4/ntvfs/sysdep')
-rw-r--r--source4/ntvfs/sysdep/inotify.c28
-rw-r--r--source4/ntvfs/sysdep/sys_notify.c8
-rw-r--r--source4/ntvfs/sysdep/sys_notify.h11
3 files changed, 27 insertions, 20 deletions
diff --git a/source4/ntvfs/sysdep/inotify.c b/source4/ntvfs/sysdep/inotify.c
index a5104a01d02..8bb0096dccd 100644
--- a/source4/ntvfs/sysdep/inotify.c
+++ b/source4/ntvfs/sysdep/inotify.c
@@ -72,7 +72,7 @@ struct watch_context {
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 @@ static void inotify_dispatch(struct inotify_private *in,
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 @@ static void inotify_dispatch(struct inotify_private *in,
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 @@ static void inotify_dispatch(struct inotify_private *in,
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 @@ static NTSTATUS inotify_setup(struct sys_notify_context *ctx)
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 @@ static int watch_destructor(struct watch_context *w)
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 @@ static NTSTATUS inotify_watch(struct sys_notify_context *ctx, struct notify_entr
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);
diff --git a/source4/ntvfs/sysdep/sys_notify.c b/source4/ntvfs/sysdep/sys_notify.c
index 765b4a39a5c..1c0467236a1 100644
--- a/source4/ntvfs/sysdep/sys_notify.c
+++ b/source4/ntvfs/sysdep/sys_notify.c
@@ -95,13 +95,15 @@ _PUBLIC_ struct sys_notify_context *sys_notify_context_create(struct share_confi
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);
}
/*
diff --git a/source4/ntvfs/sysdep/sys_notify.h b/source4/ntvfs/sysdep/sys_notify.h
index 6db10fe02c5..a660ee7de53 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);