[SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-728-g8762254

Jeremy Allison jra at samba.org
Fri Sep 25 23:19:11 MDT 2009


The branch, master has been updated
       via  8762254c7e51fe6855f3bc1e401adc7f435c02d7 (commit)
       via  2f1835eb8c8d9b6419c2e2e63238a8242b84cf4d (commit)
      from  2d13513796e4a88130a7fc57bcb4f047f122e824 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 8762254c7e51fe6855f3bc1e401adc7f435c02d7
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 25 22:19:27 2009 -0700

    Fix the opaque sample module for the new VFS interface.
    Jeremy.

commit 2f1835eb8c8d9b6419c2e2e63238a8242b84cf4d
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 25 22:02:18 2009 -0700

    Update the advice for the new VFS system.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 examples/VFS/skel_opaque.c      |  605 +++++++++++++++++++++++++--------------
 examples/VFS/skel_transparent.c |    7 +-
 2 files changed, 392 insertions(+), 220 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index a0cb533..243621e 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -1,10 +1,11 @@
 /* 
- * Skeleton VFS module.  Implements passthrough operation of all VFS
- * calls to disk functions.
+ * Skeleton VFS module.  Implements dummy versions of all VFS
+ * functions.
  *
  * Copyright (C) Tim Potter, 1999-2000
  * Copyright (C) Alexander Bokovoy, 2002
  * Copyright (C) Stefan (metze) Metzmacher, 2003
+ * Copyright (C) Jeremy Allison 2009
  *
  * 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
@@ -28,261 +29,336 @@
  */
 
 /* If you take this file as template for your module
- * please make sure that you remove all vfswrap_* functions and 
- * implement your own function!!
- *
- * for functions you didn't want to provide implement dummy functions
- * witch return ERROR and errno = ENOSYS; !
- *
- * --metze
- */
-
-/* NOTE: As of approximately Samba 3.0.24, the vfswrap_* functions are not
- * global symbols. They are included here only as an pointer that opaque
- * operations should not call further into the VFS.
+ * you must re-implement every function.
  */
 
 static int skel_connect(vfs_handle_struct *handle,  const char *service, const char *user)    
 {
-	return 0;
+	errno = ENOSYS;
+	return -1;
 }
 
-static void skel_disconnect(vfs_handle_struct *handle, connection_struct *conn)
+static void skel_disconnect(vfs_handle_struct *handle)
 {
-	return;
+	;
 }
 
 static uint64_t skel_disk_free(vfs_handle_struct *handle,  const char *path,
 	bool small_query, uint64_t *bsize,
 	uint64_t *dfree, uint64_t *dsize)
 {
-	return vfswrap_disk_free(NULL,  path, small_query, bsize, 
-					 dfree, dsize);
+	*bsize = 0;
+	*dfree = 0;
+	*dsize = 0;
+	return 0;
 }
 
 static int skel_get_quota(vfs_handle_struct *handle,  enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
 {
-	return vfswrap_get_quota(NULL,  qtype, id, dq);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_set_quota(vfs_handle_struct *handle,  enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
 {
-	return vfswrap_set_quota(NULL,  qtype, id, dq);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels)
 {
-	return vfswrap_get_shadow_copy_data(NULL, fsp, shadow_copy_data, labels);
+	errno = ENOSYS;
+	return -1;
 }
 
-static int skel_statvfs(struct vfs_handle_struct *handle,  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 vfswrap_statvfs(NULL,  path, statbuf);
+	errno = ENOSYS;
+	return -1;
+}
+
+static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res)
+{
+	return 0;
 }
 
 static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle,  const char *fname, const char *mask, uint32 attr)
 {
-	return vfswrap_opendir(NULL,  fname, mask, attr);
+	return NULL;
 }
 
 static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
 				       SMB_STRUCT_DIR *dirp,
 				       SMB_STRUCT_STAT *sbuf)
 {
-	return vfswrap_readdir(NULL,  dirp, sbuf);
+	return NULL;
 }
 
 static void skel_seekdir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp, long offset)
 {
-	vfswrap_seekdir(NULL,  dirp, offset);
+	;
 }
 
 static long skel_telldir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp)
 {
-	return vfswrap_telldir(NULL,  dirp);
+	return (long)-1;
 }
 
-static void skel_rewinddir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp)
+static void skel_rewind_dir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
 {
-	vfswrap_rewinddir(NULL,  dirp);
+	;
 }
 
 static int skel_mkdir(vfs_handle_struct *handle,  const char *path, mode_t mode)
 {
-	return vfswrap_mkdir(NULL,  path, mode);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_rmdir(vfs_handle_struct *handle,  const char *path)
 {
-	return vfswrap_rmdir(NULL,  path);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_closedir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dir)
 {
-	return vfswrap_closedir(NULL,  dir);
+	errno = ENOSYS;
+	return -1;
 }
 
-static int skel_open(vfs_handle_struct *handle,  struct smb_fname *smb_fname,
+static void skel_init_search_op(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+{
+	;
+}
+
+static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
 		     files_struct *fsp, int flags, mode_t mode)
 {
-	return vfswrap_open(NULL, smb_fname, flags, mode);
+	errno = ENOSYS;
+	return -1;
+}
+
+static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
+                                struct smb_request *req,
+                                uint16_t root_dir_fid,
+                                struct smb_filename *smb_fname,
+                                uint32_t access_mask,
+                                uint32_t share_access,
+                                uint32_t create_disposition,
+                                uint32_t create_options,
+                                uint32_t file_attributes,
+                                uint32_t oplock_request,
+                                uint64_t allocation_size,
+                                struct security_descriptor *sd,
+                                struct ea_list *ea_list,
+                                files_struct **result,
+                                int *pinfo)
+{
+	return NT_STATUS_NOT_IMPLEMENTED;
 }
 
-static int skel_close(vfs_handle_struct *handle, files_struct *fsp)
+static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
 {
-	return vfswrap_close(NULL, fsp);
+	errno = ENOSYS;
+	return -1;
 }
 
-static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
+static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
 {
-	return vfswrap_read(NULL, fsp, data, n);
+	errno = ENOSYS;
+	return -1;
 }
 
-static ssize_t skel_pread(vfs_handle_struct *handle, struct files_struct *fsp, 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 vfswrap_pread(NULL, fsp, data, n, offset);
+	errno = ENOSYS;
+	return -1;
 }
 
 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
 {
-	return vfswrap_write(NULL, fsp, data, n);
+	errno = ENOSYS;
+	return -1;
 }
 
-ssize_t skel_pwrite(vfs_handle_struct *handle, struct files_struct *fsp, 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 vfswrap_pwrite(NULL, fsp, data, n, offset);
+	errno = ENOSYS;
+	return -1;
 }
 
 static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
 {
-	return vfswrap_lseek(NULL, fsp, offset, whence);
+	errno = ENOSYS;
+	return (SMB_OFF_T)-1;
 }
 
-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)
+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 vfswrap_sendfile(NULL, tofd, fromfsp, hdr, offset, n);
+	errno = ENOSYS;
+	return -1;
 }
 
 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
 {
-	return vfswrap_recvfile(NULL, fromfd, tofsp, offset, n);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_rename(vfs_handle_struct *handle,
-		       const smb_filename *smb_fname_src,
-		       const smb_filename *smb_fname_dst)
+		       const struct smb_filename *smb_fname_src,
+		       const struct smb_filename *smb_fname_dst)
 {
-	return vfswrap_rename(NULL, smb_fname_src, smb_fname_dst);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
 {
-	return vfswrap_fsync(NULL, fsp);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
 {
-	return vfswrap_stat(NULL, smb_fname);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
 {
-	return vfswrap_fstat(NULL, fsp, sbuf);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
 {
-	return vfswrap_lstat(NULL, smb_fname);
+	errno = ENOSYS;
+	return -1;
+}
+
+static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
+{
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_unlink(vfs_handle_struct *handle,
 		       const struct smb_filename *smb_fname)
 {
-	return vfswrap_unlink(NULL, smb_fname);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_chmod(vfs_handle_struct *handle,  const char *path, mode_t mode)
 {
-	return vfswrap_chmod(NULL,  path, mode);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
 {
-	return vfswrap_fchmod(NULL, fsp, mode);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_chown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
 {
-	return vfswrap_chown(NULL,  path, uid, gid);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
 {
-	return vfswrap_fchown(NULL, fsp, uid, gid);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_lchown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
 {
-	return vfswrap_lchown(NULL,  path, uid, gid);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_chdir(vfs_handle_struct *handle,  const char *path)
 {
-	return vfswrap_chdir(NULL,  path);
+	errno = ENOSYS;
+	return -1;
 }
 
 static char *skel_getwd(vfs_handle_struct *handle,  char *buf)
 {
-	return vfswrap_getwd(NULL,  buf);
+	errno = ENOSYS;
+	return NULL;
 }
 
 static int skel_ntimes(vfs_handle_struct *handle,
 		       const struct smb_filename *smb_fname,
 		       struct smb_file_time *ft)
 {
-	return vfswrap_ntimes(NULL, smb_fname, ft);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
 {
-	return vfswrap_ftruncate(NULL, fsp, offset);
+	errno = ENOSYS;
+	return -1;
 }
 
 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
 {
-	return vfswrap_lock(NULL, fsp, op, offset, count, type);
+	errno = ENOSYS;
+	return false;
+}
+
+static int skel_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode)
+{
+	errno = ENOSYS;
+	return -1;
+}
+
+static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype)
+{
+	errno = ENOSYS;
+	return -1;
 }
 
 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 vfswrap_getlock(NULL, fsp, poffset, pcount, ptype, ppid);
+	errno = ENOSYS;
+	return false;
 }
 
 static int skel_symlink(vfs_handle_struct *handle,  const char *oldpath, const char *newpath)
 {
-	return vfswrap_symlink(NULL,  oldpath, newpath);
+	errno = ENOSYS;
+	return -1;
 }
 
-
-static int skel_readlink(vfs_handle_struct *handle,  const char *path, char *buf, size_t bufsiz)
+static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz)
 {
-	return vfswrap_readlink(NULL,  path, buf, bufsiz);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_link(vfs_handle_struct *handle,  const char *oldpath, const char *newpath)
 {
-	return vfswrap_link(NULL,  oldpath, newpath);
+	errno = ENOSYS;
+	return -1;
 }
 
 static int skel_mknod(vfs_handle_struct *handle,  const char *path, mode_t mode, SMB_DEV_T dev)
 {
-	return vfswrap_mknod(NULL,  path, mode, dev);
+	errno = ENOSYS;
+	return -1;
 }
 
 static char *skel_realpath(vfs_handle_struct *handle,  const char *path, char *resolved_path)
 {
-	return vfswrap_realpath(NULL,  path, resolved_path);
+	errno = ENOSYS;
+	return NULL;
 }
 
 static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
@@ -290,7 +366,7 @@ static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
 	    void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev),
 	    void *private_data, void *handle_p)
 {
-	return NT_STATUS_NOT_SUPPORTED;
+	return NT_STATUS_NOT_IMPLEMENTED;
 }
 
 static int skel_chflags(vfs_handle_struct *handle,  const char *path, uint flags)
@@ -302,30 +378,103 @@ static int skel_chflags(vfs_handle_struct *handle,  const char *path, uint flags
 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
 					  const SMB_STRUCT_STAT *sbuf)
 {
-	struct file_id id_zero;
-	ZERO_STRUCT(id_zero);
+	struct file_id id;
+	ZERO_STRUCT(id);
 	errno = ENOSYS;
-	return id_zero;
+	return id;
 }
 
-static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-	uint32 security_info, SEC_DESC **ppdesc)
+static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
+				struct files_struct *fsp,
+				const char *fname,
+				TALLOC_CTX *mem_ctx,
+				unsigned int *num_streams,
+				struct stream_struct **streams)
+{
+	return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static int skel_get_real_filename(struct vfs_handle_struct *handle,
+				const char *path,
+				const char *name,
+				TALLOC_CTX *mem_ctx,
+				char **found_name)
 {
 	errno = ENOSYS;
-	return 0;
+	return -1;
 }
 
-static size_t skel_get_nt_acl(vfs_handle_struct *handle,
-	const char *name, uint32 security_info, SEC_DESC **ppdesc)
+static const char *skel_connectpath(struct vfs_handle_struct *handle,
+				const char *filename)
 {
 	errno = ENOSYS;
-	return 0;
+	return NULL;
+}
+
+static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
+				struct byte_range_lock *br_lck,
+				struct lock_struct *plock,
+				bool blocking_lock,
+				struct blocking_lock_record *blr)
+{
+	return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
+				struct messaging_context *msg_ctx,
+				struct byte_range_lock *br_lck,
+				const struct lock_struct *plock)
+{
+	errno = ENOSYS;
+	return false;
+}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list