From 033185e2a1b2892fe8dc74a18a38e5e13e08cb22 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 23 Jul 2009 20:28:58 -0400 Subject: Make the smbd VFS typesafe --- source3/modules/vfs_acl_tdb.c | 37 +-- source3/modules/vfs_acl_xattr.c | 28 +-- source3/modules/vfs_afsacl.c | 19 +- source3/modules/vfs_aio_fork.c | 23 +- source3/modules/vfs_aixacl.c | 35 +-- source3/modules/vfs_aixacl2.c | 53 +---- source3/modules/vfs_audit.c | 45 ++-- source3/modules/vfs_cacheprime.c | 20 +- source3/modules/vfs_cap.c | 98 +++----- source3/modules/vfs_catia.c | 48 +--- source3/modules/vfs_commit.c | 26 +- source3/modules/vfs_default.c | 365 ++++++++++------------------- source3/modules/vfs_default_quota.c | 13 +- source3/modules/vfs_dirsort.c | 27 +-- source3/modules/vfs_expand_msdfs.c | 10 +- source3/modules/vfs_extd_audit.c | 45 ++-- source3/modules/vfs_fake_perms.c | 13 +- source3/modules/vfs_fileid.c | 34 +-- source3/modules/vfs_full_audit.c | 356 +++++++++------------------- source3/modules/vfs_gpfs.c | 105 ++------- source3/modules/vfs_hpuxacl.c | 33 +-- source3/modules/vfs_irixacl.c | 33 +-- source3/modules/vfs_netatalk.c | 29 +-- source3/modules/vfs_notify_fam.c | 14 +- source3/modules/vfs_onefs.c | 110 +++------ source3/modules/vfs_onefs_shadow_copy.c | 149 ++++-------- source3/modules/vfs_posixacl.c | 33 +-- source3/modules/vfs_prealloc.c | 11 +- source3/modules/vfs_preopen.c | 11 +- source3/modules/vfs_readahead.c | 19 +- source3/modules/vfs_readonly.c | 11 +- source3/modules/vfs_recycle.c | 21 +- source3/modules/vfs_shadow_copy.c | 28 +-- source3/modules/vfs_shadow_copy2.c | 87 +++---- source3/modules/vfs_smb_traffic_analyzer.c | 26 +- source3/modules/vfs_solarisacl.c | 35 +-- source3/modules/vfs_streams_depot.c | 28 +-- source3/modules/vfs_streams_xattr.c | 40 +--- source3/modules/vfs_syncops.c | 30 +-- source3/modules/vfs_tru64acl.c | 33 +-- source3/modules/vfs_tsmsm.c | 39 +-- source3/modules/vfs_xattr_tdb.c | 40 +--- source3/modules/vfs_zfsacl.c | 37 +-- 43 files changed, 710 insertions(+), 1587 deletions(-) (limited to 'source3/modules') diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c index ce84bd0e3a..5d1bb8728c 100644 --- a/source3/modules/vfs_acl_tdb.c +++ b/source3/modules/vfs_acl_tdb.c @@ -937,32 +937,21 @@ static int sys_acl_set_fd_tdb(vfs_handle_struct *handle, return 0; } -/* VFS operations structure */ - -static vfs_op_tuple skel_op_tuples[] = -{ - {SMB_VFS_OP(connect_acl_tdb), SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(mkdir_acl_tdb), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(rmdir_acl_tdb), SMB_VFS_OP_RMDIR, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(open_acl_tdb), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(unlink_acl_tdb), SMB_VFS_OP_UNLINK, SMB_VFS_LAYER_TRANSPARENT}, - - /* NT File ACL operations */ - - {SMB_VFS_OP(fget_nt_acl_tdb),SMB_VFS_OP_FGET_NT_ACL,SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(get_nt_acl_tdb), SMB_VFS_OP_GET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(fset_nt_acl_tdb),SMB_VFS_OP_FSET_NT_ACL,SMB_VFS_LAYER_TRANSPARENT}, - - /* POSIX ACL operations. */ - {SMB_VFS_OP(sys_acl_set_file_tdb), SMB_VFS_OP_SYS_ACL_SET_FILE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(sys_acl_set_fd_tdb), SMB_VFS_OP_SYS_ACL_SET_FD, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_acl_tdb_fns = { + .connect_fn = connect_acl_tdb, + .mkdir = mkdir_acl_tdb, + .open = open_acl_tdb, + .unlink = unlink_acl_tdb, + .rmdir = rmdir_acl_tdb, + .fget_nt_acl = fget_nt_acl_tdb, + .get_nt_acl = get_nt_acl_tdb, + .fset_nt_acl = fset_nt_acl_tdb, + .sys_acl_set_file = sys_acl_set_file_tdb, + .sys_acl_set_fd = sys_acl_set_fd_tdb }; NTSTATUS vfs_acl_tdb_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "acl_tdb", skel_op_tuples); + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "acl_tdb", + &vfs_acl_tdb_fns); } diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c index b18bc658ff..3646b659dc 100644 --- a/source3/modules/vfs_acl_xattr.c +++ b/source3/modules/vfs_acl_xattr.c @@ -793,27 +793,19 @@ static int sys_acl_set_fd_xattr(vfs_handle_struct *handle, return ret; } -/* VFS operations structure */ -static vfs_op_tuple skel_op_tuples[] = -{ - {SMB_VFS_OP(mkdir_acl_xattr), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(open_acl_xattr), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_TRANSPARENT}, - - /* NT File ACL operations */ - - {SMB_VFS_OP(fget_nt_acl_xattr),SMB_VFS_OP_FGET_NT_ACL,SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(get_nt_acl_xattr), SMB_VFS_OP_GET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(fset_nt_acl_xattr),SMB_VFS_OP_FSET_NT_ACL,SMB_VFS_LAYER_TRANSPARENT}, - - /* POSIX ACL operations. */ - {SMB_VFS_OP(sys_acl_set_file_xattr), SMB_VFS_OP_SYS_ACL_SET_FILE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(sys_acl_set_fd_xattr), SMB_VFS_OP_SYS_ACL_SET_FD, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_acl_xattr_fns = { + .mkdir = mkdir_acl_xattr, + .open = open_acl_xattr, + .fget_nt_acl = fget_nt_acl_xattr, + .get_nt_acl = get_nt_acl_xattr, + .fset_nt_acl = fset_nt_acl_xattr, + .sys_acl_set_file = sys_acl_set_file_xattr, + .sys_acl_set_fd = sys_acl_set_fd_xattr }; NTSTATUS vfs_acl_xattr_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "acl_xattr", skel_op_tuples); + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "acl_xattr", + &vfs_acl_xattr_fns); } diff --git a/source3/modules/vfs_afsacl.c b/source3/modules/vfs_afsacl.c index e6f43c9680..1c310c7185 100644 --- a/source3/modules/vfs_afsacl.c +++ b/source3/modules/vfs_afsacl.c @@ -1068,23 +1068,16 @@ static int afsacl_connect(vfs_handle_struct *handle, return SMB_VFS_NEXT_CONNECT(handle, service, user); } -/* VFS operations structure */ - -static vfs_op_tuple afsacl_ops[] = { - {SMB_VFS_OP(afsacl_connect), SMB_VFS_OP_CONNECT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(afsacl_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(afsacl_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(afsacl_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_afsacl_fns = { + .connect_fn = afsacl_connect, + .fget_nt_acl = afsacl_fget_nt_acl, + .get_nt_acl = afsacl_get_nt_acl, + .fset_nt_acl = afsacl_fset_nt_acl }; NTSTATUS vfs_afsacl_init(void); NTSTATUS vfs_afsacl_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "afsacl", - afsacl_ops); + &vfs_afsacl_fns); } diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c index cb4ad0cf82..4468fe097f 100644 --- a/source3/modules/vfs_aio_fork.c +++ b/source3/modules/vfs_aio_fork.c @@ -723,26 +723,17 @@ static int aio_fork_error_fn(struct vfs_handle_struct *handle, return child->retval.ret_errno; } -/* VFS operations structure */ - -static vfs_op_tuple aio_fork_ops[] = { - {SMB_VFS_OP(aio_fork_read), SMB_VFS_OP_AIO_READ, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(aio_fork_write), SMB_VFS_OP_AIO_WRITE, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(aio_fork_return_fn), SMB_VFS_OP_AIO_RETURN, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(aio_fork_cancel), SMB_VFS_OP_AIO_CANCEL, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(aio_fork_error_fn), SMB_VFS_OP_AIO_ERROR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_aio_fork_fns = { + .aio_read = aio_fork_read, + .aio_write = aio_fork_write, + .aio_return_fn = aio_fork_return_fn, + .aio_cancel = aio_fork_cancel, + .aio_error_fn = aio_fork_error_fn, }; NTSTATUS vfs_aio_fork_init(void); NTSTATUS vfs_aio_fork_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, - "aio_fork", aio_fork_ops); + "aio_fork", &vfs_aio_fork_fns); } diff --git a/source3/modules/vfs_aixacl.c b/source3/modules/vfs_aixacl.c index 726a7f485e..a4f58db0ba 100644 --- a/source3/modules/vfs_aixacl.c +++ b/source3/modules/vfs_aixacl.c @@ -177,38 +177,17 @@ int aixacl_sys_acl_delete_def_file(vfs_handle_struct *handle, return 0; /* otherwise you can't set acl at upper level */ } -/* VFS operations structure */ - -static vfs_op_tuple aixacl_op_tuples[] = { - /* Disk operations */ - {SMB_VFS_OP(aixacl_sys_acl_get_file), - SMB_VFS_OP_SYS_ACL_GET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(aixacl_sys_acl_get_fd), - SMB_VFS_OP_SYS_ACL_GET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(aixacl_sys_acl_set_file), - SMB_VFS_OP_SYS_ACL_SET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(aixacl_sys_acl_set_fd), - SMB_VFS_OP_SYS_ACL_SET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(aixacl_sys_acl_delete_def_file), - SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), - SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_aixacl_fns = { + .sys_acl_get_file = aixacl_sys_acl_get_file, + .sys_acl_get_fd = aixacl_sys_acl_get_fd, + .sys_acl_set_file = aixacl_sys_acl_set_file, + .sys_acl_set_fd = aixacl_sys_acl_set_fd, + .sys_acl_delete_def_file = aixacl_sys_acl_delete_def_file, }; NTSTATUS vfs_aixacl_init(void); NTSTATUS vfs_aixacl_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "aixacl", - aixacl_op_tuples); + &vfs_aixacl_fns); } diff --git a/source3/modules/vfs_aixacl2.c b/source3/modules/vfs_aixacl2.c index 01de33ed0b..42fb4571fc 100644 --- a/source3/modules/vfs_aixacl2.c +++ b/source3/modules/vfs_aixacl2.c @@ -484,51 +484,20 @@ int aixjfs2_sys_acl_delete_def_file(vfs_handle_struct *handle, return 0; } - -/* VFS operations structure */ - -static vfs_op_tuple aixjfs2_ops[] = -{ - {SMB_VFS_OP(aixjfs2_fget_nt_acl), - SMB_VFS_OP_FGET_NT_ACL, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(aixjfs2_get_nt_acl), - SMB_VFS_OP_GET_NT_ACL, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(aixjfs2_fset_nt_acl), - SMB_VFS_OP_FSET_NT_ACL, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(aixjfs2_sys_acl_get_file), - SMB_VFS_OP_SYS_ACL_GET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(aixjfs2_sys_acl_get_fd), - SMB_VFS_OP_SYS_ACL_GET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(aixjfs2_sys_acl_set_file), - SMB_VFS_OP_SYS_ACL_SET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(aixjfs2_sys_acl_set_fd), - SMB_VFS_OP_SYS_ACL_SET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(aixjfs2_sys_acl_delete_def_file), - SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), - SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} -}; +static struct vfs_fn_pointers vfs_aixacl2_fns = { + .fget_nt_acl = aixjfs2_fget_nt_acl, + .get_nt_acl = aixjfs2_get_nt_acl, + .fset_nt_acl = aixjfs2_fset_nt_acl, + .sys_acl_get_file = aixjfs2_sys_acl_get_file, + .sys_acl_get_fd = aixjfs2_sys_acl_get_fd, + .sys_acl_set_file = aixjfs2_sys_acl_set_file, + .sys_acl_set_fd = aixjfs2_sys_acl_set_fd, + .sys_acl_delete_def_file = aixjfs2_sys_acl_delete_def_file +} NTSTATUS vfs_aixacl2_init(void); NTSTATUS vfs_aixacl2_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, AIXACL2_MODULE_NAME, - aixjfs2_ops); + &vfs_aixacl2_fns); } diff --git a/source3/modules/vfs_audit.c b/source3/modules/vfs_audit.c index dab3d78cec..258246e42d 100644 --- a/source3/modules/vfs_audit.c +++ b/source3/modules/vfs_audit.c @@ -258,37 +258,24 @@ static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t return result; } -/* VFS operations */ -static vfs_op_tuple audit_op_tuples[] = { - - /* Disk operations */ - - {SMB_VFS_OP(audit_connect), SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_disconnect), SMB_VFS_OP_DISCONNECT, SMB_VFS_LAYER_LOGGER}, - - /* Directory operations */ - - {SMB_VFS_OP(audit_opendir), SMB_VFS_OP_OPENDIR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_mkdir), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_rmdir), SMB_VFS_OP_RMDIR, SMB_VFS_LAYER_LOGGER}, - - /* File operations */ - - {SMB_VFS_OP(audit_open), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_close), SMB_VFS_OP_CLOSE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_unlink), SMB_VFS_OP_UNLINK, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_chmod), SMB_VFS_OP_CHMOD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fchmod), SMB_VFS_OP_FCHMOD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_chmod_acl), SMB_VFS_OP_CHMOD_ACL, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fchmod_acl), SMB_VFS_OP_FCHMOD_ACL, SMB_VFS_LAYER_LOGGER}, - - /* Finish VFS operations definition */ - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_audit_fns = { + .connect_fn = audit_connect, + .disconnect = audit_disconnect, + .opendir = audit_opendir, + .mkdir = audit_mkdir, + .rmdir = audit_rmdir, + .open = audit_open, + .close_fn = audit_close, + .rename = audit_rename, + .unlink = audit_unlink, + .chmod = audit_chmod, + .fchmod = audit_fchmod, + .chmod_acl = audit_chmod_acl, + .fchmod_acl = audit_fchmod_acl }; NTSTATUS vfs_audit_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "audit", audit_op_tuples); + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "audit", + &vfs_audit_fns); } diff --git a/source3/modules/vfs_cacheprime.c b/source3/modules/vfs_cacheprime.c index 3997dcbcfc..d107c5fc96 100644 --- a/source3/modules/vfs_cacheprime.c +++ b/source3/modules/vfs_cacheprime.c @@ -168,18 +168,11 @@ static ssize_t cprime_pread( return SMB_VFS_NEXT_PREAD(handle, fsp, data, count, offset); } -static vfs_op_tuple cprime_ops [] = -{ - {SMB_VFS_OP(cprime_sendfile), - SMB_VFS_OP_SENDFILE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cprime_pread), - SMB_VFS_OP_PREAD, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cprime_read), - SMB_VFS_OP_READ, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cprime_connect), - SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_cacheprime_fns = { + .sendfile = cprime_sendfile, + .pread = cprime_pread, + .vfs_read = cprime_read, + .connect_fn = cprime_connect, }; /* ------------------------------------------------------------------------- @@ -190,7 +183,8 @@ static vfs_op_tuple cprime_ops [] = NTSTATUS vfs_cacheprime_init(void); NTSTATUS vfs_cacheprime_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, MODULE, cprime_ops); + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, MODULE, + &vfs_cacheprime_fns); } /* vim: set sw=4 ts=4 tw=79 et: */ diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c index aa77da7cd7..7edbb8783c 100644 --- a/source3/modules/vfs_cap.c +++ b/source3/modules/vfs_cap.c @@ -401,10 +401,6 @@ static int cap_chmod_acl(vfs_handle_struct *handle, const char *path, mode_t mod char *cappath = capencode(talloc_tos(), path); /* If the underlying VFS doesn't have ACL support... */ - if (!handle->vfs_next.ops.chmod_acl) { - errno = ENOSYS; - return -1; - } if (!cappath) { errno = ENOMEM; return -1; @@ -573,67 +569,49 @@ static int cap_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, co return SMB_VFS_NEXT_FSETXATTR(handle, fsp, cappath, value, size, flags); } -/* VFS operations structure */ - -static vfs_op_tuple cap_op_tuples[] = { - - /* Disk operations */ - - {SMB_VFS_OP(cap_disk_free), SMB_VFS_OP_DISK_FREE, SMB_VFS_LAYER_TRANSPARENT}, - - /* Directory operations */ - - {SMB_VFS_OP(cap_opendir), SMB_VFS_OP_OPENDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_readdir), SMB_VFS_OP_READDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_mkdir), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_rmdir), SMB_VFS_OP_RMDIR, SMB_VFS_LAYER_TRANSPARENT}, - - /* File operations */ - - {SMB_VFS_OP(cap_open), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_stat), SMB_VFS_OP_STAT, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_lstat), SMB_VFS_OP_LSTAT, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_unlink), SMB_VFS_OP_UNLINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_chmod), SMB_VFS_OP_CHMOD, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_chown), SMB_VFS_OP_CHOWN, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_lchown), SMB_VFS_OP_LCHOWN, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_chdir), SMB_VFS_OP_CHDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_ntimes), SMB_VFS_OP_NTIMES, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_symlink), SMB_VFS_OP_SYMLINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_readlink), SMB_VFS_OP_READLINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_link), SMB_VFS_OP_LINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_mknod), SMB_VFS_OP_MKNOD, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_realpath), SMB_VFS_OP_REALPATH, SMB_VFS_LAYER_TRANSPARENT}, - - /* POSIX ACL operations */ - - {SMB_VFS_OP(cap_chmod_acl), SMB_VFS_OP_CHMOD_ACL, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(cap_sys_acl_get_file), SMB_VFS_OP_SYS_ACL_GET_FILE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_sys_acl_set_file), SMB_VFS_OP_SYS_ACL_SET_FILE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_sys_acl_delete_def_file), SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, SMB_VFS_LAYER_TRANSPARENT}, - - /* EA operations. */ - {SMB_VFS_OP(cap_getxattr), SMB_VFS_OP_GETXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_lgetxattr), SMB_VFS_OP_LGETXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_fgetxattr), SMB_VFS_OP_FGETXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_listxattr), SMB_VFS_OP_LISTXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_llistxattr), SMB_VFS_OP_LLISTXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_removexattr), SMB_VFS_OP_REMOVEXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_lremovexattr), SMB_VFS_OP_LREMOVEXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_fremovexattr), SMB_VFS_OP_FREMOVEXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_setxattr), SMB_VFS_OP_SETXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_lsetxattr), SMB_VFS_OP_LSETXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(cap_fsetxattr), SMB_VFS_OP_FSETXATTR, SMB_VFS_LAYER_TRANSPARENT}, - - {NULL, SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_cap_fns = { + .disk_free = cap_disk_free, + .opendir = cap_opendir, + .readdir = cap_readdir, + .mkdir = cap_mkdir, + .rmdir = cap_rmdir, + .open = cap_open, + .rename = cap_rename, + .stat = cap_stat, + .lstat = cap_lstat, + .unlink = cap_unlink, + .chmod = cap_chmod, + .chown = cap_chown, + .lchown = cap_lchown, + .chdir = cap_chdir, + .ntimes = cap_ntimes, + .symlink = cap_symlink, + .vfs_readlink = cap_readlink, + .link = cap_link, + .mknod = cap_mknod, + .realpath = cap_realpath, + .chmod_acl = cap_chmod_acl, + .sys_acl_get_file = cap_sys_acl_get_file, + .sys_acl_set_file = cap_sys_acl_set_file, + .sys_acl_delete_def_file = cap_sys_acl_delete_def_file, + .getxattr = cap_getxattr, + .lgetxattr = cap_lgetxattr, + .fgetxattr = cap_fgetxattr, + .listxattr = cap_listxattr, + .llistxattr = cap_llistxattr, + .removexattr = cap_removexattr, + .lremovexattr = cap_lremovexattr, + .fremovexattr = cap_fremovexattr, + .setxattr = cap_setxattr, + .lsetxattr = cap_lsetxattr, + .fsetxattr = cap_fsetxattr }; NTSTATUS vfs_cap_init(void); NTSTATUS vfs_cap_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "cap", cap_op_tuples); + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "cap", + &vfs_cap_fns); } /* For CAP functions */ diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index 3b691c0350..112c7457bb 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -337,45 +337,23 @@ static int catia_chdir(vfs_handle_struct *handle, return SMB_VFS_NEXT_CHDIR(handle, name); } -/* VFS operations structure */ - -static vfs_op_tuple catia_op_tuples[] = { - - /* Directory operations */ - - {SMB_VFS_OP(catia_opendir), SMB_VFS_OP_OPENDIR, -SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(catia_readdir), SMB_VFS_OP_READDIR, -SMB_VFS_LAYER_TRANSPARENT}, - - /* File operations */ - - {SMB_VFS_OP(catia_open), SMB_VFS_OP_OPEN, -SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(catia_rename), SMB_VFS_OP_RENAME, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(catia_stat), SMB_VFS_OP_STAT, -SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(catia_lstat), SMB_VFS_OP_LSTAT, -SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(catia_unlink), SMB_VFS_OP_UNLINK, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(catia_chmod), SMB_VFS_OP_CHMOD, -SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(catia_chown), SMB_VFS_OP_CHOWN, -SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(catia_lchown), SMB_VFS_OP_LCHOWN, -SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(catia_chdir), SMB_VFS_OP_CHDIR, -SMB_VFS_LAYER_TRANSPARENT}, - - {NULL, SMB_VFS_OP_NOOP, -SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_catia_fns = { + .opendir = catia_opendir, + .readdir = catia_readdir, + .open = catia_open, + .rename = catia_rename, + .stat = catia_stat, + .lstat = catia_lstat, + .unlink = catia_unlink, + .chmod = catia_chmod, + .chown = catia_chown, + .lchown = catia_lchown, + .chdir = catia_chdir, }; NTSTATUS vfs_catia_init(void); NTSTATUS vfs_catia_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "catia", -catia_op_tuples); + &vfs_catia_fns); } diff --git a/source3/modules/vfs_commit.c b/source3/modules/vfs_commit.c index ccf733d09b..b926112203 100644 --- a/source3/modules/vfs_commit.c +++ b/source3/modules/vfs_commit.c @@ -294,28 +294,20 @@ static int commit_ftruncate( return result; } -static vfs_op_tuple commit_ops [] = -{ - {SMB_VFS_OP(commit_open), - SMB_VFS_OP_OPEN, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(commit_close), - SMB_VFS_OP_CLOSE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(commit_write), - SMB_VFS_OP_WRITE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(commit_pwrite), - SMB_VFS_OP_PWRITE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(commit_connect), - SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(commit_ftruncate), - SMB_VFS_OP_FTRUNCATE, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_commit_fns = { + .open = commit_open, + .close_fn = commit_close, + .write = commit_write, + .pwrite = commit_pwrite, + .connect_fn = commit_connect, + .ftruncate = commit_ftruncate }; NTSTATUS vfs_commit_init(void); NTSTATUS vfs_commit_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, MODULE, commit_ops); + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, MODULE, + &vfs_commit_fns); } diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index cdfd28c571..a4922e7e05 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -1573,270 +1573,147 @@ static int vfswrap_set_offline(struct vfs_handle_struct *handle, const char *pat return -1; } -static vfs_op_tuple vfs_default_ops[] = { - +static struct vfs_fn_pointers vfs_default_fns = { /* Disk operations */ - {SMB_VFS_OP(vfswrap_connect), SMB_VFS_OP_CONNECT, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_disconnect), SMB_VFS_OP_DISCONNECT, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_disk_free), SMB_VFS_OP_DISK_FREE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_get_quota), SMB_VFS_OP_GET_QUOTA, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_set_quota), SMB_VFS_OP_SET_QUOTA, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_get_shadow_copy_data), SMB_VFS_OP_GET_SHADOW_COPY_DATA, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_statvfs), SMB_VFS_OP_STATVFS, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES, - SMB_VFS_LAYER_OPAQUE}, + .connect_fn = vfswrap_connect, + .disconnect = vfswrap_disconnect, + .disk_free = vfswrap_disk_free, + .get_quota = vfswrap_get_quota, + .set_quota = vfswrap_set_quota, + .get_shadow_copy_data = vfswrap_get_shadow_copy_data, + .statvfs = vfswrap_statvfs, + .fs_capabilities = vfswrap_fs_capabilities, /* Directory operations */ - {SMB_VFS_OP(vfswrap_opendir), SMB_VFS_OP_OPENDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_readdir), SMB_VFS_OP_READDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_seekdir), SMB_VFS_OP_SEEKDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_telldir), SMB_VFS_OP_TELLDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_rewinddir), SMB_VFS_OP_REWINDDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_mkdir), SMB_VFS_OP_MKDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_rmdir), SMB_VFS_OP_RMDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_closedir), SMB_VFS_OP_CLOSEDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_init_search_op), SMB_VFS_OP_INIT_SEARCH_OP, - SMB_VFS_LAYER_OPAQUE}, + .opendir = vfswrap_opendir, + .readdir = vfswrap_readdir, + .seekdir = vfswrap_seekdir, + .telldir = vfswrap_telldir, + .rewind_dir = vfswrap_rewinddir, + .mkdir = vfswrap_mkdir, + .rmdir = vfswrap_rmdir, + .closedir = vfswrap_closedir, + .init_search_op = vfswrap_init_search_op, /* File operations */ - {SMB_VFS_OP(vfswrap_open), SMB_VFS_OP_OPEN, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_create_file), SMB_VFS_OP_CREATE_FILE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_close), SMB_VFS_OP_CLOSE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_read), SMB_VFS_OP_READ, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_pread), SMB_VFS_OP_PREAD, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_write), SMB_VFS_OP_WRITE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_pwrite), SMB_VFS_OP_PWRITE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_lseek), SMB_VFS_OP_LSEEK, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sendfile), SMB_VFS_OP_SENDFILE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_recvfile), SMB_VFS_OP_RECVFILE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_rename), SMB_VFS_OP_RENAME, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_fsync), SMB_VFS_OP_FSYNC, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_stat), SMB_VFS_OP_STAT, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_fstat), SMB_VFS_OP_FSTAT, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_lstat), SMB_VFS_OP_LSTAT, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_get_alloc_size), SMB_VFS_OP_GET_ALLOC_SIZE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_unlink), SMB_VFS_OP_UNLINK, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_chmod), SMB_VFS_OP_CHMOD, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_fchmod), SMB_VFS_OP_FCHMOD, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_chown), SMB_VFS_OP_CHOWN, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_fchown), SMB_VFS_OP_FCHOWN, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_lchown), SMB_VFS_OP_LCHOWN, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_chdir), SMB_VFS_OP_CHDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_getwd), SMB_VFS_OP_GETWD, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_ntimes), SMB_VFS_OP_NTIMES, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_ftruncate), SMB_VFS_OP_FTRUNCATE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_lock), SMB_VFS_OP_LOCK, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_kernel_flock), SMB_VFS_OP_KERNEL_FLOCK, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_linux_setlease), SMB_VFS_OP_LINUX_SETLEASE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_getlock), SMB_VFS_OP_GETLOCK, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_symlink), SMB_VFS_OP_SYMLINK, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_readlink), SMB_VFS_OP_READLINK, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_link), SMB_VFS_OP_LINK, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_mknod), SMB_VFS_OP_MKNOD, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_realpath), SMB_VFS_OP_REALPATH, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_notify_watch), SMB_VFS_OP_NOTIFY_WATCH, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_chflags), SMB_VFS_OP_CHFLAGS, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_file_id_create), SMB_VFS_OP_FILE_ID_CREATE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_streaminfo), SMB_VFS_OP_STREAMINFO, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_get_real_filename), SMB_VFS_OP_GET_REAL_FILENAME, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_connectpath), SMB_VFS_OP_CONNECTPATH, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_brl_lock_windows), SMB_VFS_OP_BRL_LOCK_WINDOWS, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_brl_unlock_windows),SMB_VFS_OP_BRL_UNLOCK_WINDOWS, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_brl_cancel_windows),SMB_VFS_OP_BRL_CANCEL_WINDOWS, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_strict_lock), SMB_VFS_OP_STRICT_LOCK, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_strict_unlock), SMB_VFS_OP_STRICT_UNLOCK, - SMB_VFS_LAYER_OPAQUE}, + .open = vfswrap_open, + .create_file = vfswrap_create_file, + .close_fn = vfswrap_close, + .vfs_read = vfswrap_read, + .pread = vfswrap_pread, + .write = vfswrap_write, + .pwrite = vfswrap_pwrite, + .lseek = vfswrap_lseek, + .sendfile = vfswrap_sendfile, + .recvfile = vfswrap_recvfile, + .rename = vfswrap_rename, + .fsync = vfswrap_fsync, + .stat = vfswrap_stat, + .fstat = vfswrap_fstat, + .lstat = vfswrap_lstat, + .get_alloc_size = vfswrap_get_alloc_size, + .unlink = vfswrap_unlink, + .chmod = vfswrap_chmod, + .fchmod = vfswrap_fchmod, + .chown = vfswrap_chown, + .fchown = vfswrap_fchown, + .lchown = vfswrap_lchown, + .chdir = vfswrap_chdir, + .getwd = vfswrap_getwd, + .ntimes = vfswrap_ntimes, + .ftruncate = vfswrap_ftruncate, + .lock = vfswrap_lock, + .kernel_flock = vfswrap_kernel_flock, + .linux_setlease = vfswrap_linux_setlease, + .getlock = vfswrap_getlock, + .symlink = vfswrap_symlink, + .vfs_readlink = vfswrap_readlink, + .link = vfswrap_link, + .mknod = vfswrap_mknod, + .realpath = vfswrap_realpath, + .notify_watch = vfswrap_notify_watch, + .chflags = vfswrap_chflags, + .file_id_create = vfswrap_file_id_create, + .streaminfo = vfswrap_streaminfo, + .get_real_filename = vfswrap_get_real_filename, + .connectpath = vfswrap_connectpath, + .brl_lock_windows = vfswrap_brl_lock_windows, + .brl_unlock_windows = vfswrap_brl_unlock_windows, + .brl_cancel_windows = vfswrap_brl_cancel_windows, + .strict_lock = vfswrap_strict_lock, + .strict_unlock = vfswrap_strict_unlock, /* NT ACL operations. */ - {SMB_VFS_OP(vfswrap_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, - SMB_VFS_LAYER_OPAQUE}, + .fget_nt_acl = vfswrap_fget_nt_acl, + .get_nt_acl = vfswrap_get_nt_acl, + .fset_nt_acl = vfswrap_fset_nt_acl, /* POSIX ACL operations. */ - {SMB_VFS_OP(vfswrap_chmod_acl), SMB_VFS_OP_CHMOD_ACL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_fchmod_acl), SMB_VFS_OP_FCHMOD_ACL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_get_entry), SMB_VFS_OP_SYS_ACL_GET_ENTRY, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_get_tag_type), SMB_VFS_OP_SYS_ACL_GET_TAG_TYPE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_get_permset), SMB_VFS_OP_SYS_ACL_GET_PERMSET, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_get_qualifier), SMB_VFS_OP_SYS_ACL_GET_QUALIFIER, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_get_file), SMB_VFS_OP_SYS_ACL_GET_FILE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_get_fd), SMB_VFS_OP_SYS_ACL_GET_FD, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_clear_perms), SMB_VFS_OP_SYS_ACL_CLEAR_PERMS, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_add_perm), SMB_VFS_OP_SYS_ACL_ADD_PERM, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_to_text), SMB_VFS_OP_SYS_ACL_TO_TEXT, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_init), SMB_VFS_OP_SYS_ACL_INIT, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_create_entry), SMB_VFS_OP_SYS_ACL_CREATE_ENTRY, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_set_tag_type), SMB_VFS_OP_SYS_ACL_SET_TAG_TYPE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_set_qualifier), SMB_VFS_OP_SYS_ACL_SET_QUALIFIER, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_set_permset), SMB_VFS_OP_SYS_ACL_SET_PERMSET, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_valid), SMB_VFS_OP_SYS_ACL_VALID, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_set_file), SMB_VFS_OP_SYS_ACL_SET_FILE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_set_fd), SMB_VFS_OP_SYS_ACL_SET_FD, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_delete_def_file), SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_get_perm), SMB_VFS_OP_SYS_ACL_GET_PERM, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_free_text), SMB_VFS_OP_SYS_ACL_FREE_TEXT, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_free_acl), SMB_VFS_OP_SYS_ACL_FREE_ACL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_sys_acl_free_qualifier), SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, - SMB_VFS_LAYER_OPAQUE}, + .chmod_acl = vfswrap_chmod_acl, + .fchmod_acl = vfswrap_fchmod_acl, + + .sys_acl_get_entry = vfswrap_sys_acl_get_entry, + .sys_acl_get_tag_type = vfswrap_sys_acl_get_tag_type, + .sys_acl_get_permset = vfswrap_sys_acl_get_permset, + .sys_acl_get_qualifier = vfswrap_sys_acl_get_qualifier, + .sys_acl_get_file = vfswrap_sys_acl_get_file, + .sys_acl_get_fd = vfswrap_sys_acl_get_fd, + .sys_acl_clear_perms = vfswrap_sys_acl_clear_perms, + .sys_acl_add_perm = vfswrap_sys_acl_add_perm, + .sys_acl_to_text = vfswrap_sys_acl_to_text, + .sys_acl_init = vfswrap_sys_acl_init, + .sys_acl_create_entry = vfswrap_sys_acl_create_entry, + .sys_acl_set_tag_type = vfswrap_sys_acl_set_tag_type, + .sys_acl_set_qualifier = vfswrap_sys_acl_set_qualifier, + .sys_acl_set_permset = vfswrap_sys_acl_set_permset, + .sys_acl_valid = vfswrap_sys_acl_valid, + .sys_acl_set_file = vfswrap_sys_acl_set_file, + .sys_acl_set_fd = vfswrap_sys_acl_set_fd, + .sys_acl_delete_def_file = vfswrap_sys_acl_delete_def_file, + .sys_acl_get_perm = vfswrap_sys_acl_get_perm, + .sys_acl_free_text = vfswrap_sys_acl_free_text, + .sys_acl_free_acl = vfswrap_sys_acl_free_acl, + .sys_acl_free_qualifier = vfswrap_sys_acl_free_qualifier, /* EA operations. */ - - {SMB_VFS_OP(vfswrap_getxattr), SMB_VFS_OP_GETXATTR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_lgetxattr), SMB_VFS_OP_LGETXATTR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_fgetxattr), SMB_VFS_OP_FGETXATTR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_listxattr), SMB_VFS_OP_LISTXATTR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_llistxattr), SMB_VFS_OP_LLISTXATTR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_flistxattr), SMB_VFS_OP_FLISTXATTR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_removexattr), SMB_VFS_OP_REMOVEXATTR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_lremovexattr), SMB_VFS_OP_LREMOVEXATTR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_fremovexattr), SMB_VFS_OP_FREMOVEXATTR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_setxattr), SMB_VFS_OP_SETXATTR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_lsetxattr), SMB_VFS_OP_LSETXATTR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_fsetxattr), SMB_VFS_OP_FSETXATTR, - SMB_VFS_LAYER_OPAQUE}, - - {SMB_VFS_OP(vfswrap_aio_read), SMB_VFS_OP_AIO_READ, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_aio_write), SMB_VFS_OP_AIO_WRITE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_aio_return), SMB_VFS_OP_AIO_RETURN, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_aio_cancel), SMB_VFS_OP_AIO_CANCEL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_aio_error), SMB_VFS_OP_AIO_ERROR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_aio_fsync), SMB_VFS_OP_AIO_FSYNC, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_aio_suspend),SMB_VFS_OP_AIO_SUSPEND, - SMB_VFS_LAYER_OPAQUE}, - - {SMB_VFS_OP(vfswrap_aio_force), SMB_VFS_OP_AIO_FORCE, - SMB_VFS_LAYER_OPAQUE}, - - {SMB_VFS_OP(vfswrap_is_offline),SMB_VFS_OP_IS_OFFLINE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(vfswrap_set_offline),SMB_VFS_OP_SET_OFFLINE, - SMB_VFS_LAYER_OPAQUE}, - - /* Finish VFS operations definition */ - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} + .getxattr = vfswrap_getxattr, + .lgetxattr = vfswrap_lgetxattr, + .fgetxattr = vfswrap_fgetxattr, + .listxattr = vfswrap_listxattr, + .llistxattr = vfswrap_llistxattr, + .flistxattr = vfswrap_flistxattr, + .removexattr = vfswrap_removexattr, + .lremovexattr = vfswrap_lremovexattr, + .fremovexattr = vfswrap_fremovexattr, + .setxattr = vfswrap_setxattr, + .lsetxattr = vfswrap_lsetxattr, + .fsetxattr = vfswrap_fsetxattr, + + /* aio operations */ + .aio_read = vfswrap_aio_read, + .aio_write = vfswrap_aio_write, + .aio_return_fn = vfswrap_aio_return, + .aio_cancel = vfswrap_aio_cancel, + .aio_error_fn = vfswrap_aio_error, + .aio_fsync = vfswrap_aio_fsync, + .aio_suspend = vfswrap_aio_suspend, + .aio_force = vfswrap_aio_force, + + /* offline operations */ + .is_offline = vfswrap_is_offline, + .set_offline = vfswrap_set_offline }; NTSTATUS vfs_default_init(void); NTSTATUS vfs_default_init(void) { - unsigned int needed = SMB_VFS_OP_LAST + 1; /* convert from index to count */ - - if (ARRAY_SIZE(vfs_default_ops) != needed) { - DEBUG(0, ("%s: %u ops registered, but %u ops are required\n", - DEFAULT_VFS_MODULE_NAME, (unsigned int)ARRAY_SIZE(vfs_default_ops), needed)); - smb_panic("operation(s) missing from default VFS module"); - } - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, - DEFAULT_VFS_MODULE_NAME, vfs_default_ops); + DEFAULT_VFS_MODULE_NAME, &vfs_default_fns); } + + diff --git a/source3/modules/vfs_default_quota.c b/source3/modules/vfs_default_quota.c index 6dbbad75fa..33af5bd9e9 100644 --- a/source3/modules/vfs_default_quota.c +++ b/source3/modules/vfs_default_quota.c @@ -214,17 +214,14 @@ static int default_quota_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYP return ret; } -/* VFS operations structure */ - -static vfs_op_tuple default_quota_ops[] = { - {SMB_VFS_OP(default_quota_get_quota), SMB_VFS_OP_GET_QUOTA, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(default_quota_set_quota), SMB_VFS_OP_SET_QUOTA, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_default_quota_fns = { + .get_quota = default_quota_get_quota, + .set_quota = default_quota_set_quota }; NTSTATUS vfs_default_quota_init(void); NTSTATUS vfs_default_quota_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, DEFAULT_QUOTA_NAME, default_quota_ops); + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, DEFAULT_QUOTA_NAME, + &vfs_default_quota_fns); } diff --git a/source3/modules/vfs_dirsort.c b/source3/modules/vfs_dirsort.c index f6fc9256d0..c2053e14e6 100644 --- a/source3/modules/vfs_dirsort.c +++ b/source3/modules/vfs_dirsort.c @@ -167,29 +167,16 @@ static void dirsort_rewinddir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp) data->pos = 0; } -/* VFS operations structure */ - -static vfs_op_tuple dirsort_op_tuples[] = { - - /* Directory operations */ - - {SMB_VFS_OP(dirsort_opendir), SMB_VFS_OP_OPENDIR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(dirsort_readdir), SMB_VFS_OP_READDIR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(dirsort_seekdir), SMB_VFS_OP_SEEKDIR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(dirsort_telldir), SMB_VFS_OP_TELLDIR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(dirsort_rewinddir), SMB_VFS_OP_REWINDDIR, - SMB_VFS_LAYER_TRANSPARENT}, - - {NULL, SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_dirsort_fns = { + .opendir = dirsort_opendir, + .readdir = dirsort_readdir, + .seekdir = dirsort_seekdir, + .telldir = dirsort_telldir, + .rewind_dir = dirsort_rewinddir, }; NTSTATUS vfs_dirsort_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "dirsort", - dirsort_op_tuples); + &vfs_dirsort_fns); } diff --git a/source3/modules/vfs_expand_msdfs.c b/source3/modules/vfs_expand_msdfs.c index 0d09d213e1..9edd0f6caf 100644 --- a/source3/modules/vfs_expand_msdfs.c +++ b/source3/modules/vfs_expand_msdfs.c @@ -199,17 +199,13 @@ static int expand_msdfs_readlink(struct vfs_handle_struct *handle, return strlen(buf); } -/* VFS operations structure */ - -static vfs_op_tuple expand_msdfs_ops[] = { - {SMB_VFS_OP(expand_msdfs_readlink), SMB_VFS_OP_READLINK, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_expand_msdfs_fns = { + .vfs_readlink = expand_msdfs_readlink }; NTSTATUS vfs_expand_msdfs_init(void); NTSTATUS vfs_expand_msdfs_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "expand_msdfs", - expand_msdfs_ops); + &vfs_expand_msdfs_fns); } diff --git a/source3/modules/vfs_extd_audit.c b/source3/modules/vfs_extd_audit.c index c9d1862fa4..c4a20f0bdd 100644 --- a/source3/modules/vfs_extd_audit.c +++ b/source3/modules/vfs_extd_audit.c @@ -336,39 +336,26 @@ static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t return result; } -/* VFS operations */ -static vfs_op_tuple audit_op_tuples[] = { - - /* Disk operations */ - - {SMB_VFS_OP(audit_connect), SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_disconnect), SMB_VFS_OP_DISCONNECT, SMB_VFS_LAYER_LOGGER}, - - /* Directory operations */ - - {SMB_VFS_OP(audit_opendir), SMB_VFS_OP_OPENDIR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_mkdir), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_rmdir), SMB_VFS_OP_RMDIR, SMB_VFS_LAYER_LOGGER}, - - /* File operations */ - - {SMB_VFS_OP(audit_open), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_close), SMB_VFS_OP_CLOSE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_unlink), SMB_VFS_OP_UNLINK, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_chmod), SMB_VFS_OP_CHMOD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fchmod), SMB_VFS_OP_FCHMOD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_chmod_acl), SMB_VFS_OP_CHMOD_ACL, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fchmod_acl), SMB_VFS_OP_FCHMOD_ACL, SMB_VFS_LAYER_LOGGER}, - - /* Finish VFS operations definition */ - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_extd_audit_fns = { + .connect_fn = audit_connect, + .disconnect = audit_disconnect, + .opendir = audit_opendir, + .mkdir = audit_mkdir, + .rmdir = audit_rmdir, + .open = audit_open, + .close_fn = audit_close, + .rename = audit_rename, + .unlink = audit_unlink, + .chmod = audit_chmod, + .fchmod = audit_fchmod, + .chmod_acl = audit_chmod_acl, + .fchmod_acl = audit_fchmod_acl, }; NTSTATUS vfs_extd_audit_init(void) { - NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "extd_audit", audit_op_tuples); + NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, + "extd_audit", &vfs_extd_audit_fns); if (!NT_STATUS_IS_OK(ret)) return ret; diff --git a/source3/modules/vfs_fake_perms.c b/source3/modules/vfs_fake_perms.c index 2740b612ca..3073a128e9 100644 --- a/source3/modules/vfs_fake_perms.c +++ b/source3/modules/vfs_fake_perms.c @@ -62,17 +62,14 @@ static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_ST return ret; } -/* VFS operations structure */ - -static vfs_op_tuple fake_perms_ops[] = { - {SMB_VFS_OP(fake_perms_stat), SMB_VFS_OP_STAT, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(fake_perms_fstat), SMB_VFS_OP_FSTAT, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_fake_perms_fns = { + .stat = fake_perms_stat, + .fstat = fake_perms_fstat }; NTSTATUS vfs_fake_perms_init(void); NTSTATUS vfs_fake_perms_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "fake_perms", fake_perms_ops); + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "fake_perms", + &vfs_fake_perms_fns); } diff --git a/source3/modules/vfs_fileid.c b/source3/modules/vfs_fileid.c index 93b71a4dc0..133ad09cc3 100644 --- a/source3/modules/vfs_fileid.c +++ b/source3/modules/vfs_fileid.c @@ -243,33 +243,10 @@ static struct file_id fileid_file_id_create(struct vfs_handle_struct *handle, return id; } -static vfs_op_tuple fileid_ops[] = { - - /* Disk operations */ - { - SMB_VFS_OP(fileid_connect), - SMB_VFS_OP_CONNECT, - SMB_VFS_LAYER_TRANSPARENT - }, - { - SMB_VFS_OP(fileid_disconnect), - SMB_VFS_OP_DISCONNECT, - SMB_VFS_LAYER_TRANSPARENT - }, - - /* File operations */ - { - SMB_VFS_OP(fileid_file_id_create), - SMB_VFS_OP_FILE_ID_CREATE, - SMB_VFS_LAYER_OPAQUE - }, - - /* End marker */ - { - SMB_VFS_OP(NULL), - SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP - } +static struct vfs_fn_pointers vfs_fileid_fns = { + .connect_fn = fileid_connect, + .disconnect = fileid_disconnect, + .file_id_create = fileid_file_id_create }; NTSTATUS vfs_fileid_init(void); @@ -277,7 +254,8 @@ NTSTATUS vfs_fileid_init(void) { NTSTATUS ret; - ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "fileid", fileid_ops); + ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "fileid", + &vfs_fileid_fns); if (!NT_STATUS_IS_OK(ret)) { return ret; } diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 76fbc8a8ae..f57f9f011a 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -1984,258 +1984,126 @@ static bool smb_full_audit_aio_force(struct vfs_handle_struct *handle, return result; } -/* VFS operations */ -static vfs_op_tuple audit_op_tuples[] = { +static struct vfs_fn_pointers vfs_full_audit_fns = { /* Disk operations */ - {SMB_VFS_OP(smb_full_audit_connect), SMB_VFS_OP_CONNECT, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_disconnect), SMB_VFS_OP_DISCONNECT, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_disk_free), SMB_VFS_OP_DISK_FREE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_get_quota), SMB_VFS_OP_GET_QUOTA, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_set_quota), SMB_VFS_OP_SET_QUOTA, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_get_shadow_copy_data), SMB_VFS_OP_GET_SHADOW_COPY_DATA, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_statvfs), SMB_VFS_OP_STATVFS, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES, - SMB_VFS_LAYER_LOGGER}, - - /* Directory operations */ - - {SMB_VFS_OP(smb_full_audit_opendir), SMB_VFS_OP_OPENDIR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_readdir), SMB_VFS_OP_READDIR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_seekdir), SMB_VFS_OP_SEEKDIR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_telldir), SMB_VFS_OP_TELLDIR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_rewinddir), SMB_VFS_OP_REWINDDIR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_mkdir), SMB_VFS_OP_MKDIR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_rmdir), SMB_VFS_OP_RMDIR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_closedir), SMB_VFS_OP_CLOSEDIR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_init_search_op), SMB_VFS_OP_INIT_SEARCH_OP, - SMB_VFS_LAYER_LOGGER}, - - /* File operations */ - - {SMB_VFS_OP(smb_full_audit_open), SMB_VFS_OP_OPEN, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_create_file),SMB_VFS_OP_CREATE_FILE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_close), SMB_VFS_OP_CLOSE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_read), SMB_VFS_OP_READ, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_pread), SMB_VFS_OP_PREAD, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_write), SMB_VFS_OP_WRITE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_pwrite), SMB_VFS_OP_PWRITE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_lseek), SMB_VFS_OP_LSEEK, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sendfile), SMB_VFS_OP_SENDFILE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_recvfile), SMB_VFS_OP_RECVFILE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_rename), SMB_VFS_OP_RENAME, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_fsync), SMB_VFS_OP_FSYNC, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_stat), SMB_VFS_OP_STAT, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_fstat), SMB_VFS_OP_FSTAT, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_lstat), SMB_VFS_OP_LSTAT, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_get_alloc_size), SMB_VFS_OP_GET_ALLOC_SIZE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_unlink), SMB_VFS_OP_UNLINK, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_chmod), SMB_VFS_OP_CHMOD, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_fchmod), SMB_VFS_OP_FCHMOD, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_chown), SMB_VFS_OP_CHOWN, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_fchown), SMB_VFS_OP_FCHOWN, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_lchown), SMB_VFS_OP_LCHOWN, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_chdir), SMB_VFS_OP_CHDIR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_getwd), SMB_VFS_OP_GETWD, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_ntimes), SMB_VFS_OP_NTIMES, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_ftruncate), SMB_VFS_OP_FTRUNCATE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_lock), SMB_VFS_OP_LOCK, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_kernel_flock), SMB_VFS_OP_KERNEL_FLOCK, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_linux_setlease), SMB_VFS_OP_LINUX_SETLEASE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_getlock), SMB_VFS_OP_GETLOCK, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_symlink), SMB_VFS_OP_SYMLINK, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_readlink), SMB_VFS_OP_READLINK, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_link), SMB_VFS_OP_LINK, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_mknod), SMB_VFS_OP_MKNOD, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_realpath), SMB_VFS_OP_REALPATH, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_notify_watch),SMB_VFS_OP_NOTIFY_WATCH, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_chflags), SMB_VFS_OP_CHFLAGS, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_file_id_create), SMB_VFS_OP_FILE_ID_CREATE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_streaminfo), SMB_VFS_OP_STREAMINFO, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_get_real_filename), SMB_VFS_OP_GET_REAL_FILENAME, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_connectpath), SMB_VFS_OP_CONNECTPATH, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_brl_lock_windows), SMB_VFS_OP_BRL_LOCK_WINDOWS, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_brl_unlock_windows), SMB_VFS_OP_BRL_UNLOCK_WINDOWS, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_brl_cancel_windows), SMB_VFS_OP_BRL_CANCEL_WINDOWS, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_strict_lock), SMB_VFS_OP_STRICT_LOCK, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_strict_unlock), SMB_VFS_OP_STRICT_UNLOCK, - SMB_VFS_LAYER_LOGGER}, - - /* NT ACL operations. */ - - {SMB_VFS_OP(smb_full_audit_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, - SMB_VFS_LAYER_LOGGER}, - - /* POSIX ACL operations. */ - - {SMB_VFS_OP(smb_full_audit_chmod_acl), SMB_VFS_OP_CHMOD_ACL, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_fchmod_acl), SMB_VFS_OP_FCHMOD_ACL, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_get_entry), SMB_VFS_OP_SYS_ACL_GET_ENTRY, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_get_tag_type), SMB_VFS_OP_SYS_ACL_GET_TAG_TYPE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_get_permset), SMB_VFS_OP_SYS_ACL_GET_PERMSET, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_get_qualifier), SMB_VFS_OP_SYS_ACL_GET_QUALIFIER, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_get_file), SMB_VFS_OP_SYS_ACL_GET_FILE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_get_fd), SMB_VFS_OP_SYS_ACL_GET_FD, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_clear_perms), SMB_VFS_OP_SYS_ACL_CLEAR_PERMS, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_add_perm), SMB_VFS_OP_SYS_ACL_ADD_PERM, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_to_text), SMB_VFS_OP_SYS_ACL_TO_TEXT, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_init), SMB_VFS_OP_SYS_ACL_INIT, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_create_entry), SMB_VFS_OP_SYS_ACL_CREATE_ENTRY, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_set_tag_type), SMB_VFS_OP_SYS_ACL_SET_TAG_TYPE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_set_qualifier), SMB_VFS_OP_SYS_ACL_SET_QUALIFIER, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_set_permset), SMB_VFS_OP_SYS_ACL_SET_PERMSET, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_valid), SMB_VFS_OP_SYS_ACL_VALID, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_set_file), SMB_VFS_OP_SYS_ACL_SET_FILE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_set_fd), SMB_VFS_OP_SYS_ACL_SET_FD, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_delete_def_file), SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_get_perm), SMB_VFS_OP_SYS_ACL_GET_PERM, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_free_text), SMB_VFS_OP_SYS_ACL_FREE_TEXT, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_free_acl), SMB_VFS_OP_SYS_ACL_FREE_ACL, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_free_qualifier), SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, - SMB_VFS_LAYER_LOGGER}, - - /* EA operations. */ - - {SMB_VFS_OP(smb_full_audit_getxattr), SMB_VFS_OP_GETXATTR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_lgetxattr), SMB_VFS_OP_LGETXATTR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_fgetxattr), SMB_VFS_OP_FGETXATTR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_listxattr), SMB_VFS_OP_LISTXATTR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_llistxattr), SMB_VFS_OP_LLISTXATTR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_flistxattr), SMB_VFS_OP_FLISTXATTR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_removexattr), SMB_VFS_OP_REMOVEXATTR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_lremovexattr), SMB_VFS_OP_LREMOVEXATTR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_fremovexattr), SMB_VFS_OP_FREMOVEXATTR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_setxattr), SMB_VFS_OP_SETXATTR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_lsetxattr), SMB_VFS_OP_LSETXATTR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_fsetxattr), SMB_VFS_OP_FSETXATTR, - SMB_VFS_LAYER_LOGGER}, - - {SMB_VFS_OP(smb_full_audit_aio_read), SMB_VFS_OP_AIO_READ, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_aio_write), SMB_VFS_OP_AIO_WRITE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_aio_return), SMB_VFS_OP_AIO_RETURN, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_aio_cancel), SMB_VFS_OP_AIO_CANCEL, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_aio_error), SMB_VFS_OP_AIO_ERROR, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_aio_fsync), SMB_VFS_OP_AIO_FSYNC, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_aio_suspend),SMB_VFS_OP_AIO_SUSPEND, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_aio_force),SMB_VFS_OP_AIO_FORCE, - SMB_VFS_LAYER_LOGGER}, - - /* Finish VFS operations definition */ - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} + .connect_fn = smb_full_audit_connect, + .disconnect = smb_full_audit_disconnect, + .disk_free = smb_full_audit_disk_free, + .get_quota = smb_full_audit_get_quota, + .set_quota = smb_full_audit_set_quota, + .get_shadow_copy_data = smb_full_audit_get_shadow_copy_data, + .statvfs = smb_full_audit_statvfs, + .fs_capabilities = smb_full_audit_fs_capabilities, + .opendir = smb_full_audit_opendir, + .readdir = smb_full_audit_readdir, + .seekdir = smb_full_audit_seekdir, + .telldir = smb_full_audit_telldir, + .rewind_dir = smb_full_audit_rewinddir, + .mkdir = smb_full_audit_mkdir, + .rmdir = smb_full_audit_rmdir, + .closedir = smb_full_audit_closedir, + .init_search_op = smb_full_audit_init_search_op, + .open = smb_full_audit_open, + .create_file = smb_full_audit_create_file, + .close_fn = smb_full_audit_close, + .vfs_read = smb_full_audit_read, + .pread = smb_full_audit_pread, + .write = smb_full_audit_write, + .pwrite = smb_full_audit_pwrite, + .lseek = smb_full_audit_lseek, + .sendfile = smb_full_audit_sendfile, + .recvfile = smb_full_audit_recvfile, + .rename = smb_full_audit_rename, + .fsync = smb_full_audit_fsync, + .stat = smb_full_audit_stat, + .fstat = smb_full_audit_fstat, + .lstat = smb_full_audit_lstat, + .get_alloc_size = smb_full_audit_get_alloc_size, + .unlink = smb_full_audit_unlink, + .chmod = smb_full_audit_chmod, + .fchmod = smb_full_audit_fchmod, + .chown = smb_full_audit_chown, + .fchown = smb_full_audit_fchown, + .lchown = smb_full_audit_lchown, + .chdir = smb_full_audit_chdir, + .getwd = smb_full_audit_getwd, + .ntimes = smb_full_audit_ntimes, + .ftruncate = smb_full_audit_ftruncate, + .lock = smb_full_audit_lock, + .kernel_flock = smb_full_audit_kernel_flock, + .linux_setlease = smb_full_audit_linux_setlease, + .getlock = smb_full_audit_getlock, + .symlink = smb_full_audit_symlink, + .vfs_readlink = smb_full_audit_readlink, + .link = smb_full_audit_link, + .mknod = smb_full_audit_mknod, + .realpath = smb_full_audit_realpath, + .notify_watch = smb_full_audit_notify_watch, + .chflags = smb_full_audit_chflags, + .file_id_create = smb_full_audit_file_id_create, + .streaminfo = smb_full_audit_streaminfo, + .get_real_filename = smb_full_audit_get_real_filename, + .connectpath = smb_full_audit_connectpath, + .brl_lock_windows = smb_full_audit_brl_lock_windows, + .brl_unlock_windows = smb_full_audit_brl_unlock_windows, + .brl_cancel_windows = smb_full_audit_brl_cancel_windows, + .strict_lock = smb_full_audit_strict_lock, + .strict_unlock = smb_full_audit_strict_unlock, + .fget_nt_acl = smb_full_audit_fget_nt_acl, + .get_nt_acl = smb_full_audit_get_nt_acl, + .fset_nt_acl = smb_full_audit_fset_nt_acl, + .chmod_acl = smb_full_audit_chmod_acl, + .fchmod_acl = smb_full_audit_fchmod_acl, + .sys_acl_get_entry = smb_full_audit_sys_acl_get_entry, + .sys_acl_get_tag_type = smb_full_audit_sys_acl_get_tag_type, + .sys_acl_get_permset = smb_full_audit_sys_acl_get_permset, + .sys_acl_get_qualifier = smb_full_audit_sys_acl_get_qualifier, + .sys_acl_get_file = smb_full_audit_sys_acl_get_file, + .sys_acl_get_fd = smb_full_audit_sys_acl_get_fd, + .sys_acl_clear_perms = smb_full_audit_sys_acl_clear_perms, + .sys_acl_add_perm = smb_full_audit_sys_acl_add_perm, + .sys_acl_to_text = smb_full_audit_sys_acl_to_text, + .sys_acl_init = smb_full_audit_sys_acl_init, + .sys_acl_create_entry = smb_full_audit_sys_acl_create_entry, + .sys_acl_set_tag_type = smb_full_audit_sys_acl_set_tag_type, + .sys_acl_set_qualifier = smb_full_audit_sys_acl_set_qualifier, + .sys_acl_set_permset = smb_full_audit_sys_acl_set_permset, + .sys_acl_valid = smb_full_audit_sys_acl_valid, + .sys_acl_set_file = smb_full_audit_sys_acl_set_file, + .sys_acl_set_fd = smb_full_audit_sys_acl_set_fd, + .sys_acl_delete_def_file = smb_full_audit_sys_acl_delete_def_file, + .sys_acl_get_perm = smb_full_audit_sys_acl_get_perm, + .sys_acl_free_text = smb_full_audit_sys_acl_free_text, + .sys_acl_free_acl = smb_full_audit_sys_acl_free_acl, + .sys_acl_free_qualifier = smb_full_audit_sys_acl_free_qualifier, + .getxattr = smb_full_audit_getxattr, + .lgetxattr = smb_full_audit_lgetxattr, + .fgetxattr = smb_full_audit_fgetxattr, + .listxattr = smb_full_audit_listxattr, + .llistxattr = smb_full_audit_llistxattr, + .flistxattr = smb_full_audit_flistxattr, + .removexattr = smb_full_audit_removexattr, + .lremovexattr = smb_full_audit_lremovexattr, + .fremovexattr = smb_full_audit_fremovexattr, + .setxattr = smb_full_audit_setxattr, + .lsetxattr = smb_full_audit_lsetxattr, + .fsetxattr = smb_full_audit_fsetxattr, + .aio_read = smb_full_audit_aio_read, + .aio_write = smb_full_audit_aio_write, + .aio_return_fn = smb_full_audit_aio_return, + .aio_cancel = smb_full_audit_aio_cancel, + .aio_error_fn = smb_full_audit_aio_error, + .aio_fsync = smb_full_audit_aio_fsync, + .aio_suspend = smb_full_audit_aio_suspend, + .aio_force = smb_full_audit_aio_force, }; NTSTATUS vfs_full_audit_init(void) { NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, - "full_audit", audit_op_tuples); + "full_audit", &vfs_full_audit_fns); if (!NT_STATUS_IS_OK(ret)) return ret; diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index cde80f0021..25eaa4b62f 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -1057,96 +1057,33 @@ static int vfs_gpfs_lstat(struct vfs_handle_struct *handle, return 0; } -/* VFS operations structure */ - -static vfs_op_tuple gpfs_op_tuples[] = { - - { SMB_VFS_OP(vfs_gpfs_kernel_flock), - SMB_VFS_OP_KERNEL_FLOCK, - SMB_VFS_LAYER_OPAQUE }, - - { SMB_VFS_OP(vfs_gpfs_setlease), - SMB_VFS_OP_LINUX_SETLEASE, - SMB_VFS_LAYER_OPAQUE }, - - { SMB_VFS_OP(vfs_gpfs_get_real_filename), - SMB_VFS_OP_GET_REAL_FILENAME, - SMB_VFS_LAYER_OPAQUE }, - - { SMB_VFS_OP(gpfsacl_fget_nt_acl), - SMB_VFS_OP_FGET_NT_ACL, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(gpfsacl_get_nt_acl), - SMB_VFS_OP_GET_NT_ACL, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(gpfsacl_fset_nt_acl), - SMB_VFS_OP_FSET_NT_ACL, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(gpfsacl_sys_acl_get_file), - SMB_VFS_OP_SYS_ACL_GET_FILE, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(gpfsacl_sys_acl_get_fd), - SMB_VFS_OP_SYS_ACL_GET_FD, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(gpfsacl_sys_acl_set_file), - SMB_VFS_OP_SYS_ACL_SET_FILE, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(gpfsacl_sys_acl_set_fd), - SMB_VFS_OP_SYS_ACL_SET_FD, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(gpfsacl_sys_acl_delete_def_file), - SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(vfs_gpfs_chmod), - SMB_VFS_OP_CHMOD, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(vfs_gpfs_fchmod), - SMB_VFS_OP_FCHMOD, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(vfs_gpfs_close), - SMB_VFS_OP_CLOSE, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(gpfs_set_xattr), - SMB_VFS_OP_SETXATTR, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(gpfs_get_xattr), - SMB_VFS_OP_GETXATTR, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(vfs_gpfs_stat), - SMB_VFS_OP_STAT, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(vfs_gpfs_fstat), - SMB_VFS_OP_FSTAT, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(vfs_gpfs_lstat), - SMB_VFS_OP_LSTAT, - SMB_VFS_LAYER_TRANSPARENT }, - - { SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP } - +static struct vfs_fn_pointers vfs_gpfs_fns = { + .kernel_flock = vfs_gpfs_kernel_flock, + .setlease = vfs_gpfs_setlease, + .get_real_filename = vfs_gpfs_get_real_filename, + .fget_nt_acl = gpfsacl_fget_nt_acl, + .get_nt_acl = gpfsacl_get_nt_acl, + .fset_nt_acl = gpfsacl_fset_nt_acl, + .sys_acl_get_file = gpfsacl_sys_acl_get_file, + .sys_acl_get_fd = gpfsacl_sys_acl_get_fd, + .sys_acl_set_file = gpfsacl_sys_acl_set_file, + .sys_acl_set_fd = gpfsacl_sys_acl_set_fd, + .sys_acl_delete_def_file = gpfsacl_sys_acl_delete_def_file, + .chmod = vfs_gpfs_chmod, + .fchmod = vfs_gpfs_fchmod, + .close_fn = vfs_gpfs_close, + .set_xattr = gpfs_set_xattr, + .get_xattr = gpfs_get_xattr, + .stat = vfs_gpfs_stat, + .fstat = vfs_gpfs_fstat, + .lstat = vfs_gpfs_lstat, }; - NTSTATUS vfs_gpfs_init(void); NTSTATUS vfs_gpfs_init(void) { init_gpfs(); return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "gpfs", - gpfs_op_tuples); + &vfs_gpfs_fns); } diff --git a/source3/modules/vfs_hpuxacl.c b/source3/modules/vfs_hpuxacl.c index 32e8539202..36386365eb 100644 --- a/source3/modules/vfs_hpuxacl.c +++ b/source3/modules/vfs_hpuxacl.c @@ -1150,37 +1150,18 @@ static bool hpux_acl_check(HPUX_ACL_T hpux_acl, int count) /* VFS operations structure */ -static vfs_op_tuple hpuxacl_op_tuples[] = { - /* Disk operations */ - {SMB_VFS_OP(hpuxacl_sys_acl_get_file), - SMB_VFS_OP_SYS_ACL_GET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(hpuxacl_sys_acl_get_fd), - SMB_VFS_OP_SYS_ACL_GET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(hpuxacl_sys_acl_set_file), - SMB_VFS_OP_SYS_ACL_SET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(hpuxacl_sys_acl_set_fd), - SMB_VFS_OP_SYS_ACL_SET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(hpuxacl_sys_acl_delete_def_file), - SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), - SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers hpuxacl_fns = { + .sys_acl_get_file = hpuxacl_sys_acl_get_file, + .sys_acl_get_fd = hpuxacl_sys_acl_get_fd, + .sys_acl_set_file = hpuxacl_sys_acl_set_file, + .sys_acl_set_fd = hpuxacl_sys_acl_set_fd, + .sys_acl_delete_def_file = hpuxacl_sys_acl_delete_def_file, }; NTSTATUS vfs_hpuxacl_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "hpuxacl", - hpuxacl_op_tuples); + &hpuxacl_fns); } /* ENTE */ diff --git a/source3/modules/vfs_irixacl.c b/source3/modules/vfs_irixacl.c index 6484e8f3eb..42f82a9620 100644 --- a/source3/modules/vfs_irixacl.c +++ b/source3/modules/vfs_irixacl.c @@ -66,38 +66,19 @@ int irixacl_sys_acl_delete_def_file(vfs_handle_struct *handle, /* VFS operations structure */ -static vfs_op_tuple irixacl_op_tuples[] = { - /* Disk operations */ - {SMB_VFS_OP(irixacl_sys_acl_get_file), - SMB_VFS_OP_SYS_ACL_GET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(irixacl_sys_acl_get_fd), - SMB_VFS_OP_SYS_ACL_GET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(irixacl_sys_acl_set_file), - SMB_VFS_OP_SYS_ACL_SET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(irixacl_sys_acl_set_fd), - SMB_VFS_OP_SYS_ACL_SET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(irixacl_sys_acl_delete_def_file), - SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), - SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers irixacl_fns = { + .sys_acl_get_file = irixacl_sys_acl_get_file, + .sys_acl_get_fd = irixacl_sys_acl_get_fd, + .sys_acl_set_file = irixacl_sys_acl_set_file, + .sys_acl_set_fd = irixacl_sys_acl_set_fd, + .sys_acl_delete_def_file = irixacl_sys_acl_delete_def_file, }; NTSTATUS vfs_irixacl_init(void); NTSTATUS vfs_irixacl_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "irixacl", - irixacl_op_tuples); + &irixacl_fns); } /* ENTE */ diff --git a/source3/modules/vfs_netatalk.c b/source3/modules/vfs_netatalk.c index 7710772174..fa9e774c1a 100644 --- a/source3/modules/vfs_netatalk.c +++ b/source3/modules/vfs_netatalk.c @@ -421,28 +421,19 @@ exit_lchown: return ret; } -static vfs_op_tuple atalk_ops[] = { - - /* Directory operations */ - - {SMB_VFS_OP(atalk_opendir), SMB_VFS_OP_OPENDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(atalk_rmdir), SMB_VFS_OP_RMDIR, SMB_VFS_LAYER_TRANSPARENT}, - - /* File operations */ - - {SMB_VFS_OP(atalk_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(atalk_unlink), SMB_VFS_OP_UNLINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(atalk_chmod), SMB_VFS_OP_CHMOD, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(atalk_chown), SMB_VFS_OP_CHOWN, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(atalk_lchown), SMB_VFS_OP_LCHOWN, SMB_VFS_LAYER_TRANSPARENT}, - - /* Finish VFS operations definition */ - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_netatalk_fns = { + .opendir = atalk_opendir, + .rmdir = atalk_rmdir, + .rename = atalk_rename, + .unlink = atalk_unlink, + .chmod = atalk_chmod, + .chown = atalk_chown, + .lchown = atalk_lchown, }; NTSTATUS vfs_netatalk_init(void); NTSTATUS vfs_netatalk_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "netatalk", atalk_ops); + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "netatalk", + &vfs_netatalk_fns); } diff --git a/source3/modules/vfs_notify_fam.c b/source3/modules/vfs_notify_fam.c index aacc52e68c..8f00c9207f 100644 --- a/source3/modules/vfs_notify_fam.c +++ b/source3/modules/vfs_notify_fam.c @@ -283,16 +283,8 @@ static NTSTATUS fam_watch(vfs_handle_struct *vfs_handle, /* VFS operations structure */ -static vfs_op_tuple notify_fam_op_tuples[] = { - - {SMB_VFS_OP(fam_watch), - SMB_VFS_OP_NOTIFY_WATCH, - SMB_VFS_LAYER_OPAQUE}, - - {SMB_VFS_OP(NULL), - SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} - +static struct vfs_fn_pointers notify_fam_fns = { + .notify_watch = fam_watch, }; @@ -300,5 +292,5 @@ NTSTATUS vfs_notify_fam_init(void); NTSTATUS vfs_notify_fam_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "notify_fam", - notify_fam_op_tuples); + ¬ify_fam_fns); } diff --git a/source3/modules/vfs_onefs.c b/source3/modules/vfs_onefs.c index 1a37622bea..05f6cfdc74 100644 --- a/source3/modules/vfs_onefs.c +++ b/source3/modules/vfs_onefs.c @@ -246,82 +246,46 @@ static uint32_t onefs_fs_capabilities(struct vfs_handle_struct *handle) return result | SMB_VFS_NEXT_FS_CAPABILITIES(handle); } -static vfs_op_tuple onefs_ops[] = { - {SMB_VFS_OP(onefs_connect), SMB_VFS_OP_CONNECT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_opendir), SMB_VFS_OP_OPENDIR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_readdir), SMB_VFS_OP_READDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_seekdir), SMB_VFS_OP_SEEKDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_telldir), SMB_VFS_OP_TELLDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_rewinddir), SMB_VFS_OP_REWINDDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_mkdir), SMB_VFS_OP_MKDIR, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_closedir), SMB_VFS_OP_CLOSEDIR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_init_search_op), SMB_VFS_OP_INIT_SEARCH_OP, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_open), SMB_VFS_OP_OPEN, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_create_file), SMB_VFS_OP_CREATE_FILE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_close), SMB_VFS_OP_CLOSE, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_sendfile), SMB_VFS_OP_SENDFILE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_recvfile), SMB_VFS_OP_RECVFILE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_rename), SMB_VFS_OP_RENAME, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_stat), SMB_VFS_OP_STAT, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_fstat), SMB_VFS_OP_FSTAT, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_lstat), SMB_VFS_OP_LSTAT, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_get_alloc_size), SMB_VFS_OP_GET_ALLOC_SIZE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_unlink), SMB_VFS_OP_UNLINK, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_ntimes), SMB_VFS_OP_NTIMES, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_file_id_create), SMB_VFS_OP_FILE_ID_CREATE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_streaminfo), SMB_VFS_OP_STREAMINFO, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_brl_lock_windows), SMB_VFS_OP_BRL_LOCK_WINDOWS, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_brl_unlock_windows), SMB_VFS_OP_BRL_UNLOCK_WINDOWS, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_brl_cancel_windows), SMB_VFS_OP_BRL_CANCEL_WINDOWS, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_strict_lock), SMB_VFS_OP_STRICT_LOCK, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_strict_unlock), SMB_VFS_OP_STRICT_UNLOCK, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_notify_watch), SMB_VFS_OP_NOTIFY_WATCH, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_statvfs), SMB_VFS_OP_STATVFS, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_get_real_filename), SMB_VFS_OP_GET_REAL_FILENAME, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers onefs_fns = { + .connect = onefs_connect, + .fs_capabilities = onefs_fs_capabilities, + .opendir = onefs_opendir, + .readdir = onefs_readdir, + .seekdir = onefs_seekdir, + .telldir = onefs_telldir, + .rewinddir = onefs_rewinddir, + .mkdir = onefs_mkdir, + .closedir = onefs_closedir, + .init_search_op = onefs_init_search_op, + .open = onefs_open, + .create_file = onefs_create_file, + .close = onefs_close, + .sendfile = onefs_sendfile, + .recvfile = onefs_recvfile, + .rename = onefs_rename, + .stat = onefs_stat, + .fstat = onefs_fstat, + .lstat = onefs_lstat, + .get_alloc_size = onefs_get_alloc_size, + .unlink = onefs_unlink, + .ntimes = onefs_ntimes, + .file_id_create = onefs_file_id_create, + .streaminfo = onefs_streaminfo, + .brl_lock_windows = onefs_brl_lock_windows, + .brl_unlock_windows = onefs_brl_unlock_windows, + .brl_cancel_windows = onefs_brl_cancel_windows, + .strict_lock = onefs_strict_lock, + .strict_unlock = onefs_strict_unlock, + .notify_watch = onefs_notify_watch, + .fget_nt_acl = onefs_fget_nt_acl, + .get_nt_acl = onefs_get_nt_acl, + .fset_nt_acl = onefs_fset_nt_acl, + .statvfs = onefs_statvfs, + .get_real_filename = onefs_get_real_filename, }; NTSTATUS vfs_onefs_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "onefs", - onefs_ops); + &onefs_fns); } diff --git a/source3/modules/vfs_onefs_shadow_copy.c b/source3/modules/vfs_onefs_shadow_copy.c index 112ef30749..b8febdc426 100644 --- a/source3/modules/vfs_onefs_shadow_copy.c +++ b/source3/modules/vfs_onefs_shadow_copy.c @@ -651,111 +651,48 @@ onefs_shadow_copy_set_offline(struct vfs_handle_struct *handle, /* VFS operations structure */ -static vfs_op_tuple onefs_shadow_copy_ops[] = { - - /* Disk operations */ - - {SMB_VFS_OP(onefs_shadow_copy_disk_free), SMB_VFS_OP_DISK_FREE, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_get_shadow_copy_data), - SMB_VFS_OP_GET_SHADOW_COPY_DATA, SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(onefs_shadow_copy_statvfs), SMB_VFS_OP_STATVFS, - SMB_VFS_LAYER_TRANSPARENT}, - - /* Directory operations */ - - {SMB_VFS_OP(onefs_shadow_copy_opendir), SMB_VFS_OP_OPENDIR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_mkdir), SMB_VFS_OP_MKDIR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_rmdir), SMB_VFS_OP_RMDIR, - SMB_VFS_LAYER_TRANSPARENT}, - - /* File operations */ - - {SMB_VFS_OP(onefs_shadow_copy_open), SMB_VFS_OP_OPEN, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_create_file), SMB_VFS_OP_CREATE_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_rename), SMB_VFS_OP_RENAME, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_stat), SMB_VFS_OP_STAT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_stat), SMB_VFS_OP_STAT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_lstat), SMB_VFS_OP_LSTAT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_unlink), SMB_VFS_OP_UNLINK, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_chmod), SMB_VFS_OP_CHMOD, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_chown), SMB_VFS_OP_CHOWN, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_lchown), SMB_VFS_OP_LCHOWN, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_chdir), SMB_VFS_OP_CHDIR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_ntimes), SMB_VFS_OP_NTIMES, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_symlink), SMB_VFS_OP_SYMLINK, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_readlink), SMB_VFS_OP_READLINK, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_link), SMB_VFS_OP_LINK, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_mknod), SMB_VFS_OP_MKNOD, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_realpath), SMB_VFS_OP_REALPATH, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_chflags), SMB_VFS_OP_CHFLAGS, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_streaminfo), SMB_VFS_OP_STREAMINFO, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_get_real_filename), - SMB_VFS_OP_GET_REAL_FILENAME, SMB_VFS_LAYER_TRANSPARENT}, - - /* NT File ACL operations */ - - {SMB_VFS_OP(onefs_shadow_copy_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, - SMB_VFS_LAYER_TRANSPARENT}, - - /* POSIX ACL operations */ - - {SMB_VFS_OP(onefs_shadow_copy_chmod_acl), SMB_VFS_OP_CHMOD_ACL, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_sys_acl_get_file), - SMB_VFS_OP_SYS_ACL_GET_FILE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_sys_acl_set_file), - SMB_VFS_OP_SYS_ACL_SET_FILE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_sys_acl_delete_def_file), - SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, SMB_VFS_LAYER_TRANSPARENT}, - - /* EA operations. */ - - {SMB_VFS_OP(onefs_shadow_copy_getxattr), SMB_VFS_OP_GETXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_lgetxattr), SMB_VFS_OP_LGETXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_listxattr), SMB_VFS_OP_LISTXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_llistxattr), SMB_VFS_OP_LLISTXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_removexattr), SMB_VFS_OP_REMOVEXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_lremovexattr), SMB_VFS_OP_LREMOVEXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_setxattr), SMB_VFS_OP_SETXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_lsetxattr), SMB_VFS_OP_LSETXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - - /* offline operations */ - {SMB_VFS_OP(onefs_shadow_copy_is_offline), SMB_VFS_OP_IS_OFFLINE, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(onefs_shadow_copy_set_offline), SMB_VFS_OP_SET_OFFLINE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers onefs_shadow_copy_fns = { + .disk_free = onefs_shadow_copy_disk_free, + .get_shadow_copy_data = onefs_shadow_copy_get_shadow_copy_data, + .statvfs = onefs_shadow_copy_statvfs, + .opendir = onefs_shadow_copy_opendir, + .mkdir = onefs_shadow_copy_mkdir, + .rmdir = onefs_shadow_copy_rmdir, + .open = onefs_shadow_copy_open, + .create_file = onefs_shadow_copy_create_file, + .rename = onefs_shadow_copy_rename, + .stat = onefs_shadow_copy_stat, + .stat = onefs_shadow_copy_stat, + .lstat = onefs_shadow_copy_lstat, + .unlink = onefs_shadow_copy_unlink, + .chmod = onefs_shadow_copy_chmod, + .chown = onefs_shadow_copy_chown, + .lchown = onefs_shadow_copy_lchown, + .chdir = onefs_shadow_copy_chdir, + .ntimes = onefs_shadow_copy_ntimes, + .symlink = onefs_shadow_copy_symlink, + .readlink = onefs_shadow_copy_readlink, + .link = onefs_shadow_copy_link, + .mknod = onefs_shadow_copy_mknod, + .realpath = onefs_shadow_copy_realpath, + .chflags = onefs_shadow_copy_chflags, + .streaminfo = onefs_shadow_copy_streaminfo, + .get_real_filename = onefs_shadow_copy_get_real_filename, + .get_nt_acl = onefs_shadow_copy_get_nt_acl, + .chmod_acl = onefs_shadow_copy_chmod_acl, + .sys_acl_get_file = onefs_shadow_copy_sys_acl_get_file, + .sys_acl_set_file = onefs_shadow_copy_sys_acl_set_file, + .sys_acl_delete_def_file = onefs_shadow_copy_sys_acl_delete_def_file, + .getxattr = onefs_shadow_copy_getxattr, + .lgetxattr = onefs_shadow_copy_lgetxattr, + .listxattr = onefs_shadow_copy_listxattr, + .llistxattr = onefs_shadow_copy_llistxattr, + .removexattr = onefs_shadow_copy_removexattr, + .lremovexattr = onefs_shadow_copy_lremovexattr, + .setxattr = onefs_shadow_copy_setxattr, + .lsetxattr = onefs_shadow_copy_lsetxattr, + .is_offline = onefs_shadow_copy_is_offline, + .set_offline = onefs_shadow_copy_set_offline, }; NTSTATUS vfs_shadow_copy_init(void) @@ -764,7 +701,7 @@ NTSTATUS vfs_shadow_copy_init(void) ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "onefs_shadow_copy", - onefs_shadow_copy_ops); + &onefs_shadow_copy_fns); if (!NT_STATUS_IS_OK(ret)) return ret; diff --git a/source3/modules/vfs_posixacl.c b/source3/modules/vfs_posixacl.c index 21fb2ada31..9dd25a781e 100644 --- a/source3/modules/vfs_posixacl.c +++ b/source3/modules/vfs_posixacl.c @@ -361,36 +361,17 @@ static acl_t smb_acl_to_posix(const struct smb_acl_t *acl) /* VFS operations structure */ -static vfs_op_tuple posixacl_op_tuples[] = { - /* Disk operations */ - {SMB_VFS_OP(posixacl_sys_acl_get_file), - SMB_VFS_OP_SYS_ACL_GET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(posixacl_sys_acl_get_fd), - SMB_VFS_OP_SYS_ACL_GET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(posixacl_sys_acl_set_file), - SMB_VFS_OP_SYS_ACL_SET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(posixacl_sys_acl_set_fd), - SMB_VFS_OP_SYS_ACL_SET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(posixacl_sys_acl_delete_def_file), - SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), - SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers posixacl_fns = { + .sys_acl_get_file = posixacl_sys_acl_get_file, + .sys_acl_get_fd = posixacl_sys_acl_get_fd, + .sys_acl_set_file = posixacl_sys_acl_set_file, + .sys_acl_set_fd = posixacl_sys_acl_set_fd, + .sys_acl_delete_def_file = posixacl_sys_acl_delete_def_file, }; NTSTATUS vfs_posixacl_init(void); NTSTATUS vfs_posixacl_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "posixacl", - posixacl_op_tuples); + &posixacl_fns); } diff --git a/source3/modules/vfs_prealloc.c b/source3/modules/vfs_prealloc.c index 2f65e94ea7..4e6e5d9d47 100644 --- a/source3/modules/vfs_prealloc.c +++ b/source3/modules/vfs_prealloc.c @@ -206,16 +206,15 @@ static int prealloc_ftruncate(vfs_handle_struct * handle, return ret; } -static vfs_op_tuple prealloc_op_tuples[] = { - {SMB_VFS_OP(prealloc_open), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(prealloc_ftruncate), SMB_VFS_OP_FTRUNCATE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(prealloc_connect), SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_TRANSPARENT}, - {NULL, SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers prealloc_fns = { + .open = prealloc_open, + .ftruncate = prealloc_ftruncate, + .connect = prealloc_connect, }; NTSTATUS vfs_prealloc_init(void); NTSTATUS vfs_prealloc_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, - MODULE, prealloc_op_tuples); + MODULE, &prealloc_fns); } diff --git a/source3/modules/vfs_preopen.c b/source3/modules/vfs_preopen.c index dcc1ae18c1..e545901035 100644 --- a/source3/modules/vfs_preopen.c +++ b/source3/modules/vfs_preopen.c @@ -440,18 +440,13 @@ static int preopen_open(vfs_handle_struct *handle, return res; } -/* VFS operations structure */ - -static vfs_op_tuple preopen_ops[] = { - {SMB_VFS_OP(preopen_open), SMB_VFS_OP_OPEN, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_preopen_fns = { + .open = preopen_open }; NTSTATUS vfs_preopen_init(void); NTSTATUS vfs_preopen_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, - "preopen", preopen_ops); + "preopen", &vfs_preopen_fns); } diff --git a/source3/modules/vfs_readahead.c b/source3/modules/vfs_readahead.c index df75814b72..124230811d 100644 --- a/source3/modules/vfs_readahead.c +++ b/source3/modules/vfs_readahead.c @@ -155,18 +155,10 @@ static int readahead_connect(struct vfs_handle_struct *handle, return SMB_VFS_NEXT_CONNECT(handle, service, user); } -/******************************************************************* - Functions we're replacing. - We don't replace read as it isn't used from smbd to read file - data. -*******************************************************************/ - -static vfs_op_tuple readahead_ops [] = -{ - {SMB_VFS_OP(readahead_sendfile), SMB_VFS_OP_SENDFILE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(readahead_pread), SMB_VFS_OP_PREAD, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(readahead_connect), SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_readahead_fns = { + .sendfile = readahead_sendfile, + .pread = readahead_pread, + .connect_fn = readahead_connect }; /******************************************************************* @@ -176,5 +168,6 @@ static vfs_op_tuple readahead_ops [] = NTSTATUS vfs_readahead_init(void); NTSTATUS vfs_readahead_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "readahead", readahead_ops); + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "readahead", + &vfs_readahead_fns); } diff --git a/source3/modules/vfs_readonly.c b/source3/modules/vfs_readonly.c index 58c83e5e1b..f736028168 100644 --- a/source3/modules/vfs_readonly.c +++ b/source3/modules/vfs_readonly.c @@ -95,16 +95,13 @@ static int readonly_connect(vfs_handle_struct *handle, } -/* VFS operations structure */ - -static vfs_op_tuple readonly_op_tuples[] = { - /* Disk operations */ - {SMB_VFS_OP(readonly_connect), SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_readonly_fns = { + .connect_fn = readonly_connect }; NTSTATUS vfs_readonly_init(void); NTSTATUS vfs_readonly_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, MODULE_NAME, readonly_op_tuples); + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, MODULE_NAME, + &vfs_readonly_fns); } diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c index 771189ca73..0c019dbd70 100644 --- a/source3/modules/vfs_recycle.c +++ b/source3/modules/vfs_recycle.c @@ -36,18 +36,6 @@ static void recycle_disconnect(vfs_handle_struct *handle); static int recycle_unlink(vfs_handle_struct *handle, const struct smb_filename *smb_fname); -static vfs_op_tuple recycle_ops[] = { - - /* Disk operations */ - {SMB_VFS_OP(recycle_connect), SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(recycle_disconnect), SMB_VFS_OP_DISCONNECT, SMB_VFS_LAYER_TRANSPARENT}, - - /* File operations */ - {SMB_VFS_OP(recycle_unlink), SMB_VFS_OP_UNLINK, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} -}; - static int recycle_connect(vfs_handle_struct *handle, const char *service, const char *user) { DEBUG(10,("recycle_connect() connect to service[%s] as user[%s].\n", @@ -665,10 +653,17 @@ done: return rc; } +static struct vfs_fn_pointers vfs_recycle_fns = { + .connect_fn = recycle_connect, + .disconnect = recycle_disconnect, + .unlink = recycle_unlink +}; + NTSTATUS vfs_recycle_init(void); NTSTATUS vfs_recycle_init(void) { - NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "recycle", recycle_ops); + NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "recycle", + &vfs_recycle_fns); if (!NT_STATUS_IS_OK(ret)) return ret; diff --git a/source3/modules/vfs_shadow_copy.c b/source3/modules/vfs_shadow_copy.c index 4f5cedb3d4..6bad1686d9 100644 --- a/source3/modules/vfs_shadow_copy.c +++ b/source3/modules/vfs_shadow_copy.c @@ -118,7 +118,9 @@ static SMB_STRUCT_DIR *shadow_copy_opendir(vfs_handle_struct *handle, const char return((SMB_STRUCT_DIR *)dirp); } -static SMB_STRUCT_DIRENT *shadow_copy_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *_dirp) +static SMB_STRUCT_DIRENT *shadow_copy_readdir(vfs_handle_struct *handle, + SMB_STRUCT_DIR *_dirp, + SMB_STRUCT_STAT *sbuf) { shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp; @@ -212,25 +214,21 @@ static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle, files_str return 0; } -/* VFS operations structure */ - -static vfs_op_tuple shadow_copy_ops[] = { - {SMB_VFS_OP(shadow_copy_opendir), SMB_VFS_OP_OPENDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy_readdir), SMB_VFS_OP_READDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy_seekdir), SMB_VFS_OP_SEEKDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy_telldir), SMB_VFS_OP_TELLDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy_rewinddir), SMB_VFS_OP_REWINDDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy_closedir), SMB_VFS_OP_CLOSEDIR, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(shadow_copy_get_shadow_copy_data), SMB_VFS_OP_GET_SHADOW_COPY_DATA,SMB_VFS_LAYER_OPAQUE}, - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_shadow_copy_fns = { + .opendir = shadow_copy_opendir, + .readdir = shadow_copy_readdir, + .seekdir = shadow_copy_seekdir, + .telldir = shadow_copy_telldir, + .rewind_dir = shadow_copy_rewinddir, + .closedir = shadow_copy_closedir, + .get_shadow_copy_data = shadow_copy_get_shadow_copy_data, }; NTSTATUS vfs_shadow_copy_init(void); NTSTATUS vfs_shadow_copy_init(void) { - NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "shadow_copy", shadow_copy_ops); + NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, + "shadow_copy", &vfs_shadow_copy_fns); if (!NT_STATUS_IS_OK(ret)) return ret; diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 7c338e7268..5efae3b0ed 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -600,11 +600,6 @@ static int shadow_copy2_lsetxattr(struct vfs_handle_struct *handle, const char * static int shadow_copy2_chmod_acl(vfs_handle_struct *handle, const char *fname, mode_t mode) { - /* If the underlying VFS doesn't have ACL support... */ - if (!handle->vfs_next.ops.chmod_acl) { - errno = ENOSYS; - return -1; - } SHADOW2_NEXT(CHMOD_ACL, (handle, name, mode), int, -1); } @@ -674,54 +669,37 @@ static int shadow_copy2_get_shadow_copy2_data(vfs_handle_struct *handle, return 0; } -/* VFS operations structure */ - -static vfs_op_tuple shadow_copy2_ops[] = { - {SMB_VFS_OP(shadow_copy2_opendir), SMB_VFS_OP_OPENDIR, SMB_VFS_LAYER_TRANSPARENT}, - - /* directory operations */ - {SMB_VFS_OP(shadow_copy2_mkdir), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_rmdir), SMB_VFS_OP_RMDIR, SMB_VFS_LAYER_TRANSPARENT}, - - /* xattr and flags operations */ - {SMB_VFS_OP(shadow_copy2_chflags), SMB_VFS_OP_CHFLAGS, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_getxattr), SMB_VFS_OP_GETXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_lgetxattr), SMB_VFS_OP_LGETXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_listxattr), SMB_VFS_OP_LISTXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_removexattr), SMB_VFS_OP_REMOVEXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_lremovexattr),SMB_VFS_OP_LREMOVEXATTR,SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_setxattr), SMB_VFS_OP_SETXATTR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_lsetxattr), SMB_VFS_OP_LSETXATTR, SMB_VFS_LAYER_TRANSPARENT}, - - /* File operations */ - {SMB_VFS_OP(shadow_copy2_open), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_stat), SMB_VFS_OP_STAT, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_lstat), SMB_VFS_OP_LSTAT, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_fstat), SMB_VFS_OP_FSTAT, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_unlink), SMB_VFS_OP_UNLINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_chmod), SMB_VFS_OP_CHMOD, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_chown), SMB_VFS_OP_CHOWN, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_chdir), SMB_VFS_OP_CHDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_ntimes), SMB_VFS_OP_NTIMES, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_symlink), SMB_VFS_OP_SYMLINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_readlink), SMB_VFS_OP_READLINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_link), SMB_VFS_OP_LINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_mknod), SMB_VFS_OP_MKNOD, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_realpath), SMB_VFS_OP_REALPATH, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(shadow_copy2_connectpath), SMB_VFS_OP_CONNECTPATH, SMB_VFS_LAYER_OPAQUE}, - - /* NT File ACL operations */ - {SMB_VFS_OP(shadow_copy2_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, - - /* POSIX ACL operations */ - {SMB_VFS_OP(shadow_copy2_chmod_acl), SMB_VFS_OP_CHMOD_ACL, SMB_VFS_LAYER_TRANSPARENT}, - - /* special shadown copy op */ - {SMB_VFS_OP(shadow_copy2_get_shadow_copy2_data), - SMB_VFS_OP_GET_SHADOW_COPY_DATA,SMB_VFS_LAYER_OPAQUE}, - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_shadow_copy2_fns = { + .opendir = shadow_copy2_opendir, + .mkdir = shadow_copy2_mkdir, + .rmdir = shadow_copy2_rmdir, + .chflags = shadow_copy2_chflags, + .getxattr = shadow_copy2_getxattr, + .lgetxattr = shadow_copy2_lgetxattr, + .listxattr = shadow_copy2_listxattr, + .removexattr = shadow_copy2_removexattr, + .lremovexattr = shadow_copy2_lremovexattr, + .setxattr = shadow_copy2_setxattr, + .lsetxattr = shadow_copy2_lsetxattr, + .open = shadow_copy2_open, + .rename = shadow_copy2_rename, + .stat = shadow_copy2_stat, + .lstat = shadow_copy2_lstat, + .fstat = shadow_copy2_fstat, + .unlink = shadow_copy2_unlink, + .chmod = shadow_copy2_chmod, + .chown = shadow_copy2_chown, + .chdir = shadow_copy2_chdir, + .ntimes = shadow_copy2_ntimes, + .symlink = shadow_copy2_symlink, + .vfs_readlink = shadow_copy2_readlink, + .link = shadow_copy2_link, + .mknod = shadow_copy2_mknod, + .realpath = shadow_copy2_realpath, + .connectpath = shadow_copy2_connectpath, + .get_nt_acl = shadow_copy2_get_nt_acl, + .chmod_acl = shadow_copy2_chmod_acl, + .get_shadow_copy_data = shadow_copy2_get_shadow_copy2_data, }; NTSTATUS vfs_shadow_copy2_init(void); @@ -729,7 +707,8 @@ NTSTATUS vfs_shadow_copy2_init(void) { NTSTATUS ret; - ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "shadow_copy2", shadow_copy2_ops); + ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "shadow_copy2", + &vfs_shadow_copy2_fns); if (!NT_STATUS_IS_OK(ret)) return ret; diff --git a/source3/modules/vfs_smb_traffic_analyzer.c b/source3/modules/vfs_smb_traffic_analyzer.c index 6f7aee0e50..08389f5d90 100644 --- a/source3/modules/vfs_smb_traffic_analyzer.c +++ b/source3/modules/vfs_smb_traffic_analyzer.c @@ -397,29 +397,21 @@ static ssize_t smb_traffic_analyzer_pwrite(vfs_handle_struct *handle, \ return result; } -/* VFS operations we use */ - -static vfs_op_tuple smb_traffic_analyzer_tuples[] = { - - {SMB_VFS_OP(smb_traffic_analyzer_connect), SMB_VFS_OP_CONNECT, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_traffic_analyzer_read), SMB_VFS_OP_READ, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_traffic_analyzer_pread), SMB_VFS_OP_PREAD, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_traffic_analyzer_write), SMB_VFS_OP_WRITE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_traffic_analyzer_pwrite), SMB_VFS_OP_PWRITE, - SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(NULL),SMB_VFS_OP_NOOP,SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_smb_traffic_analyzer_fns = { + .connect_fn = smb_traffic_analyzer_connect, + .vfs_read = smb_traffic_analyzer_read, + .pread = smb_traffic_analyzer_pread, + .write = smb_traffic_analyzer_write, + .pwrite = smb_traffic_analyzer_pwrite, }; /* Module initialization */ NTSTATUS vfs_smb_traffic_analyzer_init(void) { - NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, \ - "smb_traffic_analyzer", smb_traffic_analyzer_tuples); + NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, + "smb_traffic_analyzer", + &vfs_smb_traffic_analyzer_fns); if (!NT_STATUS_IS_OK(ret)) { return ret; diff --git a/source3/modules/vfs_solarisacl.c b/source3/modules/vfs_solarisacl.c index dabb35c0c0..6a174807b6 100644 --- a/source3/modules/vfs_solarisacl.c +++ b/source3/modules/vfs_solarisacl.c @@ -749,40 +749,19 @@ static bool solaris_acl_check(SOLARIS_ACL_T solaris_acl, int count) } #endif -/* VFS operations structure */ - -static vfs_op_tuple solarisacl_op_tuples[] = { - /* Disk operations */ - {SMB_VFS_OP(solarisacl_sys_acl_get_file), - SMB_VFS_OP_SYS_ACL_GET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(solarisacl_sys_acl_get_fd), - SMB_VFS_OP_SYS_ACL_GET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(solarisacl_sys_acl_set_file), - SMB_VFS_OP_SYS_ACL_SET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(solarisacl_sys_acl_set_fd), - SMB_VFS_OP_SYS_ACL_SET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(solarisacl_sys_acl_delete_def_file), - SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), - SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers solarisacls_fns = { + .sys_acl_get_file = solarisacl_sys_acl_get_file, + .sys_acl_get_fd = solarisacl_sys_acl_get_fd, + .sys_acl_set_file = solarisacl_sys_acl_set_file, + .sys_acl_set_fd = solarisacl_sys_acl_set_fd, + .sys_acl_delete_def_file = solarisacl_sys_acl_delete_def_file, }; NTSTATUS vfs_solarisacl_init(void); NTSTATUS vfs_solarisacl_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "solarisacl", - solarisacl_op_tuples); + &solarisacl_fns); } /* ENTE */ diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c index ba3b180244..2581c7fd5b 100644 --- a/source3/modules/vfs_streams_depot.c +++ b/source3/modules/vfs_streams_depot.c @@ -880,29 +880,19 @@ static uint32_t streams_depot_fs_capabilities(struct vfs_handle_struct *handle) return SMB_VFS_NEXT_FS_CAPABILITIES(handle) | FILE_NAMED_STREAMS; } -/* VFS operations structure */ - -static vfs_op_tuple streams_depot_ops[] = { - {SMB_VFS_OP(streams_depot_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_depot_open), SMB_VFS_OP_OPEN, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_depot_stat), SMB_VFS_OP_STAT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_depot_lstat), SMB_VFS_OP_LSTAT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_depot_unlink), SMB_VFS_OP_UNLINK, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_depot_rename), SMB_VFS_OP_RENAME, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_depot_streaminfo), SMB_VFS_OP_STREAMINFO, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_streams_depot_fns = { + .fs_capabilities = streams_depot_fs_capabilities, + .open = streams_depot_open, + .stat = streams_depot_stat, + .lstat = streams_depot_lstat, + .unlink = streams_depot_unlink, + .rename = streams_depot_rename, + .streaminfo = streams_depot_streaminfo, }; NTSTATUS vfs_streams_depot_init(void); NTSTATUS vfs_streams_depot_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "streams_depot", - streams_depot_ops); + &vfs_streams_depot_fns); } diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index c32c4f3190..3ec38d6cc0 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -1011,37 +1011,23 @@ static int streams_xattr_ftruncate(struct vfs_handle_struct *handle, return 0; } -/* VFS operations structure */ - -static vfs_op_tuple streams_xattr_ops[] = { - {SMB_VFS_OP(streams_xattr_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_xattr_open), SMB_VFS_OP_OPEN, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_xattr_stat), SMB_VFS_OP_STAT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_xattr_fstat), SMB_VFS_OP_FSTAT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_xattr_lstat), SMB_VFS_OP_LSTAT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_xattr_pread), SMB_VFS_OP_PREAD, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_xattr_pwrite), SMB_VFS_OP_PWRITE, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_xattr_unlink), SMB_VFS_OP_UNLINK, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_xattr_rename), SMB_VFS_OP_RENAME, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_xattr_ftruncate), SMB_VFS_OP_FTRUNCATE, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(streams_xattr_streaminfo), SMB_VFS_OP_STREAMINFO, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_streams_xattr_fns = { + .fs_capabilities = streams_xattr_fs_capabilities, + .open = streams_xattr_open, + .stat = streams_xattr_stat, + .fstat = streams_xattr_fstat, + .lstat = streams_xattr_lstat, + .pread = streams_xattr_pread, + .pwrite = streams_xattr_pwrite, + .unlink = streams_xattr_unlink, + .rename = streams_xattr_rename, + .ftruncate = streams_xattr_ftruncate, + .streaminfo = streams_xattr_streaminfo, }; NTSTATUS vfs_streams_xattr_init(void); NTSTATUS vfs_streams_xattr_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "streams_xattr", - streams_xattr_ops); + &vfs_streams_xattr_fns); } diff --git a/source3/modules/vfs_syncops.c b/source3/modules/vfs_syncops.c index 91345e1cad..c098159ff6 100644 --- a/source3/modules/vfs_syncops.c +++ b/source3/modules/vfs_syncops.c @@ -200,30 +200,24 @@ static int syncops_close(vfs_handle_struct *handle, files_struct *fsp) } -/* VFS operations structure */ - -static vfs_op_tuple syncops_ops[] = { - /* directory operations */ - {SMB_VFS_OP(syncops_mkdir), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(syncops_rmdir), SMB_VFS_OP_RMDIR, SMB_VFS_LAYER_TRANSPARENT}, - - /* File operations */ - {SMB_VFS_OP(syncops_open), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(syncops_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(syncops_unlink), SMB_VFS_OP_UNLINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(syncops_symlink), SMB_VFS_OP_SYMLINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(syncops_link), SMB_VFS_OP_LINK, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(syncops_mknod), SMB_VFS_OP_MKNOD, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(syncops_close), SMB_VFS_OP_CLOSE, SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_syncops_fns = { + .mkdir = syncops_mkdir, + .rmdir = syncops_rmdir, + .open = syncops_open, + .rename = syncops_rename, + .unlink = syncops_unlink, + .symlink = syncops_symlink, + .link = syncops_link, + .mknod = syncops_mknod, + .close_fn = syncops_close, }; NTSTATUS vfs_syncops_init(void) { NTSTATUS ret; - ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "syncops", syncops_ops); + ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "syncops", + &vfs_syncops_fns); if (!NT_STATUS_IS_OK(ret)) return ret; diff --git a/source3/modules/vfs_tru64acl.c b/source3/modules/vfs_tru64acl.c index b23a7ddcfa..a978868444 100644 --- a/source3/modules/vfs_tru64acl.c +++ b/source3/modules/vfs_tru64acl.c @@ -466,38 +466,19 @@ static SMB_ACL_PERM_T tru64_permset_to_smb(const acl_perm_t tru64_permset) /* VFS operations structure */ -static vfs_op_tuple tru64acl_op_tuples[] = { - /* Disk operations */ - {SMB_VFS_OP(tru64acl_sys_acl_get_file), - SMB_VFS_OP_SYS_ACL_GET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(tru64acl_sys_acl_get_fd), - SMB_VFS_OP_SYS_ACL_GET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(tru64acl_sys_acl_set_file), - SMB_VFS_OP_SYS_ACL_SET_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(tru64acl_sys_acl_set_fd), - SMB_VFS_OP_SYS_ACL_SET_FD, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(tru64acl_sys_acl_delete_def_file), - SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, - SMB_VFS_LAYER_TRANSPARENT}, - - {SMB_VFS_OP(NULL), - SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers tru64acl_fns = { + .sys_acl_get_file = tru64acl_sys_acl_get_file, + .sys_acl_get_fd = tru64acl_sys_acl_get_fd, + .sys_acl_set_file = tru64acl_sys_acl_set_file, + .sys_acl_set_fd = tru64acl_sys_acl_set_fd, + .sys_acl_delete_def_file = tru64acl_sys_acl_delete_def_file, }; NTSTATUS vfs_tru64acl_init(void); NTSTATUS vfs_tru64acl_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "tru64acl", - tru64acl_op_tuples); + &tru64acl_fns); } /* ENTE */ diff --git a/source3/modules/vfs_tsmsm.c b/source3/modules/vfs_tsmsm.c index 753b2bcd26..e8ae7a29b8 100644 --- a/source3/modules/vfs_tsmsm.c +++ b/source3/modules/vfs_tsmsm.c @@ -362,38 +362,21 @@ static uint32_t tsmsm_fs_capabilities(struct vfs_handle_struct *handle) return SMB_VFS_NEXT_FS_CAPABILITIES(handle) | FILE_SUPPORTS_REMOTE_STORAGE | FILE_SUPPORTS_REPARSE_POINTS; } -static vfs_op_tuple vfs_tsmsm_ops[] = { - - /* Disk operations */ - - {SMB_VFS_OP(tsmsm_connect), SMB_VFS_OP_CONNECT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(tsmsm_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(tsmsm_aio_force), SMB_VFS_OP_AIO_FORCE, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(tsmsm_aio_return), SMB_VFS_OP_AIO_RETURN, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(tsmsm_pread), SMB_VFS_OP_PREAD, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(tsmsm_pwrite), SMB_VFS_OP_PWRITE, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(tsmsm_sendfile), SMB_VFS_OP_SENDFILE, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(tsmsm_is_offline), SMB_VFS_OP_IS_OFFLINE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(tsmsm_set_offline), SMB_VFS_OP_SET_OFFLINE, - SMB_VFS_LAYER_OPAQUE}, - - /* Finish VFS operations definition */ - - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, - SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers tsmsm_fns = { + .connect = tsmsm_connect, + .fs_capabilities = tsmsm_fs_capabilities, + .aio_force = tsmsm_aio_force, + .aio_return = tsmsm_aio_return, + .pread = tsmsm_pread, + .pwrite = tsmsm_pwrite, + .sendfile = tsmsm_sendfile, + .is_offline = tsmsm_is_offline, + .set_offline = tsmsm_set_offline, }; NTSTATUS vfs_tsmsm_init(void); NTSTATUS vfs_tsmsm_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, - "tsmsm", vfs_tsmsm_ops); + "tsmsm", &vfs_fns); } diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c index e805fbcb2c..a058c824e7 100644 --- a/source3/modules/vfs_xattr_tdb.c +++ b/source3/modules/vfs_xattr_tdb.c @@ -741,37 +741,23 @@ static int xattr_tdb_connect(vfs_handle_struct *handle, const char *service, return 0; } -/* VFS operations structure */ - -static const vfs_op_tuple xattr_tdb_ops[] = { - {SMB_VFS_OP(xattr_tdb_getxattr), SMB_VFS_OP_GETXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(xattr_tdb_fgetxattr), SMB_VFS_OP_FGETXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(xattr_tdb_setxattr), SMB_VFS_OP_SETXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(xattr_tdb_fsetxattr), SMB_VFS_OP_FSETXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(xattr_tdb_listxattr), SMB_VFS_OP_LISTXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(xattr_tdb_flistxattr), SMB_VFS_OP_FLISTXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(xattr_tdb_removexattr), SMB_VFS_OP_REMOVEXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(xattr_tdb_fremovexattr), SMB_VFS_OP_FREMOVEXATTR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(xattr_tdb_unlink), SMB_VFS_OP_UNLINK, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(xattr_tdb_rmdir), SMB_VFS_OP_RMDIR, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(xattr_tdb_connect), SMB_VFS_OP_CONNECT, - SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers vfs_xattr_tdb_fns = { + .getxattr = xattr_tdb_getxattr, + .fgetxattr = xattr_tdb_fgetxattr, + .setxattr = xattr_tdb_setxattr, + .fsetxattr = xattr_tdb_fsetxattr, + .listxattr = xattr_tdb_listxattr, + .flistxattr = xattr_tdb_flistxattr, + .removexattr = xattr_tdb_removexattr, + .fremovexattr = xattr_tdb_fremovexattr, + .unlink = xattr_tdb_unlink, + .rmdir = xattr_tdb_rmdir, + .connect_fn = xattr_tdb_connect, }; NTSTATUS vfs_xattr_tdb_init(void); NTSTATUS vfs_xattr_tdb_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "xattr_tdb", - xattr_tdb_ops); + &vfs_xattr_tdb_fns); } diff --git a/source3/modules/vfs_zfsacl.c b/source3/modules/vfs_zfsacl.c index a92d5dae26..312160c026 100644 --- a/source3/modules/vfs_zfsacl.c +++ b/source3/modules/vfs_zfsacl.c @@ -280,37 +280,20 @@ int zfsacl_fail__sys_acl_delete_def_file(vfs_handle_struct *handle, /* VFS operations structure */ -static vfs_op_tuple zfsacl_ops[] = { - /* invalidate conflicting VFS methods */ - {SMB_VFS_OP(zfsacl_fail__sys_acl_get_file), - SMB_VFS_OP_SYS_ACL_GET_FILE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(zfsacl_fail__sys_acl_get_fd), - SMB_VFS_OP_SYS_ACL_GET_FD, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(zfsacl_fail__sys_acl_set_file), - SMB_VFS_OP_SYS_ACL_SET_FILE, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(zfsacl_fail__sys_acl_set_fd), - SMB_VFS_OP_SYS_ACL_SET_FD, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(zfsacl_fail__sys_acl_delete_def_file), - SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, - SMB_VFS_LAYER_OPAQUE}, - - /* actual methods */ - {SMB_VFS_OP(zfsacl_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(zfsacl_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(zfsacl_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, - SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +static struct vfs_fn_pointers zfsacl_fns = { + .sys_acl_get_file = zfsacl_fail__sys_acl_get_file, + .sys_acl_get_fd = zfsacl_fail__sys_acl_get_fd, + .sys_acl_set_file = zfsacl_fail__sys_acl_set_file, + .sys_acl_set_fd = zfsacl_fail__sys_acl_set_fd, + .sys_acl_delete_def_file = zfsacl_fail__sys_acl_delete_def_file, + .fget_nt_acl = zfsacl_fget_nt_acl, + .get_nt_acl = zfsacl_get_nt_acl, + .fset_nt_acl = zfsacl_fset_nt_acl, }; NTSTATUS vfs_zfsacl_init(void); NTSTATUS vfs_zfsacl_init(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "zfsacl", - zfsacl_ops); + &zfsacl_fns); } -- cgit