VFS: Modify opendir to take a const struct smb_filename * instead of const char *
[metze/samba/wip.git] / examples / VFS / skel_opaque.c
index 6e15a0675b773c1876586d71532df0148b5e8d16..ae165a6f5ab37724bf613d5816ce4f395052ef1a 100644 (file)
@@ -45,7 +45,7 @@ static void skel_disconnect(vfs_handle_struct *handle)
 }
 
 static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path,
-                              bool small_query, uint64_t *bsize,
+                              uint64_t *bsize,
                               uint64_t *dfree, uint64_t *dsize)
 {
        *bsize = 0;
@@ -54,8 +54,9 @@ static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path,
        return 0;
 }
 
-static int skel_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype,
-                         unid_t id, SMB_DISK_QUOTA *dq)
+static int skel_get_quota(vfs_handle_struct *handle, const char *path,
+                         enum SMB_QUOTA_TYPE qtype, unid_t id,
+                         SMB_DISK_QUOTA *dq)
 {
        errno = ENOSYS;
        return -1;
@@ -96,14 +97,43 @@ static NTSTATUS skel_get_dfs_referrals(struct vfs_handle_struct *handle,
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
-static DIR *skel_opendir(vfs_handle_struct *handle, const char *fname,
-                        const char *mask, uint32 attr)
+static DIR *skel_opendir(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       const char *mask,
+                       uint32_t attr)
 {
        return NULL;
 }
 
+static NTSTATUS skel_snap_check_path(struct vfs_handle_struct *handle,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *service_path,
+                                    char **base_volume)
+{
+       return NT_STATUS_NOT_SUPPORTED;
+}
+
+static NTSTATUS skel_snap_create(struct vfs_handle_struct *handle,
+                                TALLOC_CTX *mem_ctx,
+                                const char *base_volume,
+                                time_t *tstamp,
+                                bool rw,
+                                char **base_path,
+                                char **snap_path)
+{
+       return NT_STATUS_NOT_SUPPORTED;
+}
+
+static NTSTATUS skel_snap_delete(struct vfs_handle_struct *handle,
+                                TALLOC_CTX *mem_ctx,
+                                char *base_path,
+                                char *snap_path)
+{
+       return NT_STATUS_NOT_SUPPORTED;
+}
+
 static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
-                          const char *mask, uint32 attr)
+                          const char *mask, uint32_t attr)
 {
        return NULL;
 }
@@ -129,13 +159,16 @@ static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
        ;
 }
 
-static int skel_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode)
+static int skel_mkdir(vfs_handle_struct *handle,
+               const struct smb_filename *smb_fname,
+               mode_t mode)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static int skel_rmdir(vfs_handle_struct *handle, const char *path)
+static int skel_rmdir(vfs_handle_struct *handle,
+               const struct smb_filename *smb_fname)
 {
        errno = ENOSYS;
        return -1;
@@ -174,7 +207,9 @@ static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
                                 uint32_t private_flags,
                                 struct security_descriptor *sd,
                                 struct ea_list *ea_list,
-                                files_struct **result, int *pinfo)
+                                files_struct **result, int *pinfo,
+                                const struct smb2_create_blobs *in_context_blobs,
+                                struct smb2_create_blobs *out_context_blobs)
 {
        return NT_STATUS_NOT_IMPLEMENTED;
 }
@@ -391,7 +426,7 @@ static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
-                         enum vfs_fallocate_mode mode, off_t offset, off_t len)
+                         uint32_t mode, off_t offset, off_t len)
 {
        errno = ENOSYS;
        return -1;
@@ -406,7 +441,7 @@ static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op,
 
 static int skel_kernel_flock(struct vfs_handle_struct *handle,
                             struct files_struct *fsp,
-                            uint32 share_mode, uint32 access_mask)
+                            uint32_t share_mode, uint32_t access_mask)
 {
        errno = ENOSYS;
        return -1;
@@ -461,19 +496,6 @@ static char *skel_realpath(vfs_handle_struct *handle, const char *path)
        return NULL;
 }
 
-static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
-                                 struct sys_notify_context *ctx,
-                                 const char *path,
-                                 uint32_t *filter,
-                                 uint32_t *subdir_filter,
-                                 void (*callback) (struct sys_notify_context *
-                                                   ctx, void *private_data,
-                                                   struct notify_event *ev),
-                                 void *private_data, void *handle_p)
-{
-       return NT_STATUS_NOT_IMPLEMENTED;
-}
-
 static int skel_chflags(vfs_handle_struct *handle, const char *path,
                        uint flags)
 {
@@ -642,7 +664,7 @@ static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle,
 }
 
 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                                uint32 security_info,
+                                uint32_t security_info,
                                 TALLOC_CTX *mem_ctx,
                                 struct security_descriptor **ppdesc)
 {
@@ -650,7 +672,8 @@ static NTSTATUS skel_fget_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,
+                               const struct smb_filename *smb_fname,
+                               uint32_t security_info,
                                TALLOC_CTX *mem_ctx,
                                struct security_descriptor **ppdesc)
 {
@@ -658,7 +681,7 @@ static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
 }
 
 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                                uint32 security_info_sent,
+                                uint32_t security_info_sent,
                                 const struct security_descriptor *psd)
 {
        return NT_STATUS_NOT_IMPLEMENTED;
@@ -828,6 +851,9 @@ struct vfs_fn_pointers skel_opaque_fns = {
        .statvfs_fn = skel_statvfs,
        .fs_capabilities_fn = skel_fs_capabilities,
        .get_dfs_referrals_fn = skel_get_dfs_referrals,
+       .snap_check_path_fn = skel_snap_check_path,
+       .snap_create_fn = skel_snap_create,
+       .snap_delete_fn = skel_snap_delete,
 
        /* Directory operations */
 
@@ -886,7 +912,6 @@ struct vfs_fn_pointers skel_opaque_fns = {
        .link_fn = skel_link,
        .mknod_fn = skel_mknod,
        .realpath_fn = skel_realpath,
-       .notify_watch_fn = skel_notify_watch,
        .chflags_fn = skel_chflags,
        .file_id_create_fn = skel_file_id_create,
        .copy_chunk_send_fn = skel_copy_chunk_send,
@@ -943,6 +968,7 @@ struct vfs_fn_pointers skel_opaque_fns = {
        .set_offline_fn = skel_set_offline
 };
 
+static_decl_vfs;
 NTSTATUS vfs_skel_opaque_init(void)
 {
        return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_opaque",