}
static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
- struct sys_notify_context *ctx, struct notify_entry *e,
+ struct sys_notify_context *ctx,
+ const char *path,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev),
void *private_data, void *handle_p)
{
static NTSTATUS skel_notify_watch(
struct vfs_handle_struct *handle,
struct sys_notify_context *ctx,
- struct notify_entry *e,
const char *path,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx, void *private_data,
struct notify_event *ev),
void *private_data, void *handle_p)
{
- return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, path, callback,
+ return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, path,
+ filter, subdir_filter, callback,
private_data, handle_p);
}
char *(*realpath_fn)(struct vfs_handle_struct *handle, const char *path);
NTSTATUS (*notify_watch_fn)(struct vfs_handle_struct *handle,
struct sys_notify_context *ctx,
- struct notify_entry *e,
const char *path,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx,
void *private_data,
struct notify_event *ev),
char *smb_vfs_call_realpath(struct vfs_handle_struct *handle, const char *path);
NTSTATUS smb_vfs_call_notify_watch(struct vfs_handle_struct *handle,
struct sys_notify_context *ctx,
- struct notify_entry *e,
const char *name,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx,
void *private_data,
struct notify_event *ev),
#define SMB_VFS_NEXT_REALPATH(handle, path) \
smb_vfs_call_realpath((handle)->next, (path))
-#define SMB_VFS_NOTIFY_WATCH(conn, ctx, e, path, callback, private_data, handle_p) \
- smb_vfs_call_notify_watch((conn)->vfs_handles, (ctx), (e), (path), (callback), (private_data), (handle_p))
-#define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, e, path, callback, private_data, handle_p) \
- smb_vfs_call_notify_watch((conn)->next, (ctx), (e), (path), (callback), (private_data), (handle_p))
+#define SMB_VFS_NOTIFY_WATCH(conn, ctx, path, filter, subdir_filter, callback, private_data, handle_p) \
+ smb_vfs_call_notify_watch((conn)->vfs_handles, (ctx), (path), (filter), (subdir_filter), (callback), (private_data), (handle_p))
+#define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, path, filter, subdir_filter, callback, private_data, handle_p) \
+ smb_vfs_call_notify_watch((conn)->next, (ctx), (path), (filter), (subdir_filter), (callback), (private_data), (handle_p))
#define SMB_VFS_CHFLAGS(conn, path, flags) \
smb_vfs_call_chflags((conn)->vfs_handles, (path), (flags))
static NTSTATUS vfswrap_notify_watch(vfs_handle_struct *vfs_handle,
struct sys_notify_context *ctx,
- struct notify_entry *e,
const char *path,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx,
void *private_data,
struct notify_event *ev),
*/
#ifdef HAVE_INOTIFY
if (lp_kernel_change_notify(vfs_handle->conn->params)) {
- return inotify_watch(ctx, e, path, callback, private_data,
- handle);
+ return inotify_watch(ctx, path, filter, subdir_filter,
+ callback, private_data, handle);
}
#endif
/*
static NTSTATUS smb_full_audit_notify_watch(struct vfs_handle_struct *handle,
struct sys_notify_context *ctx,
- struct notify_entry *e,
const char *path,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx,
void *private_data,
struct notify_event *ev),
{
NTSTATUS result;
- result = SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, path, callback,
+ result = SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, path,
+ filter, subdir_filter, callback,
private_data, handle_p);
do_log(SMB_VFS_OP_NOTIFY_WATCH, NT_STATUS_IS_OK(result), handle, "");
*/
static NTSTATUS fam_watch(vfs_handle_struct *vfs_handle,
struct sys_notify_context *ctx,
- struct notify_entry *e,
const char *path,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx,
void *private_data,
struct notify_event *ev),
struct fam_watch_context *watch;
void **handle = (void **)handle_p;
- if ((e->filter & fam_mask) == 0) {
- DEBUG(10, ("filter = %u, ignoring in FAM\n", e->filter));
+ if ((*filter & fam_mask) == 0) {
+ DEBUG(10, ("filter = %u, ignoring in FAM\n", *filter));
return NT_STATUS_OK;
}
*/
watch->filter = fam_mask;
- e->filter &= ~fam_mask;
+ *filter &= ~fam_mask;
DLIST_ADD(fam_notify_list, watch);
talloc_set_destructor(watch, fam_watch_context_destructor);
static NTSTATUS smb_time_audit_notify_watch(struct vfs_handle_struct *handle,
struct sys_notify_context *ctx,
- struct notify_entry *e,
const char *path,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx,
void *private_data,
struct notify_event *ev),
double timediff;
clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, path, callback,
+ result = SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, path,
+ filter, subdir_filter, callback,
private_data, handle_p);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
status = SMB_VFS_NOTIFY_WATCH(
fsp->conn, fsp->conn->sconn->sys_notify_ctx,
- &e, e.path, sys_notify_callback, fsp,
- &sys_notify_handle);
+ e.path, &e.filter, &e.subdir_filter,
+ sys_notify_callback, fsp, &sys_notify_handle);
if (NT_STATUS_IS_OK(status)) {
talloc_steal(fsp->notify, sys_notify_handle);
talloc_free() on *handle
*/
NTSTATUS inotify_watch(struct sys_notify_context *ctx,
- struct notify_entry *e,
const char *path,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx,
void *private_data,
struct notify_event *ev),
int wd;
uint32_t mask;
struct inotify_watch_context *w;
- uint32_t orig_filter = e->filter;
+ uint32_t orig_filter = *filter;
void **handle = (void **)handle_p;
/* maybe setup the inotify fd */
in = talloc_get_type(ctx->private_data, struct inotify_private);
- mask = inotify_map(&e->filter);
+ mask = inotify_map(filter);
if (mask == 0) {
/* this filter can't be handled by inotify */
return NT_STATUS_INVALID_PARAMETER;
/* get a new watch descriptor for this path */
wd = inotify_add_watch(in->fd, path, mask);
if (wd == -1) {
- e->filter = orig_filter;
+ *filter = orig_filter;
DEBUG(1, ("inotify_add_watch returned %s\n", strerror(errno)));
return map_nt_error_from_unix(errno);
}
DEBUG(10, ("inotify_add_watch for %s mask %x returned wd %d\n",
- e->path, mask, wd));
+ path, mask, wd));
w = talloc(in, struct inotify_watch_context);
if (w == NULL) {
inotify_rm_watch(in->fd, wd);
- e->filter = orig_filter;
+ *filter = orig_filter;
return NT_STATUS_NO_MEMORY;
}
w->path = talloc_strdup(w, path);
if (w->path == NULL) {
inotify_rm_watch(in->fd, wd);
- e->filter = orig_filter;
+ *filter = orig_filter;
return NT_STATUS_NO_MEMORY;
}
/* The following definitions come from smbd/notify_inotify.c */
NTSTATUS inotify_watch(struct sys_notify_context *ctx,
- struct notify_entry *e,
const char *path,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx,
void *private_data,
struct notify_event *ev),
NTSTATUS smb_vfs_call_notify_watch(struct vfs_handle_struct *handle,
struct sys_notify_context *ctx,
- struct notify_entry *e,
const char *path,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx,
void *private_data,
struct notify_event *ev),
void *private_data, void *handle_p)
{
VFS_FIND(notify_watch);
- return handle->fns->notify_watch_fn(handle, ctx, e, path, callback,
+ return handle->fns->notify_watch_fn(handle, ctx, path,
+ filter, subdir_filter, callback,
private_data, handle_p);
}