1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

smbd: Remove SMB_VFS_NOTIFY_WATCH

No longer needed

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2014-12-12 15:37:30 +01:00 committed by Jeremy Allison
parent c118c301c9
commit 70283ffd38
10 changed files with 1 additions and 200 deletions

View 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,

View 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,

View File

@ -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,

View File

@ -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) \

View 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,

View 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,

View 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,

View 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,

View 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,

View 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)
{