smbd: Remove SMB_VFS_NOTIFY_WATCH
authorVolker Lendecke <vl@samba.org>
Fri, 12 Dec 2014 14:37:30 +0000 (15:37 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 7 Jul 2015 21:51:24 +0000 (23:51 +0200)
No longer needed

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_ceph.c
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_glusterfs.c
source3/modules/vfs_time_audit.c
source3/smbd/vfs.c

index 296a85501d518073a5697bf255a94f94330a16a0..70219981d04706bf8999e9b21efda5504cea0cd2 100644 (file)
@@ -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,
index 10f5ac5570f4b033bfd053422c091372a9163313..6c6adeac8111fbf1a41dd2671314651c5431229d 100644 (file)
@@ -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,
index 081030c14ee71444b2534ef5b4b19c4396fd2ce8..9945375924262d57fc747fede1be1d6fea082e63 100644 (file)
 /* 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,
index 9a686c9ad225ab113bd9bda433a17712ea19bc88..eaf0c19371d07fb67f8a55b834ac6adaec8aae9c 100644 (file)
 #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) \
index ff642feda8aa7c5bfcdc08dca394aeeba099aab7..0113faa1247cae74773901a6a4425f01fb224c41 100644 (file)
@@ -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,
index fcf3de5f7bbe3ee8865ceca081ad15d8eac4e903..9a0a46ecb555cb72367c635b0b06e015fb475e96 100644 (file)
@@ -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,
index c6648d15fb3722c7720d551103262ae19d838471..6de22b1d781085f42a53c05b88677246733c8b16 100644 (file)
@@ -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,
index cd58080600c8d8d697ab9e509e3fdd2564c0ab5c..a66887dbae3d68d5144253e9ea8b0861e26185e1 100644 (file)
@@ -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,
index 5c43d7ca7a3e150bd08074151b69fb62945bd79c..7efad1efa5d26327c740f481db6d58d0a2374a20 100644 (file)
@@ -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,
index b2673879f5a4aa64f8b2607df45f064e2815d794..7f60b06d03a5339edf20d4648386247399e333d0 100644 (file)
@@ -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)
 {