From 70283ffd38bdaccbf05f66953aec6cfd83611aa5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 12 Dec 2014 15:37:30 +0100 Subject: [PATCH] smbd: Remove SMB_VFS_NOTIFY_WATCH No longer needed Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- examples/VFS/skel_opaque.c | 14 ---------- examples/VFS/skel_transparent.c | 16 ----------- source3/include/vfs.h | 20 +------------- source3/include/vfs_macros.h | 5 ---- source3/modules/vfs_ceph.c | 18 ------------- source3/modules/vfs_default.c | 46 -------------------------------- source3/modules/vfs_full_audit.c | 24 ----------------- source3/modules/vfs_glusterfs.c | 13 --------- source3/modules/vfs_time_audit.c | 29 -------------------- source3/smbd/vfs.c | 16 ----------- 10 files changed, 1 insertion(+), 200 deletions(-) diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 296a85501d5..70219981d04 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -490,19 +490,6 @@ static char *skel_realpath(vfs_handle_struct *handle, const char *path) return NULL; } -static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle, - 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) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags) { @@ -918,7 +905,6 @@ struct vfs_fn_pointers skel_opaque_fns = { .link_fn = skel_link, .mknod_fn = skel_mknod, .realpath_fn = skel_realpath, - .notify_watch_fn = skel_notify_watch, .chflags_fn = skel_chflags, .file_id_create_fn = skel_file_id_create, .copy_chunk_send_fn = skel_copy_chunk_send, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 10f5ac5570f..6c6adeac811 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -579,21 +579,6 @@ static char *skel_realpath(vfs_handle_struct *handle, const char *path) return SMB_VFS_NEXT_REALPATH(handle, path); } -static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle, - 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) -{ - return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, path, - filter, subdir_filter, callback, - private_data, handle_p); -} - static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags) { @@ -1029,7 +1014,6 @@ struct vfs_fn_pointers skel_transparent_fns = { .link_fn = skel_link, .mknod_fn = skel_mknod, .realpath_fn = skel_realpath, - .notify_watch_fn = skel_notify_watch, .chflags_fn = skel_chflags, .file_id_create_fn = skel_file_id_create, .copy_chunk_send_fn = skel_copy_chunk_send, diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 081030c14ee..99453759242 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -166,6 +166,7 @@ /* Version 33 - change fallocate mode flags param from enum->uint32_t */ /* Version 33 - Add snapshot create/delete calls */ /* Version 33 - Add OS X SMB2 AAPL copyfile extension flag to fsp */ +/* Version 33 - Remove notify_watch_fn */ #define SMB_VFS_INTERFACE_VERSION 33 @@ -626,16 +627,6 @@ struct vfs_fn_pointers { int (*link_fn)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); int (*mknod_fn)(struct vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev); 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, - 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); int (*chflags_fn)(struct vfs_handle_struct *handle, const char *path, unsigned int flags); struct file_id (*file_id_create_fn)(struct vfs_handle_struct *handle, const SMB_STRUCT_STAT *sbuf); @@ -1093,15 +1084,6 @@ int smb_vfs_call_link(struct vfs_handle_struct *handle, const char *oldpath, int smb_vfs_call_mknod(struct vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev); 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, - const char *name, - 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); int smb_vfs_call_chflags(struct vfs_handle_struct *handle, const char *path, unsigned int flags); struct file_id smb_vfs_call_file_id_create(struct vfs_handle_struct *handle, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 9a686c9ad22..eaf0c19371d 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -336,11 +336,6 @@ #define SMB_VFS_NEXT_REALPATH(handle, path) \ smb_vfs_call_realpath((handle)->next, (path)) -#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)) #define SMB_VFS_NEXT_CHFLAGS(handle, path, flags) \ diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index ff642feda8a..0113faa1247 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -1011,23 +1011,6 @@ static char *cephwrap_realpath(struct vfs_handle_struct *handle, const char *pa return result; } -static NTSTATUS cephwrap_notify_watch(struct vfs_handle_struct *vfs_handle, - 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) -{ - /* - * We cannot call inotify on files the kernel does not know about - */ - return NT_STATUS_OK; -} - static int cephwrap_chflags(struct vfs_handle_struct *handle, const char *path, unsigned int flags) { @@ -1303,7 +1286,6 @@ static struct vfs_fn_pointers ceph_fns = { .link_fn = cephwrap_link, .mknod_fn = cephwrap_mknod, .realpath_fn = cephwrap_realpath, - .notify_watch_fn = cephwrap_notify_watch, .chflags_fn = cephwrap_chflags, .get_real_filename_fn = cephwrap_get_real_filename, .connectpath_fn = cephwrap_connectpath, diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index fcf3de5f7bb..9a0a46ecb55 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -2132,51 +2132,6 @@ static char *vfswrap_realpath(vfs_handle_struct *handle, const char *path) return result; } -static NTSTATUS vfswrap_notify_watch(vfs_handle_struct *vfs_handle, - 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) -{ - /* - * 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()) { - int ret; - if (!lp_parm_bool(-1, "notify", "inotify", True)) { - return NT_STATUS_INVALID_SYSTEM_SERVICE; - } - /* - * "ctx->private_data" is not obvious as a talloc context - * here. Without modifying the VFS we don't have a mem_ctx - * available here, and ctx->private_data was used by - * inotify_watch before it got a real talloc parent. - */ - ret = inotify_watch(ctx->private_data, ctx, - path, filter, subdir_filter, - callback, private_data, handle); - if (ret != 0) { - return map_nt_error_from_unix(ret); - } - return NT_STATUS_OK; - } -#endif - /* - * Do nothing, leave everything to notify_internal.c - */ - return NT_STATUS_OK; -} - static int vfswrap_chflags(vfs_handle_struct *handle, const char *path, unsigned int flags) { @@ -2643,7 +2598,6 @@ static struct vfs_fn_pointers vfs_default_fns = { .link_fn = vfswrap_link, .mknod_fn = vfswrap_mknod, .realpath_fn = vfswrap_realpath, - .notify_watch_fn = vfswrap_notify_watch, .chflags_fn = vfswrap_chflags, .file_id_create_fn = vfswrap_file_id_create, .streaminfo_fn = vfswrap_streaminfo, diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index c6648d15fb3..6de22b1d781 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -158,7 +158,6 @@ typedef enum _vfs_op_type { SMB_VFS_OP_LINK, SMB_VFS_OP_MKNOD, SMB_VFS_OP_REALPATH, - SMB_VFS_OP_NOTIFY_WATCH, SMB_VFS_OP_CHFLAGS, SMB_VFS_OP_FILE_ID_CREATE, SMB_VFS_OP_STREAMINFO, @@ -286,7 +285,6 @@ static struct { { SMB_VFS_OP_LINK, "link" }, { SMB_VFS_OP_MKNOD, "mknod" }, { SMB_VFS_OP_REALPATH, "realpath" }, - { SMB_VFS_OP_NOTIFY_WATCH, "notify_watch" }, { SMB_VFS_OP_CHFLAGS, "chflags" }, { SMB_VFS_OP_FILE_ID_CREATE, "file_id_create" }, { SMB_VFS_OP_STREAMINFO, "streaminfo" }, @@ -1630,27 +1628,6 @@ static char *smb_full_audit_realpath(vfs_handle_struct *handle, return result; } -static NTSTATUS smb_full_audit_notify_watch(struct vfs_handle_struct *handle, - 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) -{ - NTSTATUS result; - - 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, ""); - - return result; -} - static int smb_full_audit_chflags(vfs_handle_struct *handle, const char *path, unsigned int flags) { @@ -2305,7 +2282,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .link_fn = smb_full_audit_link, .mknod_fn = smb_full_audit_mknod, .realpath_fn = smb_full_audit_realpath, - .notify_watch_fn = smb_full_audit_notify_watch, .chflags_fn = smb_full_audit_chflags, .file_id_create_fn = smb_full_audit_file_id_create, .streaminfo_fn = smb_full_audit_streaminfo, diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index cd58080600c..a66887dbae3 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -1039,18 +1039,6 @@ static int vfs_gluster_mknod(struct vfs_handle_struct *handle, const char *path, return glfs_mknod(handle->data, path, mode, dev); } -static NTSTATUS vfs_gluster_notify_watch(struct vfs_handle_struct *handle, - 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) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - static int vfs_gluster_chflags(struct vfs_handle_struct *handle, const char *path, unsigned int flags) { @@ -1760,7 +1748,6 @@ static struct vfs_fn_pointers glusterfs_fns = { .link_fn = vfs_gluster_link, .mknod_fn = vfs_gluster_mknod, .realpath_fn = vfs_gluster_realpath, - .notify_watch_fn = vfs_gluster_notify_watch, .chflags_fn = vfs_gluster_chflags, .file_id_create_fn = NULL, .copy_chunk_send_fn = NULL, diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 5c43d7ca7a3..7efad1efa5d 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -1483,34 +1483,6 @@ static char *smb_time_audit_realpath(vfs_handle_struct *handle, return result; } -static NTSTATUS smb_time_audit_notify_watch(struct vfs_handle_struct *handle, - 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) -{ - NTSTATUS result; - struct timespec ts1,ts2; - double timediff; - - clock_gettime_mono(&ts1); - 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; - - if (timediff > audit_timeout) { - smb_time_audit_log_fname("notify_watch", timediff, path); - } - - return result; -} - static int smb_time_audit_chflags(vfs_handle_struct *handle, const char *path, unsigned int flags) { @@ -2507,7 +2479,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = { .link_fn = smb_time_audit_link, .mknod_fn = smb_time_audit_mknod, .realpath_fn = smb_time_audit_realpath, - .notify_watch_fn = smb_time_audit_notify_watch, .chflags_fn = smb_time_audit_chflags, .file_id_create_fn = smb_time_audit_file_id_create, .streaminfo_fn = smb_time_audit_streaminfo, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index b2673879f5a..7f60b06d03a 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2053,22 +2053,6 @@ char *smb_vfs_call_realpath(struct vfs_handle_struct *handle, const char *path) return handle->fns->realpath_fn(handle, path); } -NTSTATUS smb_vfs_call_notify_watch(struct vfs_handle_struct *handle, - 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) -{ - VFS_FIND(notify_watch); - return handle->fns->notify_watch_fn(handle, ctx, path, - filter, subdir_filter, callback, - private_data, handle_p); -} - int smb_vfs_call_chflags(struct vfs_handle_struct *handle, const char *path, unsigned int flags) { -- 2.34.1