static NTSTATUS vfswrap_notify_watch(vfs_handle_struct *vfs_handle, struct sys_notify_context *ctx, struct notify_entry *e, void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev), void *private_data, void *handle) { /* * So far inotify is the only supported default notify mechanism. If * another platform like the the BSD's or a proprietary Unix comes * along and wants another default, we can play the same trick we * played with Posix ACLs. * * Until that is the case, hard-code inotify here. */ #ifdef HAVE_INOTIFY if (lp_kernel_change_notify(ctx->conn->params)) { return inotify_watch(ctx, e, callback, private_data, handle); } #endif /* * Do nothing, leave everything to notify_internal.c */ return NT_STATUS_OK; }
static struct tevent_req *notifyd_req(struct messaging_context *msg_ctx, struct tevent_context *ev) { struct tevent_req *req; sys_notify_watch_fn sys_notify_watch = NULL; struct sys_notify_context *sys_notify_ctx = NULL; if (lp_kernel_change_notify()) { #ifdef HAVE_INOTIFY if (lp_parm_bool(-1, "notify", "inotify", true)) { sys_notify_watch = inotify_watch; } #endif #ifdef HAVE_FAM if (lp_parm_bool(-1, "notify", "fam", (sys_notify_watch == NULL))) { sys_notify_watch = fam_watch; } #endif } if (sys_notify_watch != NULL) { sys_notify_ctx = sys_notify_context_create(msg_ctx, ev); if (sys_notify_ctx == NULL) { return NULL; } } req = notifyd_send(msg_ctx, ev, msg_ctx, messaging_ctdbd_connection(), sys_notify_watch, sys_notify_ctx); if (req == NULL) { TALLOC_FREE(sys_notify_ctx); return NULL; } tevent_req_set_callback(req, notifyd_stopped, msg_ctx); return req; }