From bee3d8f410703a4eabdfe1d40b05425637ee14df Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Wed, 4 Jun 2003 13:13:41 +0000 Subject: Move VFS example skel.c to two different examples: one for opaque operations and one for transparent. Also add configure support for compiling third-party modules. Patch from Stefan Metzmacher (This used to be commit fcdf215753630d4173e50b7d93d6bc8ba254a5ff) --- examples/VFS/skel_transparent.c | 458 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 458 insertions(+) create mode 100644 examples/VFS/skel_transparent.c (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c new file mode 100644 index 0000000000..3a967470a8 --- /dev/null +++ b/examples/VFS/skel_transparent.c @@ -0,0 +1,458 @@ +/* + * Skeleton VFS module. Implements passthrough operation of all VFS + * calls to disk functions. + * + * Copyright (C) Tim Potter, 1999-2000 + * Copyright (C) Alexander Bokovoy, 2002 + * Copyright (C) Stefan (metze) Metzmacher, 2003 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include "includes.h" + +/* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE + SAMBA DEVELOPERS GUIDE!!!!!! + */ + +/* If you take this file as template for your module + * please make sure that you remove all functions you didn't + * want to implement!! + * + * This passthrough operations are useless in reall vfs modules! + * + * --metze + */ + +static int skel_connect(vfs_handle_struct *handle, connection_struct *conn, const char *service, const char *user) +{ + return SMB_VFS_NEXT_CONNECT(handle, conn, service, user); +} + +static void skel_disconnect(vfs_handle_struct *handle, connection_struct *conn) +{ + SMB_VFS_NEXT_DISCONNECT(handle, conn); +} + +static SMB_BIG_UINT skel_disk_free(vfs_handle_struct *handle, connection_struct *conn, const char *path, + BOOL small_query, SMB_BIG_UINT *bsize, + SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize) +{ + return SMB_VFS_NEXT_DISK_FREE(handle, conn, path, small_query, bsize, + dfree, dsize); +} + +static int skel_get_quota(vfs_handle_struct *handle, connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq) +{ + return SMB_VFS_NEXT_GET_QUOTA(handle, conn, qtype, id, dq); +} + +static int skel_set_quota(vfs_handle_struct *handle, connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq) +{ + return SMB_VFS_NEXT_SET_QUOTA(handle, conn, qtype, id, dq); +} + +static DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname) +{ + return SMB_VFS_NEXT_OPENDIR(handle, conn, fname); +} + +static struct dirent *skel_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) +{ + return SMB_VFS_NEXT_READDIR(handle, conn, dirp); +} + +static int skel_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode) +{ + return SMB_VFS_NEXT_MKDIR(handle, conn, path, mode); +} + +static int skel_rmdir(vfs_handle_struct *handle, connection_struct *conn, const char *path) +{ + return SMB_VFS_NEXT_RMDIR(handle, conn, path); +} + +static int skel_closedir(vfs_handle_struct *handle, connection_struct *conn, DIR *dir) +{ + return SMB_VFS_NEXT_CLOSEDIR(handle, conn, dir); +} + +static int skel_open(vfs_handle_struct *handle, connection_struct *conn, const char *fname, int flags, mode_t mode) +{ + return SMB_VFS_NEXT_OPEN(handle, conn, fname, flags, mode); +} + +static int skel_close(vfs_handle_struct *handle, files_struct *fsp, int fd) +{ + return SMB_VFS_NEXT_CLOSE(handle, fsp, fd); +} + +static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n) +{ + return SMB_VFS_NEXT_READ(handle, fsp, fd, data, n); +} + +static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n) +{ + return SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n); +} + +static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence) +{ + return SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence); +} + +static int skel_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new) +{ + return SMB_VFS_NEXT_RENAME(handle, conn, old, new); +} + +static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) +{ + return SMB_VFS_NEXT_FSYNC(handle, fsp, fd); +} + +static int skel_stat(vfs_handle_struct *handle, connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sbuf) +{ + return SMB_VFS_NEXT_STAT(handle, conn, fname, sbuf); +} + +static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf) +{ + return SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf); +} + +static int skel_lstat(vfs_handle_struct *handle, connection_struct *conn, const char *path, SMB_STRUCT_STAT *sbuf) +{ + return SMB_VFS_NEXT_LSTAT(handle, conn, path, sbuf); +} + +static int skel_unlink(vfs_handle_struct *handle, connection_struct *conn, const char *path) +{ + return SMB_VFS_NEXT_UNLINK(handle, conn, path); +} + +static int skel_chmod(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode) +{ + return SMB_VFS_NEXT_CHMOD(handle, conn, path, mode); +} + +static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode) +{ + return SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode); +} + +static int skel_chown(vfs_handle_struct *handle, connection_struct *conn, const char *path, uid_t uid, gid_t gid) +{ + return SMB_VFS_NEXT_CHOWN(handle, conn, path, uid, gid); +} + +static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid) +{ + return SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid); +} + +static int skel_chdir(vfs_handle_struct *handle, connection_struct *conn, const char *path) +{ + return SMB_VFS_NEXT_CHDIR(handle, conn, path); +} + +static char *skel_getwd(vfs_handle_struct *handle, connection_struct *conn, char *buf) +{ + return SMB_VFS_NEXT_GETWD(handle, conn, buf); +} + +static int skel_utime(vfs_handle_struct *handle, connection_struct *conn, const char *path, struct utimbuf *times) +{ + return SMB_VFS_NEXT_UTIME(handle, conn, path, times); +} + +static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T offset) +{ + return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, offset); +} + +static BOOL skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) +{ + return SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type); +} + +static BOOL skel_symlink(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath) +{ + return SMB_VFS_NEXT_SYMLINK(handle, conn, oldpath, newpath); +} + +static BOOL skel_readlink(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *buf, size_t bufsiz) +{ + return SMB_VFS_NEXT_READLINK(handle, conn, path, buf, bufsiz); +} + +static int skel_link(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath) +{ + return SMB_VFS_NEXT_LINK(handle, conn, oldpath, newpath); +} + +static int skel_mknod(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode, SMB_DEV_T dev) +{ + return SMB_VFS_NEXT_MKNOD(handle, conn, path, mode, dev); +} + +static char *skel_realpath(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *resolved_path) +{ + return SMB_VFS_NEXT_REALPATH(handle, conn, path, resolved_path); +} + +static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, struct security_descriptor_info **ppdesc) +{ + return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, fd, security_info, ppdesc); +} + +static size_t skel_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, struct security_descriptor_info **ppdesc) +{ + return SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, ppdesc); +} + +static BOOL skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, struct security_descriptor_info *psd) +{ + return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, fd, security_info_sent, psd); +} + +static BOOL skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, struct security_descriptor_info *psd) +{ + return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, psd); +} + +static int skel_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, const char *name, mode_t mode) +{ + /* If the underlying VFS doesn't have ACL support... */ + if (!handle->vfs_next.ops.chmod_acl) { + errno = ENOSYS; + return -1; + } + return SMB_VFS_NEXT_CHMOD_ACL(handle, conn, name, mode); +} + +static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode) +{ + /* If the underlying VFS doesn't have ACL support... */ + if (!handle->vfs_next.ops.fchmod_acl) { + errno = ENOSYS; + return -1; + } + return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode); +} + +static int skel_sys_acl_get_entry(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p) +{ + return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, conn, theacl, entry_id, entry_p); +} + +static int skel_sys_acl_get_tag_type(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p) +{ + return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, conn, entry_d, tag_type_p); +} + +static int skel_sys_acl_get_permset(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p) +{ + return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, conn, entry_d, permset_p); +} + +static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d) +{ + return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, conn, entry_d); +} + +static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, connection_struct *conn, const char *path_p, SMB_ACL_TYPE_T type) +{ + return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, conn, path_p, type); +} + +static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, int fd) +{ + return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, fd); +} + +static int skel_sys_acl_clear_perms(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset) +{ + return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, conn, permset); +} + +static int skel_sys_acl_add_perm(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) +{ + return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, conn, permset, perm); +} + +static char *skel_sys_acl_to_text(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl, ssize_t *plen) +{ + return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, conn, theacl, plen); +} + +static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle, connection_struct *conn, int count) +{ + return SMB_VFS_NEXT_SYS_ACL_INIT(handle, conn, count); +} + +static int skel_sys_acl_create_entry(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry) +{ + return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, conn, pacl, pentry); +} + +static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype) +{ + return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, conn, entry, tagtype); +} + +static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, void *qual) +{ + return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, conn, entry, qual); +} + +static int skel_sys_acl_set_permset(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset) +{ + return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, conn, entry, permset); +} + +static int skel_sys_acl_valid(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl ) +{ + return SMB_VFS_NEXT_SYS_ACL_VALID(handle, conn, theacl); +} + +static int skel_sys_acl_set_file(vfs_handle_struct *handle, connection_struct *conn, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) +{ + return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, conn, name, acltype, theacl); +} + +static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ACL_T theacl) +{ + return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl); +} + +static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, connection_struct *conn, const char *path) +{ + return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, conn, path); +} + +static int skel_sys_acl_get_perm(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) +{ + return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, conn, permset, perm); +} + +static int skel_sys_acl_free_text(vfs_handle_struct *handle, connection_struct *conn, char *text) +{ + return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, conn, text); +} + +static int skel_sys_acl_free_acl(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T posix_acl) +{ + return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, conn, posix_acl); +} + +static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle, connection_struct *conn, void *qualifier, SMB_ACL_TAG_T tagtype) +{ + return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, conn, qualifier, tagtype); +} + + +/* VFS operations structure */ + +static vfs_op_tuple skel_op_tuples[] = { + + /* Disk operations */ + + {SMB_VFS_OP(skel_connect), SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_disconnect), SMB_VFS_OP_DISCONNECT, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_disk_free), SMB_VFS_OP_DISK_FREE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_get_quota), SMB_VFS_OP_GET_QUOTA, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_set_quota), SMB_VFS_OP_SET_QUOTA, SMB_VFS_LAYER_TRANSPARENT}, + + /* Directory operations */ + + {SMB_VFS_OP(skel_opendir), SMB_VFS_OP_OPENDIR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_readdir), SMB_VFS_OP_READDIR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_mkdir), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_rmdir), SMB_VFS_OP_RMDIR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_closedir), SMB_VFS_OP_CLOSEDIR, SMB_VFS_LAYER_TRANSPARENT}, + + /* File operations */ + + {SMB_VFS_OP(skel_open), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_close), SMB_VFS_OP_CLOSE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_read), SMB_VFS_OP_READ, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_write), SMB_VFS_OP_WRITE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_lseek), SMB_VFS_OP_LSEEK, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_fsync), SMB_VFS_OP_FSYNC, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_stat), SMB_VFS_OP_STAT, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_fstat), SMB_VFS_OP_FSTAT, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_lstat), SMB_VFS_OP_LSTAT, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_unlink), SMB_VFS_OP_UNLINK, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_chmod), SMB_VFS_OP_CHMOD, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_fchmod), SMB_VFS_OP_FCHMOD, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_chown), SMB_VFS_OP_CHOWN, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_fchown), SMB_VFS_OP_FCHOWN, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_chdir), SMB_VFS_OP_CHDIR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_getwd), SMB_VFS_OP_GETWD, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_utime), SMB_VFS_OP_UTIME, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_ftruncate), SMB_VFS_OP_FTRUNCATE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_lock), SMB_VFS_OP_LOCK, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_symlink), SMB_VFS_OP_SYMLINK, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_readlink), SMB_VFS_OP_READLINK, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_link), SMB_VFS_OP_LINK, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_mknod), SMB_VFS_OP_MKNOD, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_realpath), SMB_VFS_OP_REALPATH, SMB_VFS_LAYER_TRANSPARENT}, + + /* NT File ACL operations */ + + {SMB_VFS_OP(skel_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_set_nt_acl), SMB_VFS_OP_SET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, + + /* POSIX ACL operations */ + + {SMB_VFS_OP(skel_chmod_acl), SMB_VFS_OP_CHMOD_ACL, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_fchmod_acl), SMB_VFS_OP_FCHMOD_ACL, SMB_VFS_LAYER_TRANSPARENT}, + + {SMB_VFS_OP(skel_sys_acl_get_entry), SMB_VFS_OP_SYS_ACL_GET_ENTRY, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_get_tag_type), SMB_VFS_OP_SYS_ACL_GET_TAG_TYPE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_get_permset), SMB_VFS_OP_SYS_ACL_GET_PERMSET, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_get_qualifier), SMB_VFS_OP_SYS_ACL_GET_QUALIFIER, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_get_file), SMB_VFS_OP_SYS_ACL_GET_FILE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_get_fd), SMB_VFS_OP_SYS_ACL_GET_FD, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_clear_perms), SMB_VFS_OP_SYS_ACL_CLEAR_PERMS, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_add_perm), SMB_VFS_OP_SYS_ACL_ADD_PERM, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_to_text), SMB_VFS_OP_SYS_ACL_TO_TEXT, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_init), SMB_VFS_OP_SYS_ACL_INIT, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_create_entry), SMB_VFS_OP_SYS_ACL_CREATE_ENTRY, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_set_tag_type), SMB_VFS_OP_SYS_ACL_SET_TAG_TYPE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_set_qualifier), SMB_VFS_OP_SYS_ACL_SET_QUALIFIER, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_set_permset), SMB_VFS_OP_SYS_ACL_SET_PERMSET, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_valid), SMB_VFS_OP_SYS_ACL_VALID, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_set_file), SMB_VFS_OP_SYS_ACL_SET_FILE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_set_fd), SMB_VFS_OP_SYS_ACL_SET_FD, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_delete_def_file), SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_get_perm), SMB_VFS_OP_SYS_ACL_GET_PERM, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_free_text), SMB_VFS_OP_SYS_ACL_FREE_TEXT, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_free_acl), SMB_VFS_OP_SYS_ACL_FREE_ACL, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sys_acl_free_qualifier), SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, SMB_VFS_LAYER_TRANSPARENT}, + + {NULL, SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +}; + +NTSTATUS init_module(void) +{ + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent", skel_op_tuples); +} -- cgit From de3f1c77677c80cb27688521b39c5325bb4e3bd7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 Jun 2003 07:09:30 +0000 Subject: Make skeleton VFSs compile with new EA modules. Jeremy (This used to be commit 7c4cc2086d59e163ab89366c24ba399994a49462) --- examples/VFS/skel_transparent.c | 74 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 3a967470a8..b2db76c9f9 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -365,6 +365,66 @@ static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle, connection_str return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, conn, qualifier, tagtype); } +static ssize_t skel_getxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, void *value, size_t size) +{ + return SMB_VFS_NEXT_GETXATTR(handle, conn, path, name, value, size); +} + +static ssize_t skel_lgetxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, void *value, size_t +size) +{ + return SMB_VFS_NEXT_LGETXATTR(handle, conn, path, name, value, size); +} + +static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, void *value, size_t size) +{ + return SMB_VFS_NEXT_FGETXATTR(handle, fsp, fd, name, value, size); +} + +static ssize_t skel_listxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, char *list, size_t size) +{ + return SMB_VFS_NEXT_LISTXATTR(handle, conn, path, list, size); +} + +static ssize_t skel_llistxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, char *list, size_t size) +{ + return SMB_VFS_NEXT_LLISTXATTR(handle, conn, path, list, size); +} + +static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, char *list, size_t size) +{ + return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, fd, list, size); +} + +static int skel_removexattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name) +{ + return SMB_VFS_NEXT_REMOVEXATTR(handle, conn, path, name); +} + +static int skel_lremovexattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name) +{ + return SMB_VFS_NEXT_LREMOVEXATTR(handle, conn, path, name); +} + +static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name) +{ + return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, fd, name); +} + +static int skel_setxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, const void *value, size_t size, int flags) +{ + return SMB_VFS_NEXT_SETXATTR(handle, conn, path, name, value, size, flags); +} + +static int skel_lsetxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, const void *value, size_t size, int flags) +{ + return SMB_VFS_NEXT_LSETXATTR(handle, conn, path, name, value, size, flags); +} + +static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, const void *value, size_t size, int flags) +{ + return SMB_VFS_NEXT_FSETXATTR(handle, fsp, fd, name, value, size, flags); +} /* VFS operations structure */ @@ -449,6 +509,20 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_sys_acl_free_acl), SMB_VFS_OP_SYS_ACL_FREE_ACL, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_sys_acl_free_qualifier), SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, SMB_VFS_LAYER_TRANSPARENT}, + /* EA operations. */ + {SMB_VFS_OP(skel_getxattr), SMB_VFS_OP_GETXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_lgetxattr), SMB_VFS_OP_LGETXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_fgetxattr), SMB_VFS_OP_FGETXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_listxattr), SMB_VFS_OP_LISTXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_llistxattr), SMB_VFS_OP_LLISTXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_flistxattr), SMB_VFS_OP_FLISTXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_removexattr), SMB_VFS_OP_REMOVEXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_lremovexattr), SMB_VFS_OP_LREMOVEXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_fremovexattr), SMB_VFS_OP_FREMOVEXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_setxattr), SMB_VFS_OP_SETXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_lsetxattr), SMB_VFS_OP_LSETXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_fsetxattr), SMB_VFS_OP_FSETXATTR, SMB_VFS_LAYER_TRANSPARENT}, + {NULL, SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} }; -- cgit From 4d48737782cb2d9434e2722f3827a5c1bac29d53 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 7 Aug 2003 21:49:01 +0000 Subject: Test modules for shadow copy by "Stefan (metze) Metzmacher" . Jeremy. (This used to be commit 3f8c77b116b96b01fd333c4b45d84666ef108fe9) --- examples/VFS/skel_transparent.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index b2db76c9f9..7a326741c5 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -65,6 +65,11 @@ static int skel_set_quota(vfs_handle_struct *handle, connection_struct *conn, en return SMB_VFS_NEXT_SET_QUOTA(handle, conn, qtype, id, dq); } +static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels) +{ + return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels); +} + static DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname) { return SMB_VFS_NEXT_OPENDIR(handle, conn, fname); @@ -437,7 +442,8 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_disk_free), SMB_VFS_OP_DISK_FREE, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_get_quota), SMB_VFS_OP_GET_QUOTA, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_set_quota), SMB_VFS_OP_SET_QUOTA, SMB_VFS_LAYER_TRANSPARENT}, - + {SMB_VFS_OP(skel_get_shadow_copy_data), SMB_VFS_OP_GET_SHADOW_COPY_DATA,SMB_VFS_LAYER_TRANSPARENT}, + /* Directory operations */ {SMB_VFS_OP(skel_opendir), SMB_VFS_OP_OPENDIR, SMB_VFS_LAYER_TRANSPARENT}, -- cgit From 0d44747df99f2168a063feedad5039f222746f61 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 6 Jan 2004 01:22:14 +0000 Subject: Patch based on work from James Peach to convert over to using pread/pwrite. Modified a little to ensure fsp->pos is correct. Fix for #889. Jeremy. (This used to be commit 019aaaf0df091c3f67048f591e70d4353a02bb9b) --- examples/VFS/skel_transparent.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 7a326741c5..448390e72f 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -110,11 +110,21 @@ static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, int fd, v return SMB_VFS_NEXT_READ(handle, fsp, fd, data, n); } +static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n, SMB_OFF_T offset) +{ + return SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, n, offset); +} + static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n) { return SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n); } +static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n, SMB_OFF_T offset) +{ + return SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, n, offset); +} + static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence) { return SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence); -- cgit From a8caf25bd86ebe9f616b3fc88cca120850eb05d6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 9 Nov 2004 23:55:04 +0000 Subject: r3644: Fixup examples VFS compile. Jeremy. (This used to be commit dfa910e4ab498100d0572838f2ac05faec3c917f) --- examples/VFS/skel_transparent.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 448390e72f..b10161cde1 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -75,11 +75,26 @@ static DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, con return SMB_VFS_NEXT_OPENDIR(handle, conn, fname); } -static struct dirent *skel_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) +static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) { return SMB_VFS_NEXT_READDIR(handle, conn, dirp); } +static void skel_seekdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp, long offset) +{ + return SMB_VFS_NEXT_SEEKDIR(handle, conn, dirp, offset); +} + +static long skel_telldir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) +{ + return SMB_VFS_NEXT_TELLDIR(handle, conn, dirp); +} + +static void skel_rewinddir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) +{ + return SMB_VFS_NEXT_REWINDDIR(handle, conn, dirp); +} + static int skel_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode) { return SMB_VFS_NEXT_MKDIR(handle, conn, path, mode); @@ -458,6 +473,9 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_opendir), SMB_VFS_OP_OPENDIR, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_readdir), SMB_VFS_OP_READDIR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_seekdir), SMB_VFS_OP_SEEKDIR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_telldir), SMB_VFS_OP_TELLDIR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_rewinddir), SMB_VFS_OP_REWINDDIR, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_mkdir), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_rmdir), SMB_VFS_OP_RMDIR, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_closedir), SMB_VFS_OP_CLOSEDIR, SMB_VFS_LAYER_TRANSPARENT}, -- cgit From 19ca97a70f6b7b41d251eaa76e4d3c980c6eedff Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 24 Jun 2005 20:25:18 +0000 Subject: r7882: Looks like a large patch - but what it actually does is make Samba safe for using our headers and linking with C++ modules. Stops us from using C++ reserved keywords in our code. Jeremy (This used to be commit 9506b8e145982b1160a2f0aee5c9b7a54980940a) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index b10161cde1..5f83dd417c 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -145,9 +145,9 @@ static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int fi return SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence); } -static int skel_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new) +static int skel_rename(vfs_handle_struct *handle, connection_struct *conn, const char *oldname, const char *newname) { - return SMB_VFS_NEXT_RENAME(handle, conn, old, new); + return SMB_VFS_NEXT_RENAME(handle, conn, oldname, newname); } static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) -- cgit From ff7e5c26733c933d0ed71616c39e2d931ad1e597 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 25 Jun 2005 03:03:44 +0000 Subject: r7893: Add in the extra parameters to opendir() to fix the large directory/insane app problem. Rev vfs version. Doesn't change the normal codepath. Jeremy. (This used to be commit 0f03a6bdcdbdf60da81e0aeffa84ac6e48fc6a04) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 5f83dd417c..428ab97061 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -70,9 +70,9 @@ static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels); } -static DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname) +static DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr) { - return SMB_VFS_NEXT_OPENDIR(handle, conn, fname); + return SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr); } static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) -- cgit From e55d945ff1b4fb95f19527b1fa41af374b501488 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 27 Jun 2005 18:32:58 +0000 Subject: r7952: Fix for bug #2826 pointed out by Jiri Klouda . Wrong return val for symlink and readlink. Jeremy. (This used to be commit f3c4d5a95746531b7bd548bbbfccfff197a2abf3) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 428ab97061..8be1a7fb44 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -220,12 +220,12 @@ static BOOL skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int return SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type); } -static BOOL skel_symlink(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath) +static int skel_symlink(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath) { return SMB_VFS_NEXT_SYMLINK(handle, conn, oldpath, newpath); } -static BOOL skel_readlink(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *buf, size_t bufsiz) +static int skel_readlink(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *buf, size_t bufsiz) { return SMB_VFS_NEXT_READLINK(handle, conn, path, buf, bufsiz); } -- cgit From f2f55d703d0dd549a83809d3e5cc5151569b48d6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 27 Jun 2005 22:53:56 +0000 Subject: r7963: Add aio support to 3.0. Jeremy. (This used to be commit 1de27da47051af08790317f5b48b02719d6b9934) --- examples/VFS/skel_transparent.c | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 8be1a7fb44..81069765d0 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -456,6 +456,41 @@ static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,in return SMB_VFS_NEXT_FSETXATTR(handle, fsp, fd, name, value, size, flags); } +static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + return SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb); +} + +static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + return SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb); +} + +static ssize_t skel_aio_return(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + return SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb); +} + +static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb) +{ + return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, fd, aiocb); +} + +static int skel_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + return SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb); +} + +static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb) +{ + return SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb); +} + +static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts) +{ + return SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts); +} + /* VFS operations structure */ static vfs_op_tuple skel_op_tuples[] = { @@ -557,6 +592,15 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_lsetxattr), SMB_VFS_OP_LSETXATTR, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_fsetxattr), SMB_VFS_OP_FSETXATTR, SMB_VFS_LAYER_TRANSPARENT}, + /* AIO operations. */ + {SMB_VFS_OP(skel_aio_read), SMB_VFS_OP_AIO_READ, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_write), SMB_VFS_OP_AIO_WRITE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_return), SMB_VFS_OP_AIO_RETURN, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_cancel), SMB_VFS_OP_AIO_CANCEL, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_error), SMB_VFS_OP_AIO_ERROR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_fsync), SMB_VFS_OP_AIO_FSYNC, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_suspend), SMB_VFS_OP_AIO_SUSPEND, SMB_VFS_LAYER_TRANSPARENT}, + {NULL, SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} }; -- cgit From f98f86394a654722fa13ef1dc3c4dea82d452442 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 22 Aug 2005 18:03:08 +0000 Subject: r9483: Changed DIR to SMB_STRUCT_DIR because of the amazing stupidity of a UNIX vendor not understanding abstract data types :-(. Jeremy. (This used to be commit be5b4e2fa3ed30b0ff01b47d2354e5f782a12e25) --- examples/VFS/skel_transparent.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 81069765d0..0879683fdc 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -70,27 +70,27 @@ static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels); } -static DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr) +static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr) { return SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr); } -static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) +static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp) { return SMB_VFS_NEXT_READDIR(handle, conn, dirp); } -static void skel_seekdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp, long offset) +static void skel_seekdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp, long offset) { return SMB_VFS_NEXT_SEEKDIR(handle, conn, dirp, offset); } -static long skel_telldir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) +static long skel_telldir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp) { return SMB_VFS_NEXT_TELLDIR(handle, conn, dirp); } -static void skel_rewinddir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) +static void skel_rewinddir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp) { return SMB_VFS_NEXT_REWINDDIR(handle, conn, dirp); } @@ -105,7 +105,7 @@ static int skel_rmdir(vfs_handle_struct *handle, connection_struct *conn, const return SMB_VFS_NEXT_RMDIR(handle, conn, path); } -static int skel_closedir(vfs_handle_struct *handle, connection_struct *conn, DIR *dir) +static int skel_closedir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dir) { return SMB_VFS_NEXT_CLOSEDIR(handle, conn, dir); } -- cgit From a5b339c799b39d5147c6d31f94cc0b2ea9c865db Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 20 Oct 2005 17:33:17 +0000 Subject: r11232: Added ab's POSIX statvfs vfs call. Sorry for the delay ab. Jeremy. (This used to be commit af8545806770a7530eecc184bdd230ca14999884) --- examples/VFS/skel_transparent.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 0879683fdc..14fa2276e1 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -70,6 +70,11 @@ static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels); } +static int skel_statvfs(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, struct vfs_statvfs_struct *statbuf) +{ + return SMB_VFS_NEXT_STATVFS(handle, conn, path, statbuf); +} + static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr) { return SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr); @@ -503,6 +508,7 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_get_quota), SMB_VFS_OP_GET_QUOTA, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_set_quota), SMB_VFS_OP_SET_QUOTA, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_get_shadow_copy_data), SMB_VFS_OP_GET_SHADOW_COPY_DATA,SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_statvfs), SMB_VFS_OP_STATVFS, SMB_VFS_LAYER_TRANSPARENT}, /* Directory operations */ -- cgit From 22dbd67708f1651a2341d70ce576fac360affccf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Apr 2006 15:33:04 +0000 Subject: r15018: Merge Volker's ipc/trans2/nttrans changes over into 3.0. Also merge the new POSIX lock code - this is not enabled unless -DDEVELOPER is defined. This doesn't yet map onto underlying system POSIX locks. Updates vfs to allow lock queries. Jeremy. (This used to be commit 08e52ead03304ff04229e1bfe544ff40e2564fc7) --- examples/VFS/skel_transparent.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 14fa2276e1..5996b29806 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -225,6 +225,11 @@ static BOOL skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int return SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type); } +static BOOL skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid) +{ + return SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid); +} + static int skel_symlink(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath) { return SMB_VFS_NEXT_SYMLINK(handle, conn, oldpath, newpath); @@ -543,6 +548,7 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_utime), SMB_VFS_OP_UTIME, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_ftruncate), SMB_VFS_OP_FTRUNCATE, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_lock), SMB_VFS_OP_LOCK, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_getlock), SMB_VFS_OP_GETLOCK, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_symlink), SMB_VFS_OP_SYMLINK, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_readlink), SMB_VFS_OP_READLINK, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_link), SMB_VFS_OP_LINK, SMB_VFS_LAYER_TRANSPARENT}, -- cgit From 6d291669972fc1344183dea29dced5e575ea7af8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Jul 2006 18:06:52 +0000 Subject: r16948: Sync the exmaples code from trunk. Jeremy. (This used to be commit 508ba05a8e4a7df8bf7f6ffe3d09a3c461026f78) --- examples/VFS/skel_transparent.c | 232 ++++++++++++++++++++-------------------- 1 file changed, 116 insertions(+), 116 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 5996b29806..2a379cd6d8 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -37,32 +37,32 @@ * --metze */ -static int skel_connect(vfs_handle_struct *handle, connection_struct *conn, const char *service, const char *user) +static int skel_connect(vfs_handle_struct *handle, const char *service, const char *user) { - return SMB_VFS_NEXT_CONNECT(handle, conn, service, user); + return SMB_VFS_NEXT_CONNECT(handle, service, user); } -static void skel_disconnect(vfs_handle_struct *handle, connection_struct *conn) +static void skel_disconnect(vfs_handle_struct *handle) { - SMB_VFS_NEXT_DISCONNECT(handle, conn); + SMB_VFS_NEXT_DISCONNECT(handle); } -static SMB_BIG_UINT skel_disk_free(vfs_handle_struct *handle, connection_struct *conn, const char *path, +static SMB_BIG_UINT skel_disk_free(vfs_handle_struct *handle, const char *path, BOOL small_query, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize) { - return SMB_VFS_NEXT_DISK_FREE(handle, conn, path, small_query, bsize, + return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, dfree, dsize); } -static int skel_get_quota(vfs_handle_struct *handle, connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq) +static int skel_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq) { - return SMB_VFS_NEXT_GET_QUOTA(handle, conn, qtype, id, dq); + return SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, dq); } -static int skel_set_quota(vfs_handle_struct *handle, connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq) +static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq) { - return SMB_VFS_NEXT_SET_QUOTA(handle, conn, qtype, id, dq); + return SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, dq); } static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels) @@ -70,54 +70,54 @@ static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels); } -static int skel_statvfs(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, struct vfs_statvfs_struct *statbuf) +static int skel_statvfs(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf) { - return SMB_VFS_NEXT_STATVFS(handle, conn, path, statbuf); + return SMB_VFS_NEXT_STATVFS(handle, path, statbuf); } -static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr) +static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr) { - return SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr); + return SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr); } -static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp) +static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp) { - return SMB_VFS_NEXT_READDIR(handle, conn, dirp); + return SMB_VFS_NEXT_READDIR(handle, dirp); } -static void skel_seekdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp, long offset) +static void skel_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset) { - return SMB_VFS_NEXT_SEEKDIR(handle, conn, dirp, offset); + return SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset); } -static long skel_telldir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp) +static long skel_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp) { - return SMB_VFS_NEXT_TELLDIR(handle, conn, dirp); + return SMB_VFS_NEXT_TELLDIR(handle, dirp); } -static void skel_rewinddir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp) +static void skel_rewinddir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp) { - return SMB_VFS_NEXT_REWINDDIR(handle, conn, dirp); + return SMB_VFS_NEXT_REWINDDIR(handle, dirp); } -static int skel_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode) +static int skel_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode) { - return SMB_VFS_NEXT_MKDIR(handle, conn, path, mode); + return SMB_VFS_NEXT_MKDIR(handle, path, mode); } -static int skel_rmdir(vfs_handle_struct *handle, connection_struct *conn, const char *path) +static int skel_rmdir(vfs_handle_struct *handle, const char *path) { - return SMB_VFS_NEXT_RMDIR(handle, conn, path); + return SMB_VFS_NEXT_RMDIR(handle, path); } -static int skel_closedir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dir) +static int skel_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dir) { - return SMB_VFS_NEXT_CLOSEDIR(handle, conn, dir); + return SMB_VFS_NEXT_CLOSEDIR(handle, dir); } -static int skel_open(vfs_handle_struct *handle, connection_struct *conn, const char *fname, int flags, mode_t mode) +static int skel_open(vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode) { - return SMB_VFS_NEXT_OPEN(handle, conn, fname, flags, mode); + return SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode); } static int skel_close(vfs_handle_struct *handle, files_struct *fsp, int fd) @@ -150,9 +150,9 @@ static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int fi return SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence); } -static int skel_rename(vfs_handle_struct *handle, connection_struct *conn, const char *oldname, const char *newname) +static int skel_rename(vfs_handle_struct *handle, const char *oldname, const char *newname) { - return SMB_VFS_NEXT_RENAME(handle, conn, oldname, newname); + return SMB_VFS_NEXT_RENAME(handle, oldname, newname); } static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) @@ -160,9 +160,9 @@ static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) return SMB_VFS_NEXT_FSYNC(handle, fsp, fd); } -static int skel_stat(vfs_handle_struct *handle, connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sbuf) +static int skel_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf) { - return SMB_VFS_NEXT_STAT(handle, conn, fname, sbuf); + return SMB_VFS_NEXT_STAT(handle, fname, sbuf); } static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf) @@ -170,19 +170,19 @@ static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ return SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf); } -static int skel_lstat(vfs_handle_struct *handle, connection_struct *conn, const char *path, SMB_STRUCT_STAT *sbuf) +static int skel_lstat(vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf) { - return SMB_VFS_NEXT_LSTAT(handle, conn, path, sbuf); + return SMB_VFS_NEXT_LSTAT(handle, path, sbuf); } -static int skel_unlink(vfs_handle_struct *handle, connection_struct *conn, const char *path) +static int skel_unlink(vfs_handle_struct *handle, const char *path) { - return SMB_VFS_NEXT_UNLINK(handle, conn, path); + return SMB_VFS_NEXT_UNLINK(handle, path); } -static int skel_chmod(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode) +static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode) { - return SMB_VFS_NEXT_CHMOD(handle, conn, path, mode); + return SMB_VFS_NEXT_CHMOD(handle, path, mode); } static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode) @@ -190,9 +190,9 @@ static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mod return SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode); } -static int skel_chown(vfs_handle_struct *handle, connection_struct *conn, const char *path, uid_t uid, gid_t gid) +static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid) { - return SMB_VFS_NEXT_CHOWN(handle, conn, path, uid, gid); + return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid); } static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid) @@ -200,19 +200,19 @@ static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid return SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid); } -static int skel_chdir(vfs_handle_struct *handle, connection_struct *conn, const char *path) +static int skel_chdir(vfs_handle_struct *handle, const char *path) { - return SMB_VFS_NEXT_CHDIR(handle, conn, path); + return SMB_VFS_NEXT_CHDIR(handle, path); } -static char *skel_getwd(vfs_handle_struct *handle, connection_struct *conn, char *buf) +static char *skel_getwd(vfs_handle_struct *handle, char *buf) { - return SMB_VFS_NEXT_GETWD(handle, conn, buf); + return SMB_VFS_NEXT_GETWD(handle, buf); } -static int skel_utime(vfs_handle_struct *handle, connection_struct *conn, const char *path, struct utimbuf *times) +static int skel_utime(vfs_handle_struct *handle, const char *path, struct utimbuf *times) { - return SMB_VFS_NEXT_UTIME(handle, conn, path, times); + return SMB_VFS_NEXT_UTIME(handle, path, times); } static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T offset) @@ -230,29 +230,29 @@ static BOOL skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, S return SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid); } -static int skel_symlink(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath) +static int skel_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath) { - return SMB_VFS_NEXT_SYMLINK(handle, conn, oldpath, newpath); + return SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath); } -static int skel_readlink(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *buf, size_t bufsiz) +static int skel_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz) { - return SMB_VFS_NEXT_READLINK(handle, conn, path, buf, bufsiz); + return SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz); } -static int skel_link(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath) +static int skel_link(vfs_handle_struct *handle, const char *oldpath, const char *newpath) { - return SMB_VFS_NEXT_LINK(handle, conn, oldpath, newpath); + return SMB_VFS_NEXT_LINK(handle, oldpath, newpath); } -static int skel_mknod(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode, SMB_DEV_T dev) +static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev) { - return SMB_VFS_NEXT_MKNOD(handle, conn, path, mode, dev); + return SMB_VFS_NEXT_MKNOD(handle, path, mode, dev); } -static char *skel_realpath(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *resolved_path) +static char *skel_realpath(vfs_handle_struct *handle, const char *path, char *resolved_path) { - return SMB_VFS_NEXT_REALPATH(handle, conn, path, resolved_path); + return SMB_VFS_NEXT_REALPATH(handle, path, resolved_path); } static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, struct security_descriptor_info **ppdesc) @@ -275,14 +275,14 @@ static BOOL skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, psd); } -static int skel_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, const char *name, mode_t mode) +static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode) { /* If the underlying VFS doesn't have ACL support... */ if (!handle->vfs_next.ops.chmod_acl) { errno = ENOSYS; return -1; } - return SMB_VFS_NEXT_CHMOD_ACL(handle, conn, name, mode); + return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode); } static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode) @@ -295,29 +295,29 @@ static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode); } -static int skel_sys_acl_get_entry(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p) +static int skel_sys_acl_get_entry(vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p) { - return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, conn, theacl, entry_id, entry_p); + return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id, entry_p); } -static int skel_sys_acl_get_tag_type(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p) +static int skel_sys_acl_get_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p) { - return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, conn, entry_d, tag_type_p); + return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d, tag_type_p); } -static int skel_sys_acl_get_permset(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p) +static int skel_sys_acl_get_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p) { - return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, conn, entry_d, permset_p); + return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d, permset_p); } -static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d) +static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d) { - return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, conn, entry_d); + return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d); } -static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, connection_struct *conn, const char *path_p, SMB_ACL_TYPE_T type) +static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type) { - return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, conn, path_p, type); + return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type); } static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, int fd) @@ -325,54 +325,54 @@ static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fs return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, fd); } -static int skel_sys_acl_clear_perms(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset) +static int skel_sys_acl_clear_perms(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset) { - return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, conn, permset); + return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset); } -static int skel_sys_acl_add_perm(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) +static int skel_sys_acl_add_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) { - return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, conn, permset, perm); + return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm); } -static char *skel_sys_acl_to_text(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl, ssize_t *plen) +static char *skel_sys_acl_to_text(vfs_handle_struct *handle, SMB_ACL_T theacl, ssize_t *plen) { - return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, conn, theacl, plen); + return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen); } -static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle, connection_struct *conn, int count) +static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle, int count) { - return SMB_VFS_NEXT_SYS_ACL_INIT(handle, conn, count); + return SMB_VFS_NEXT_SYS_ACL_INIT(handle, count); } -static int skel_sys_acl_create_entry(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry) +static int skel_sys_acl_create_entry(vfs_handle_struct *handle, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry) { - return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, conn, pacl, pentry); + return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry); } -static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype) +static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype) { - return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, conn, entry, tagtype); + return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry, tagtype); } -static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, void *qual) +static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, void *qual) { - return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, conn, entry, qual); + return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual); } -static int skel_sys_acl_set_permset(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset) +static int skel_sys_acl_set_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset) { - return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, conn, entry, permset); + return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset); } -static int skel_sys_acl_valid(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl ) +static int skel_sys_acl_valid(vfs_handle_struct *handle, SMB_ACL_T theacl ) { - return SMB_VFS_NEXT_SYS_ACL_VALID(handle, conn, theacl); + return SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl); } -static int skel_sys_acl_set_file(vfs_handle_struct *handle, connection_struct *conn, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) +static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) { - return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, conn, name, acltype, theacl); + return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl); } static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ACL_T theacl) @@ -380,40 +380,40 @@ static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl); } -static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, connection_struct *conn, const char *path) +static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *path) { - return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, conn, path); + return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path); } -static int skel_sys_acl_get_perm(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) +static int skel_sys_acl_get_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) { - return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, conn, permset, perm); + return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm); } -static int skel_sys_acl_free_text(vfs_handle_struct *handle, connection_struct *conn, char *text) +static int skel_sys_acl_free_text(vfs_handle_struct *handle, char *text) { - return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, conn, text); + return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text); } -static int skel_sys_acl_free_acl(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T posix_acl) +static int skel_sys_acl_free_acl(vfs_handle_struct *handle, SMB_ACL_T posix_acl) { - return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, conn, posix_acl); + return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl); } -static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle, connection_struct *conn, void *qualifier, SMB_ACL_TAG_T tagtype) +static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle, void *qualifier, SMB_ACL_TAG_T tagtype) { - return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, conn, qualifier, tagtype); + return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier, tagtype); } -static ssize_t skel_getxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, void *value, size_t size) +static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size) { - return SMB_VFS_NEXT_GETXATTR(handle, conn, path, name, value, size); + return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size); } -static ssize_t skel_lgetxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, void *value, size_t +static ssize_t skel_lgetxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size) { - return SMB_VFS_NEXT_LGETXATTR(handle, conn, path, name, value, size); + return SMB_VFS_NEXT_LGETXATTR(handle, path, name, value, size); } static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, void *value, size_t size) @@ -421,14 +421,14 @@ static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fs return SMB_VFS_NEXT_FGETXATTR(handle, fsp, fd, name, value, size); } -static ssize_t skel_listxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, char *list, size_t size) +static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size) { - return SMB_VFS_NEXT_LISTXATTR(handle, conn, path, list, size); + return SMB_VFS_NEXT_LISTXATTR(handle, path, list, size); } -static ssize_t skel_llistxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, char *list, size_t size) +static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size) { - return SMB_VFS_NEXT_LLISTXATTR(handle, conn, path, list, size); + return SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size); } static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, char *list, size_t size) @@ -436,14 +436,14 @@ static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *f return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, fd, list, size); } -static int skel_removexattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name) +static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name) { - return SMB_VFS_NEXT_REMOVEXATTR(handle, conn, path, name); + return SMB_VFS_NEXT_REMOVEXATTR(handle, path, name); } -static int skel_lremovexattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name) +static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name) { - return SMB_VFS_NEXT_LREMOVEXATTR(handle, conn, path, name); + return SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name); } static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name) @@ -451,14 +451,14 @@ static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, fd, name); } -static int skel_setxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, const void *value, size_t size, int flags) +static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags) { - return SMB_VFS_NEXT_SETXATTR(handle, conn, path, name, value, size, flags); + return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags); } -static int skel_lsetxattr(vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, const void *value, size_t size, int flags) +static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags) { - return SMB_VFS_NEXT_LSETXATTR(handle, conn, path, name, value, size, flags); + return SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size, flags); } static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, const void *value, size_t size, int flags) -- cgit From 4952fe368a40b239140b3035db6075427d237bb9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 5 Mar 2007 23:40:03 +0000 Subject: r21714: Change the VFS interface to use struct timespec for utimes - change the call to ntimes. This preserves nsec timestamps we get from stat (if the system supports it) and only maps back down to usec or sec resolution on time set. Looks bigger than it is as I had to move lots of internal code from using time_t and struct utimebuf to struct timespec. Jeremy. (This used to be commit 8f3d530c5a748ea90f42ed8fbe68ae92178d4875) --- examples/VFS/skel_transparent.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 2a379cd6d8..b967a337eb 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -210,9 +210,9 @@ static char *skel_getwd(vfs_handle_struct *handle, char *buf) return SMB_VFS_NEXT_GETWD(handle, buf); } -static int skel_utime(vfs_handle_struct *handle, const char *path, struct utimbuf *times) +static int skel_ntimes(vfs_handle_struct *handle, const char *path, const struct timespec ts[2]) { - return SMB_VFS_NEXT_UTIME(handle, path, times); + return SMB_VFS_NEXT_NTIMES(handle, path, ts[2]); } static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T offset) @@ -545,7 +545,7 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_fchown), SMB_VFS_OP_FCHOWN, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_chdir), SMB_VFS_OP_CHDIR, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_getwd), SMB_VFS_OP_GETWD, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(skel_utime), SMB_VFS_OP_UTIME, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_ntimes), SMB_VFS_OP_NTIMES, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_ftruncate), SMB_VFS_OP_FTRUNCATE, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_lock), SMB_VFS_OP_LOCK, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_getlock), SMB_VFS_OP_GETLOCK, SMB_VFS_LAYER_TRANSPARENT}, -- cgit From 70d5f417ab7abf1ac41db72e2cbaee5ccda51a2e Mon Sep 17 00:00:00 2001 From: James Peach Date: Thu, 8 Mar 2007 17:06:16 +0000 Subject: r21762: Fix the build by enabling shared modules and adding the config.* files. Add norify_watch and chflags operations. Fix a bunch of warnings. (This used to be commit 1106db7ea148253e3b5f0806b2d5efcd094b202e) --- examples/VFS/skel_transparent.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index b967a337eb..2efb3d54a7 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -212,7 +212,7 @@ static char *skel_getwd(vfs_handle_struct *handle, char *buf) static int skel_ntimes(vfs_handle_struct *handle, const char *path, const struct timespec ts[2]) { - return SMB_VFS_NEXT_NTIMES(handle, path, ts[2]); + return SMB_VFS_NEXT_NTIMES(handle, path, ts); } static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T offset) @@ -255,22 +255,40 @@ static char *skel_realpath(vfs_handle_struct *handle, const char *path, char *r return SMB_VFS_NEXT_REALPATH(handle, path, resolved_path); } -static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, struct security_descriptor_info **ppdesc) +static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle, + struct sys_notify_context *ctx, struct notify_entry *e, + void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev), + void *private_data, void *handle_p) +{ + return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, callback, + private_data, handle_p); +} + +static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags) +{ + return SMB_VFS_NEXT_CHFLAGS(handle, path, flags); +} + +static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + int fd, uint32 security_info, SEC_DESC **ppdesc) { return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, fd, security_info, ppdesc); } -static size_t skel_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, struct security_descriptor_info **ppdesc) +static size_t skel_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + const char *name, uint32 security_info, SEC_DESC **ppdesc) { return SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, ppdesc); } -static BOOL skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, struct security_descriptor_info *psd) +static BOOL skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + int fd, uint32 security_info_sent, SEC_DESC *psd) { return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, fd, security_info_sent, psd); } -static BOOL skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, struct security_descriptor_info *psd) +static BOOL skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + const char *name, uint32 security_info_sent, SEC_DESC *psd) { return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, psd); } @@ -554,6 +572,8 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_link), SMB_VFS_OP_LINK, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_mknod), SMB_VFS_OP_MKNOD, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_realpath), SMB_VFS_OP_REALPATH, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_notify_watch), SMB_VFS_OP_NOTIFY_WATCH, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_chflags), SMB_VFS_OP_CHFLAGS, SMB_VFS_LAYER_TRANSPARENT}, /* NT File ACL operations */ -- cgit From 57d6318a0b5ecc0154547a04acef8ac222c1d28f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 May 2007 23:55:12 +0000 Subject: r23105: Add lchown to the vfs layer. We need this in the POSIX code. Jeremy. (This used to be commit 932523cbb508db869b726768e86bfa8e248f768b) --- examples/VFS/skel_transparent.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 2efb3d54a7..a422b7ce00 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -200,6 +200,11 @@ static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid return SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid); } +static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid) +{ + return SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid); +} + static int skel_chdir(vfs_handle_struct *handle, const char *path) { return SMB_VFS_NEXT_CHDIR(handle, path); @@ -561,6 +566,7 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_fchmod), SMB_VFS_OP_FCHMOD, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_chown), SMB_VFS_OP_CHOWN, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_fchown), SMB_VFS_OP_FCHOWN, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_lchown), SMB_VFS_OP_LCHOWN, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_chdir), SMB_VFS_OP_CHDIR, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_getwd), SMB_VFS_OP_GETWD, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_ntimes), SMB_VFS_OP_NTIMES, SMB_VFS_LAYER_TRANSPARENT}, -- cgit From a0ac7a7f4c0290787cdadb5866272cee2bd61b8a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 26 Jun 2007 22:49:10 +0000 Subject: r23620: Convert set_nt_acl to return NTSTATUS. Also fix the chown return to correctly return NT_STATUS_INVALID_OWNER if it should be disallowed. Matches better what W2K3R3 does. NFSv4 ACL module owners, please examine these changes. Jeremy. (This used to be commit fc6899a5506b272f8cd5f5837ca13300b4e69a5f) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index a422b7ce00..746fa31736 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -286,13 +286,13 @@ static size_t skel_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, return SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, ppdesc); } -static BOOL skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd) { return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, fd, security_info_sent, psd); } -static BOOL skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, SEC_DESC *psd) { return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, psd); -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- examples/VFS/skel_transparent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 746fa31736..09461cff42 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -8,7 +8,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- examples/VFS/skel_transparent.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 09461cff42..0a74cfc95d 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -17,8 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see . */ -- cgit From 564e6841d60ec5ae573a707f73fcc0ab80a41394 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 2 Aug 2007 09:19:04 +0000 Subject: r24123: add file_id_create() to some vfs modules metze (This used to be commit 0bc5a9cd0136f8512e963a30b6e7b009667fb0bf) --- examples/VFS/skel_transparent.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 0a74cfc95d..411dc31c6a 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -273,6 +273,12 @@ static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags return SMB_VFS_NEXT_CHFLAGS(handle, path, flags); } +static struct file_id skel_file_id_create(vfs_handle_struct *handle, + SMB_DEV_T dev, SMB_INO_T inode) +{ + return SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode); +} + static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc) { @@ -579,6 +585,7 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_realpath), SMB_VFS_OP_REALPATH, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_notify_watch), SMB_VFS_OP_NOTIFY_WATCH, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_chflags), SMB_VFS_OP_CHFLAGS, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_file_id_create), SMB_VFS_OP_FILE_ID_CREATE, SMB_VFS_LAYER_TRANSPARENT}, /* NT File ACL operations */ -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- examples/VFS/skel_transparent.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 411dc31c6a..66ea1129b6 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -47,7 +47,7 @@ static void skel_disconnect(vfs_handle_struct *handle) } static SMB_BIG_UINT skel_disk_free(vfs_handle_struct *handle, const char *path, - BOOL small_query, SMB_BIG_UINT *bsize, + bool small_query, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize) { return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, @@ -64,7 +64,7 @@ static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, return SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, dq); } -static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels) +static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels) { return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels); } @@ -224,12 +224,12 @@ static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, offset); } -static BOOL skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) +static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) { return SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type); } -static BOOL skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid) +static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid) { return SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid); } -- cgit From 488b59cfac244ec8cfc60df687fcd153d693509c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 29 Oct 2007 17:16:13 -0700 Subject: Add in the recvfile entry to the VFS layer with a default implementation. Needed for the zero-copy write code. Jeremy. (This used to be commit bfbdb6324c5d13bfde8b742e9c5a0e0c9092bd86) --- examples/VFS/skel_transparent.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 66ea1129b6..2512f4d6db 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -149,6 +149,16 @@ static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int fi return SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence); } +static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n) +{ + return SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd, hdr, offset, n); +} + +static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *fsp, int tofd, SMB_OFF_T offset, size_t n) +{ + return SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd, offset, n); +} + static int skel_rename(vfs_handle_struct *handle, const char *oldname, const char *newname) { return SMB_VFS_NEXT_RENAME(handle, oldname, newname); @@ -561,6 +571,8 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_read), SMB_VFS_OP_READ, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_write), SMB_VFS_OP_WRITE, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_lseek), SMB_VFS_OP_LSEEK, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_sendfile), SMB_VFS_OP_SENDFILE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_recvfile), SMB_VFS_OP_RECVFILE, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_fsync), SMB_VFS_OP_FSYNC, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_stat), SMB_VFS_OP_STAT, SMB_VFS_LAYER_TRANSPARENT}, -- cgit From ca275e254985727c50b1b988c958a3743a7bc8ce Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 00:14:19 +0100 Subject: Remove unneeded parameter fd from SMB_VFS_PREAD(). Michael (This used to be commit 73e28806ce87d829ea7c38ed3440020845bb13bf) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 2512f4d6db..c6d7d5c36e 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -129,9 +129,9 @@ static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, int fd, v return SMB_VFS_NEXT_READ(handle, fsp, fd, data, n); } -static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n, SMB_OFF_T offset) +static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset) { - return SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, n, offset); + return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset); } static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n) -- cgit From 3f4699f5a3f3c7a2ad11119c266e5a018d71b0fe Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 00:21:12 +0100 Subject: Adapt fset_nt_acl() and fget_nt_acl() in examples/VFS/ to vfs prototype change. Michael (This used to be commit d9d6775878f8b3425665c6a45a5ef9cb92932cf8) --- examples/VFS/skel_transparent.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index c6d7d5c36e..76ef7e0f2b 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -290,9 +290,9 @@ static struct file_id skel_file_id_create(vfs_handle_struct *handle, } static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, - int fd, uint32 security_info, SEC_DESC **ppdesc) + uint32 security_info, SEC_DESC **ppdesc) { - return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, fd, security_info, ppdesc); + return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc); } static size_t skel_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, @@ -302,9 +302,9 @@ static size_t skel_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, } static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, - int fd, uint32 security_info_sent, SEC_DESC *psd) + uint32 security_info_sent, SEC_DESC *psd) { - return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, fd, security_info_sent, psd); + return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd); } static NTSTATUS skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, -- cgit From a56b417809805f8872c1e3238cce5d006d6189e4 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 09:23:04 +0100 Subject: Remove redundant parameter fd from SMB_VFS_PWRITE(). Michael (This used to be commit 8c4901a19ae2fd3ee085f9499f33aa7db016d182) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 76ef7e0f2b..f702c93d80 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -139,9 +139,9 @@ static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, int fd, return SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n); } -static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n, SMB_OFF_T offset) +static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset) { - return SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, n, offset); + return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset); } static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence) -- cgit From 6f657c873efa4779e762a8f9ede97e19da6fb7ec Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 10:15:08 +0100 Subject: Remove redundant parameter fd from SMB_VFS_LSEEK(). Michael (This used to be commit df929796f2698698d2875227bda8500589cca2df) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index f702c93d80..8772718a74 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -144,9 +144,9 @@ static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const v return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset); } -static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence) +static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence) { - return SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence); + return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence); } static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n) -- cgit From 8dcce0d236b2102ca94fbcb7aa7126fe6733f2e7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 12:49:02 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FSYNC(). Michael (This used to be commit 8f83c9a7b245dbfef28195f9a7f33047a8ba95a0) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 8772718a74..ea20312514 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -164,9 +164,9 @@ static int skel_rename(vfs_handle_struct *handle, const char *oldname, const ch return SMB_VFS_NEXT_RENAME(handle, oldname, newname); } -static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) +static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp) { - return SMB_VFS_NEXT_FSYNC(handle, fsp, fd); + return SMB_VFS_NEXT_FSYNC(handle, fsp); } static int skel_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf) -- cgit From 87a684f7fcfa8d9fabc42e33981299d0b33eeeb7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 13:21:26 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FSTAT(). Michael (This used to be commit 0b86c420be94d295f6917a220b5d699f65b46711) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index ea20312514..72ca6f2056 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -174,9 +174,9 @@ static int skel_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_S return SMB_VFS_NEXT_STAT(handle, fname, sbuf); } -static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf) +static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf) { - return SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf); + return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf); } static int skel_lstat(vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf) -- cgit From e614dec27f33c932c6c29c806d567fd6015cd5e6 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 13:44:37 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FCHMOD(). Michael (This used to be commit a54d5604da556d1250ca9948d4acc4a187a9fede) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 72ca6f2056..0cae379445 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -194,9 +194,9 @@ static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode) return SMB_VFS_NEXT_CHMOD(handle, path, mode); } -static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode) +static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode) { - return SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode); + return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode); } static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid) -- cgit From 670909cb07e38a06bf5db12342b3b1189f0e1ab7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 14:26:00 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FCHOWN(). Michael (This used to be commit fbb193db3e0dc51cb000ae406a68bc547f31d9ab) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 0cae379445..d4af67db51 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -204,9 +204,9 @@ static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, g return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid); } -static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid) +static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid) { - return SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid); + return SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid); } static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid) -- cgit From b457b94bb86897b7020c6f300cd19a3d8e192610 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 15:55:09 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FTRUNCATE(). Michael (This used to be commit 2ad66050a0452b8e7e08b1e7a01efa00c72fd451) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index d4af67db51..5d3103ee76 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -229,9 +229,9 @@ static int skel_ntimes(vfs_handle_struct *handle, const char *path, const struc return SMB_VFS_NEXT_NTIMES(handle, path, ts); } -static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T offset) +static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset) { - return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, offset); + return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset); } static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) -- cgit From edd30e716fb5133b269ef82358e95d187a107870 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 16:38:23 +0100 Subject: Remove redundant parameter fd from SMB_VFS_LOCK(). Michael (This used to be commit 4f3ab2c406072e0b43581057e7e785e8ad454cfa) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 5d3103ee76..37570b8ab0 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -234,9 +234,9 @@ static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_ return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset); } -static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) +static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) { - return SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type); + return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type); } static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid) -- cgit From 89f1fec4e57255fc511eeee0b18cbe19e8c22297 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 8 Jan 2008 22:13:25 +0100 Subject: Fix examples/VFS after VFS API changes. Michael (This used to be commit c88555ce45aa2998037d316f3a8edccd04be04a4) --- examples/VFS/skel_transparent.c | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 37570b8ab0..f15cdfdb70 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -239,9 +239,9 @@ static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_ return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type); } -static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid) +static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid) { - return SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid); + return SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid); } static int skel_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath) @@ -289,16 +289,16 @@ static struct file_id skel_file_id_create(vfs_handle_struct *handle, return SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode); } -static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc) { return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc); } -static size_t skel_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle, const char *name, uint32 security_info, SEC_DESC **ppdesc) { - return SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, ppdesc); + return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc); } static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, @@ -323,14 +323,14 @@ static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t m return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode); } -static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode) +static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode) { /* If the underlying VFS doesn't have ACL support... */ if (!handle->vfs_next.ops.fchmod_acl) { errno = ENOSYS; return -1; } - return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode); + return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode); } static int skel_sys_acl_get_entry(vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p) @@ -358,9 +358,9 @@ static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, const char *p return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type); } -static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, int fd) +static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp) { - return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, fd); + return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp); } static int skel_sys_acl_clear_perms(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset) @@ -413,9 +413,9 @@ static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, S return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl); } -static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ACL_T theacl) +static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl) { - return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl); + return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl); } static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *path) @@ -454,9 +454,9 @@ size) return SMB_VFS_NEXT_LGETXATTR(handle, path, name, value, size); } -static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, void *value, size_t size) +static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size) { - return SMB_VFS_NEXT_FGETXATTR(handle, fsp, fd, name, value, size); + return SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size); } static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size) @@ -469,9 +469,9 @@ static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char return SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size); } -static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, char *list, size_t size) +static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size) { - return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, fd, list, size); + return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size); } static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name) @@ -484,9 +484,9 @@ static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const return SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name); } -static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name) +static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name) { - return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, fd, name); + return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name); } static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags) @@ -499,9 +499,9 @@ static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const cha return SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size, flags); } -static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, const void *value, size_t size, int flags) +static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags) { - return SMB_VFS_NEXT_FSETXATTR(handle, fsp, fd, name, value, size, flags); + return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags); } static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) @@ -519,9 +519,9 @@ static ssize_t skel_aio_return(struct vfs_handle_struct *handle, struct files_st return SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb); } -static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb) +static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) { - return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, fd, aiocb); + return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb); } static int skel_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) -- cgit From 1d66f4d58b5fdd9c4e0c022cd2724e05d144510b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 10 Jan 2008 15:33:51 +0100 Subject: Remove redundant parameter fd from SMB_VFS_READ(). Michael (This used to be commit a8fc2ddad8d5f7c6c00cb36c74a32a02d69d1d04) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index f15cdfdb70..7b09e3369c 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -124,9 +124,9 @@ static int skel_close(vfs_handle_struct *handle, files_struct *fsp, int fd) return SMB_VFS_NEXT_CLOSE(handle, fsp, fd); } -static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n) +static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n) { - return SMB_VFS_NEXT_READ(handle, fsp, fd, data, n); + return SMB_VFS_NEXT_READ(handle, fsp, data, n); } static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset) -- cgit From e9a3a62e7448bef72d9c17c90ff2b404082f067c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 10 Jan 2008 15:49:35 +0100 Subject: Remove redundant parameter fd from SMB_VFS_WRITE(). Michael (This used to be commit c8ae7d095a2a6a7eac920a68ca7244e3a423e1b1) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 7b09e3369c..c168b461ba 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -134,9 +134,9 @@ static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *da return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset); } -static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n) +static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n) { - return SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n); + return SMB_VFS_NEXT_WRITE(handle, fsp, data, n); } static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset) -- cgit From 4caab9ca25e1163378714de825d835e79e27dd4f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 00:51:19 +0100 Subject: Combine fsp and fromfd to fromfsp in SMB_VFS_SENDFILE(). Michael (This used to be commit a52cfb7d777157c93c9dc26c67f457be592dd537) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index c168b461ba..e69826a89d 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -149,9 +149,9 @@ static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OF return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence); } -static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n) +static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n) { - return SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd, hdr, offset, n); + return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n); } static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *fsp, int tofd, SMB_OFF_T offset, size_t n) -- cgit From fef9cf00e1e110ff5872f1c368d080fe4f7939d6 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 01:26:54 +0100 Subject: Combine fsp and tofd to tofsp in SMB_VFS_RECVFILE(). Michael (This used to be commit 3958abffaf2866c69ad9e13ec345364fde5c78bb) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index e69826a89d..55407be10c 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -154,9 +154,9 @@ static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct * return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n); } -static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *fsp, int tofd, SMB_OFF_T offset, size_t n) +static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n) { - return SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd, offset, n); + return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n); } static int skel_rename(vfs_handle_struct *handle, const char *oldname, const char *newname) -- cgit From 3020ec12a39276eaf3978323f4048b8a2e430bea Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 16 Jan 2008 17:22:31 -0800 Subject: Fix the mess that ab just made of the new VFS code. NEEDS MORE TESTING ! Jeremy. (This used to be commit bcc94aed6f03211866aa85753a90fece87846ba9) --- examples/VFS/skel_transparent.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 55407be10c..0a934976c4 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -539,6 +539,26 @@ static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struc return SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts); } +static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp) +{ + return SMB_VFS_NEXT_AIO_FORCE(handle, fsp); +} + +static int skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf, bool *offline) +{ + return SMB_VFS_NEXT_IS_OFFLINE(handle, path, sbuf, offline); +} + +static int skel_set_offline(struct vfs_handle_struct *handle, const char *path) +{ + return SMB_VFS_NEXT_SET_OFFLINE(handle, path); +} + +static bool skel_is_remotestorage(struct vfs_handle_struct *handle, const char *path) +{ + return SMB_VFS_NEXT_IS_REMOTESTORAGE(handle, path); +} + /* VFS operations structure */ static vfs_op_tuple skel_op_tuples[] = { @@ -633,7 +653,7 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_sys_acl_free_text), SMB_VFS_OP_SYS_ACL_FREE_TEXT, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_sys_acl_free_acl), SMB_VFS_OP_SYS_ACL_FREE_ACL, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_sys_acl_free_qualifier), SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, SMB_VFS_LAYER_TRANSPARENT}, - + /* EA operations. */ {SMB_VFS_OP(skel_getxattr), SMB_VFS_OP_GETXATTR, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_lgetxattr), SMB_VFS_OP_LGETXATTR, SMB_VFS_LAYER_TRANSPARENT}, @@ -656,6 +676,12 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_aio_error), SMB_VFS_OP_AIO_ERROR, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_aio_fsync), SMB_VFS_OP_AIO_FSYNC, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_aio_suspend), SMB_VFS_OP_AIO_SUSPEND, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_force), SMB_VFS_OP_AIO_FORCE, SMB_VFS_LAYER_TRANSPARENT}, + + /* offline operations */ + {SMB_VFS_OP(skel_is_offline), SMB_VFS_OP_IS_OFFLINE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_set_offline), SMB_VFS_OP_SET_OFFLINE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_is_remotestorage), SMB_VFS_OP_IS_REMOTESTORAGE, SMB_VFS_LAYER_TRANSPARENT}, {NULL, SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} }; -- cgit From 026a66abecea3e3a54cdbfb97129d5e65608e5df Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Thu, 17 Jan 2008 14:57:35 +0300 Subject: Rework of VFS is_offline() function to only return boolean offline/online result for a file. This makes sense as upper levels are only taking returned result of 0 (no error) into consideration when deciding whether to mark file offline/online as returned from is_offline. That means that we simply can move the decision down to VFS module and clean up upper levels so that they always see only file status. If there is an error when trying to identify file status, then VFS module could decide what to return (offline or online) by itself -- after all, it ought to have system-specific knowledge anyway. (This used to be commit 75cc08661473cce62756fa062071bb2bc1fb39ec) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 0a934976c4..997783819c 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -544,9 +544,9 @@ static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct return SMB_VFS_NEXT_AIO_FORCE(handle, fsp); } -static int skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf, bool *offline) +static bool skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf) { - return SMB_VFS_NEXT_IS_OFFLINE(handle, path, sbuf, offline); + return SMB_VFS_NEXT_IS_OFFLINE(handle, path, sbuf); } static int skel_set_offline(struct vfs_handle_struct *handle, const char *path) -- cgit From 03387a0f5886d449eda359a5acecd830f3bd35bc Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Thu, 17 Jan 2008 16:51:14 +0300 Subject: Remove is_remotestorage() call from VFS. We already have statvfs() there to handle FS capabilities. As discussed with Volker, it is better to calculate FS capabilities at connection time. We already do this with help of VFS statvfs() call which allows to fill-in system-specific attributes including FS capabilities. So just re-use it if you want to represent additional capabilities in your modules. The only caution is that you need to call underlying statvfs() call to actually get system-specific capabilities (and other fields) added. Then add module-specific ones. (This used to be commit e342ca0d931f9a5c8ec9e472dc9c63f1fe012b3a) --- examples/VFS/skel_transparent.c | 1 - 1 file changed, 1 deletion(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 997783819c..f4cb9b15ba 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -681,7 +681,6 @@ static vfs_op_tuple skel_op_tuples[] = { /* offline operations */ {SMB_VFS_OP(skel_is_offline), SMB_VFS_OP_IS_OFFLINE, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_set_offline), SMB_VFS_OP_SET_OFFLINE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(skel_is_remotestorage), SMB_VFS_OP_IS_REMOTESTORAGE, SMB_VFS_LAYER_TRANSPARENT}, {NULL, SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} }; -- cgit From 0db7aba8af80a01150d1061a4192ab814e4234b7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 14:19:28 +0100 Subject: Remove redundant parameter fd from SMB_VFS_CLOSE(). Now all those redundant fd's have vanished from the VFS API. Michael (This used to be commit 14294535512a7f191c5008e622b6708e417854ae) --- examples/VFS/skel_transparent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index f4cb9b15ba..7102d4d4db 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -119,9 +119,9 @@ static int skel_open(vfs_handle_struct *handle, const char *fname, files_struct return SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode); } -static int skel_close(vfs_handle_struct *handle, files_struct *fsp, int fd) +static int skel_close(vfs_handle_struct *handle, files_struct *fsp) { - return SMB_VFS_NEXT_CLOSE(handle, fsp, fd); + return SMB_VFS_NEXT_CLOSE(handle, fsp); } static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n) -- cgit From 00b2cdf75e9bea25034440054b4acd91a179c86d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 8 May 2008 18:09:07 -0700 Subject: Yay ! Remove a VFS entry. Removed the set_nt_acl() call, this can only be done via fset_nt_acl() using an open file/directory handle. I'd like to do the same with get_nt_acl() but am concerned about efficiency problems with "hide unreadable/hide unwritable" when doing a directory listing (this would mean opening every file in the dir on list). Moving closer to rationalizing the ACL model and maybe moving the POSIX calls into a posix_acl VFS module rather than having them as first class citizens of the VFS. Jeremy. (This used to be commit f487f742cb903a06fbf2be006ddc9ce9063339ed) --- examples/VFS/skel_transparent.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'examples/VFS/skel_transparent.c') diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 7102d4d4db..ea8530d855 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -307,12 +307,6 @@ static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd); } -static NTSTATUS skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, - const char *name, uint32 security_info_sent, SEC_DESC *psd) -{ - return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, psd); -} - static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode) { /* If the underlying VFS doesn't have ACL support... */ @@ -624,7 +618,6 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(skel_set_nt_acl), SMB_VFS_OP_SET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, /* POSIX ACL operations */ -- cgit