s3/smbd: remove unneeded flags argument from SMB_VFS_OFFLOAD_WRITE_SEND
[bbaumbach/samba-autobuild/.git] / examples / VFS / skel_transparent.c
index b11e29c342a5c628981cbcb46c0be891fdd3f13b..d9123e091c1403b5188232802bfa661149072906 100644 (file)
@@ -48,18 +48,22 @@ static void skel_disconnect(vfs_handle_struct *handle)
        SMB_VFS_NEXT_DISCONNECT(handle);
 }
 
-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)
+static uint64_t skel_disk_free(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               uint64_t *bsize,
+                               uint64_t *dfree,
+                               uint64_t *dsize)
 {
-       return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
-                                     dfree, dsize);
+       return SMB_VFS_NEXT_DISK_FREE(handle, smb_fname, bsize, dfree, dsize);
 }
 
-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 struct smb_filename *smb_fname,
+                               enum SMB_QUOTA_TYPE qtype,
+                               unid_t id,
+                               SMB_DISK_QUOTA *dq)
 {
-       return SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, dq);
+       return SMB_VFS_NEXT_GET_QUOTA(handle, smb_fname, qtype, id, dq);
 }
 
 static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype,
@@ -77,10 +81,11 @@ static int skel_get_shadow_copy_data(vfs_handle_struct *handle,
                                                 labels);
 }
 
-static int skel_statvfs(struct vfs_handle_struct *handle, const char *path,
+static int skel_statvfs(struct vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
                        struct vfs_statvfs_struct *statbuf)
 {
-       return SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
+       return SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
 }
 
 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle,
@@ -95,14 +100,45 @@ static NTSTATUS skel_get_dfs_referrals(struct vfs_handle_struct *handle,
        return SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r);
 }
 
-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 SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
+}
+
+static NTSTATUS skel_snap_check_path(struct vfs_handle_struct *handle,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *service_path,
+                                    char **base_volume)
+{
+       return SMB_VFS_NEXT_SNAP_CHECK_PATH(handle, mem_ctx, service_path,
+                                           base_volume);
+}
+
+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 SMB_VFS_NEXT_SNAP_CREATE(handle, mem_ctx, base_volume, tstamp,
+                                       rw, base_path, snap_path);
+}
+
+static NTSTATUS skel_snap_delete(struct vfs_handle_struct *handle,
+                                TALLOC_CTX *mem_ctx,
+                                char *base_path,
+                                char *snap_path)
 {
-       return SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
+       return SMB_VFS_NEXT_SNAP_DELETE(handle, mem_ctx, base_path, snap_path);
 }
 
 static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
-                          const char *mask, uint32 attr)
+                          const char *mask, uint32_t attr)
 {
        return SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
 }
@@ -128,14 +164,17 @@ static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
        SMB_VFS_NEXT_REWINDDIR(handle, 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)
 {
-       return SMB_VFS_NEXT_MKDIR(handle, path, mode);
+       return SMB_VFS_NEXT_MKDIR(handle, smb_fname, mode);
 }
 
-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)
 {
-       return SMB_VFS_NEXT_RMDIR(handle, path);
+       return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
 }
 
 static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
@@ -169,7 +208,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 SMB_VFS_NEXT_CREATE_FILE(handle,
                                        req,
@@ -184,7 +225,8 @@ static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
                                        lease,
                                        allocation_size,
                                        private_flags,
-                                       sd, ea_list, result, pinfo);
+                                       sd, ea_list, result, pinfo,
+                                       in_context_blobs, out_context_blobs);
 }
 
 static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
@@ -206,7 +248,7 @@ static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp,
 
 struct skel_pread_state {
        ssize_t ret;
-       int err;
+       struct vfs_aio_state vfs_aio_state;
 };
 
 static void skel_pread_done(struct tevent_req *subreq);
@@ -240,20 +282,21 @@ static void skel_pread_done(struct tevent_req *subreq)
        struct skel_pread_state *state =
            tevent_req_data(req, struct skel_pread_state);
 
-       state->ret = SMB_VFS_PREAD_RECV(subreq, &state->err);
+       state->ret = SMB_VFS_PREAD_RECV(subreq, &state->vfs_aio_state);
        TALLOC_FREE(subreq);
        tevent_req_done(req);
 }
 
-static ssize_t skel_pread_recv(struct tevent_req *req, int *err)
+static ssize_t skel_pread_recv(struct tevent_req *req,
+                              struct vfs_aio_state *vfs_aio_state)
 {
        struct skel_pread_state *state =
            tevent_req_data(req, struct skel_pread_state);
 
-       if (tevent_req_is_unix_error(req, err)) {
+       if (tevent_req_is_unix_error(req, &vfs_aio_state->error)) {
                return -1;
        }
-       *err = state->err;
+       *vfs_aio_state = state->vfs_aio_state;
        return state->ret;
 }
 
@@ -271,7 +314,7 @@ static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp,
 
 struct skel_pwrite_state {
        ssize_t ret;
-       int err;
+       struct vfs_aio_state vfs_aio_state;
 };
 
 static void skel_pwrite_done(struct tevent_req *subreq);
@@ -306,20 +349,21 @@ static void skel_pwrite_done(struct tevent_req *subreq)
        struct skel_pwrite_state *state =
            tevent_req_data(req, struct skel_pwrite_state);
 
-       state->ret = SMB_VFS_PWRITE_RECV(subreq, &state->err);
+       state->ret = SMB_VFS_PWRITE_RECV(subreq, &state->vfs_aio_state);
        TALLOC_FREE(subreq);
        tevent_req_done(req);
 }
 
-static ssize_t skel_pwrite_recv(struct tevent_req *req, int *err)
+static ssize_t skel_pwrite_recv(struct tevent_req *req,
+                               struct vfs_aio_state *vfs_aio_state)
 {
        struct skel_pwrite_state *state =
            tevent_req_data(req, struct skel_pwrite_state);
 
-       if (tevent_req_is_unix_error(req, err)) {
+       if (tevent_req_is_unix_error(req, &vfs_aio_state->error)) {
                return -1;
        }
-       *err = state->err;
+       *vfs_aio_state = state->vfs_aio_state;
        return state->ret;
 }
 
@@ -356,7 +400,7 @@ static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
 
 struct skel_fsync_state {
        int ret;
-       int err;
+       struct vfs_aio_state vfs_aio_state;
 };
 
 static void skel_fsync_done(struct tevent_req *subreq);
@@ -388,20 +432,21 @@ static void skel_fsync_done(struct tevent_req *subreq)
        struct skel_fsync_state *state =
            tevent_req_data(req, struct skel_fsync_state);
 
-       state->ret = SMB_VFS_FSYNC_RECV(subreq, &state->err);
+       state->ret = SMB_VFS_FSYNC_RECV(subreq, &state->vfs_aio_state);
        TALLOC_FREE(subreq);
        tevent_req_done(req);
 }
 
-static int skel_fsync_recv(struct tevent_req *req, int *err)
+static int skel_fsync_recv(struct tevent_req *req,
+                          struct vfs_aio_state *vfs_aio_state)
 {
        struct skel_fsync_state *state =
            tevent_req_data(req, struct skel_fsync_state);
 
-       if (tevent_req_is_unix_error(req, err)) {
+       if (tevent_req_is_unix_error(req, &vfs_aio_state->error)) {
                return -1;
        }
-       *err = state->err;
+       *vfs_aio_state = state->vfs_aio_state;
        return state->ret;
 }
 
@@ -435,9 +480,11 @@ static int skel_unlink(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
 }
 
-static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
+static int skel_chmod(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       mode_t mode)
 {
-       return SMB_VFS_NEXT_CHMOD(handle, path, mode);
+       return SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode);
 }
 
 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp,
@@ -446,10 +493,12 @@ static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp,
        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)
+static int skel_chown(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       uid_t uid,
+                       gid_t gid)
 {
-       return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
+       return SMB_VFS_NEXT_CHOWN(handle, smb_fname, uid, gid);
 }
 
 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp,
@@ -458,20 +507,24 @@ static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp,
        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)
+static int skel_lchown(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       uid_t uid,
+                       gid_t gid)
 {
-       return SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid);
+       return SMB_VFS_NEXT_LCHOWN(handle, smb_fname, uid, gid);
 }
 
-static int skel_chdir(vfs_handle_struct *handle, const char *path)
+static int skel_chdir(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname)
 {
-       return SMB_VFS_NEXT_CHDIR(handle, path);
+       return SMB_VFS_NEXT_CHDIR(handle, smb_fname);
 }
 
-static char *skel_getwd(vfs_handle_struct *handle)
+static struct smb_filename *skel_getwd(vfs_handle_struct *handle,
+                                       TALLOC_CTX *ctx)
 {
-       return SMB_VFS_NEXT_GETWD(handle);
+       return SMB_VFS_NEXT_GETWD(handle, ctx);
 }
 
 static int skel_ntimes(vfs_handle_struct *handle,
@@ -488,7 +541,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)
 {
        return SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
 }
@@ -500,8 +553,8 @@ 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)
+                            struct files_struct *fsp, uint32_t share_mode,
+                            uint32_t access_mask)
 {
        return SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask);
 }
@@ -519,54 +572,48 @@ static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp,
        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)
-{
-       return SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath);
-}
-
-static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path,
-                            char *buf, size_t bufsiz)
+static int skel_symlink(vfs_handle_struct *handle,
+                       const char *link_contents,
+                       const struct smb_filename *new_smb_fname)
 {
-       return SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz);
+       return SMB_VFS_NEXT_SYMLINK(handle, link_contents, new_smb_fname);
 }
 
-static int skel_link(vfs_handle_struct *handle, const char *oldpath,
-                    const char *newpath)
+static int skel_vfs_readlink(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       char *buf,
+                       size_t bufsiz)
 {
-       return SMB_VFS_NEXT_LINK(handle, oldpath, newpath);
+       return SMB_VFS_NEXT_READLINK(handle, smb_fname, buf, bufsiz);
 }
 
-static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode,
-                     SMB_DEV_T dev)
+static int skel_link(vfs_handle_struct *handle,
+                       const struct smb_filename *old_smb_fname,
+                       const struct smb_filename *new_smb_fname)
 {
-       return SMB_VFS_NEXT_MKNOD(handle, path, mode, dev);
+       return SMB_VFS_NEXT_LINK(handle, old_smb_fname, new_smb_fname);
 }
 
-static char *skel_realpath(vfs_handle_struct *handle, const char *path)
+static int skel_mknod(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       mode_t mode,
+                       SMB_DEV_T dev)
 {
-       return SMB_VFS_NEXT_REALPATH(handle, path);
+       return SMB_VFS_NEXT_MKNOD(handle, smb_fname, mode, dev);
 }
 
-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)
+static struct smb_filename *skel_realpath(vfs_handle_struct *handle,
+                       TALLOC_CTX *ctx,
+                       const struct smb_filename *smb_fname)
 {
-       return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, path,
-                                        filter, subdir_filter, callback,
-                                        private_data, handle_p);
+       return SMB_VFS_NEXT_REALPATH(handle, ctx, smb_fname);
 }
 
-static int skel_chflags(vfs_handle_struct *handle, const char *path,
+static int skel_chflags(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
                        uint flags)
 {
-       return SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
+       return SMB_VFS_NEXT_CHFLAGS(handle, smb_fname, flags);
 }
 
 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
@@ -575,53 +622,142 @@ static struct file_id skel_file_id_create(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf);
 }
 
-struct skel_cc_state {
+struct skel_offload_read_state {
+       struct vfs_handle_struct *handle;
+       DATA_BLOB token;
+};
+
+static void skel_offload_read_done(struct tevent_req *subreq);
+
+static struct tevent_req *skel_offload_read_send(
+       TALLOC_CTX *mem_ctx,
+       struct tevent_context *ev,
+       struct vfs_handle_struct *handle,
+       struct files_struct *fsp,
+       uint32_t fsctl,
+       uint32_t ttl,
+       off_t offset,
+       size_t to_copy)
+{
+       struct tevent_req *req = NULL;
+       struct skel_offload_read_state *state = NULL;
+       struct tevent_req *subreq = NULL;
+
+       req = tevent_req_create(mem_ctx, &state, struct skel_offload_read_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       *state = (struct skel_offload_read_state) {
+               .handle = handle,
+       };
+
+       subreq = SMB_VFS_NEXT_OFFLOAD_READ_SEND(mem_ctx, ev, handle, fsp,
+                                               fsctl, ttl, offset, to_copy);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, skel_offload_read_done, req);
+       return req;
+}
+
+static void skel_offload_read_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct skel_offload_read_state *state = tevent_req_data(
+               req, struct skel_offload_read_state);
+       NTSTATUS status;
+
+       status = SMB_VFS_NEXT_OFFLOAD_READ_RECV(subreq,
+                                               state->handle,
+                                               state,
+                                               &state->token);
+       TALLOC_FREE(subreq);
+       if (tevent_req_nterror(req, status)) {
+               return;
+       }
+
+       tevent_req_done(req);
+       return;
+}
+
+static NTSTATUS skel_offload_read_recv(struct tevent_req *req,
+                                      struct vfs_handle_struct *handle,
+                                      TALLOC_CTX *mem_ctx,
+                                      DATA_BLOB *_token)
+{
+       struct skel_offload_read_state *state = tevent_req_data(
+               req, struct skel_offload_read_state);
+       DATA_BLOB token;
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       token = data_blob_talloc(mem_ctx,
+                                state->token.data,
+                                state->token.length);
+
+       tevent_req_received(req);
+
+       if (token.data == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       *_token = token;
+       return NT_STATUS_OK;
+}
+
+struct skel_offload_write_state {
        struct vfs_handle_struct *handle;
        off_t copied;
 };
-static void skel_copy_chunk_done(struct tevent_req *subreq);
+static void skel_offload_write_done(struct tevent_req *subreq);
 
-static struct tevent_req *skel_copy_chunk_send(struct vfs_handle_struct *handle,
+static struct tevent_req *skel_offload_write_send(struct vfs_handle_struct *handle,
                                               TALLOC_CTX *mem_ctx,
                                               struct tevent_context *ev,
-                                              struct files_struct *src_fsp,
-                                              off_t src_off,
+                                              uint32_t fsctl,
+                                              DATA_BLOB *token,
+                                              off_t transfer_offset,
                                               struct files_struct *dest_fsp,
                                               off_t dest_off,
                                               off_t num)
 {
        struct tevent_req *req;
        struct tevent_req *subreq;
-       struct skel_cc_state *cc_state;
+       struct skel_offload_write_state *state;
 
-       req = tevent_req_create(mem_ctx, &cc_state, struct skel_cc_state);
+       req = tevent_req_create(mem_ctx, &state, struct skel_offload_write_state);
        if (req == NULL) {
                return NULL;
        }
 
-       cc_state->handle = handle;
-       subreq = SMB_VFS_NEXT_COPY_CHUNK_SEND(handle, cc_state, ev,
-                                             src_fsp, src_off,
+       state->handle = handle;
+       subreq = SMB_VFS_NEXT_OFFLOAD_WRITE_SEND(handle, state, ev,
+                                             fsctl, token, transfer_offset,
                                              dest_fsp, dest_off, num);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
 
-       tevent_req_set_callback(subreq, skel_copy_chunk_done, req);
+       tevent_req_set_callback(subreq, skel_offload_write_done, req);
        return req;
 }
 
-static void skel_copy_chunk_done(struct tevent_req *subreq)
+static void skel_offload_write_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct skel_cc_state *cc_state
-                       = tevent_req_data(req, struct skel_cc_state);
+       struct skel_offload_write_state *state
+                       = tevent_req_data(req, struct skel_offload_write_state);
        NTSTATUS status;
 
-       status = SMB_VFS_NEXT_COPY_CHUNK_RECV(cc_state->handle,
+       status = SMB_VFS_NEXT_OFFLOAD_WRITE_RECV(state->handle,
                                              subreq,
-                                             &cc_state->copied);
+                                             &state->copied);
        TALLOC_FREE(subreq);
        if (tevent_req_nterror(req, status)) {
                return;
@@ -629,15 +765,15 @@ static void skel_copy_chunk_done(struct tevent_req *subreq)
        tevent_req_done(req);
 }
 
-static NTSTATUS skel_copy_chunk_recv(struct vfs_handle_struct *handle,
+static NTSTATUS skel_offload_write_recv(struct vfs_handle_struct *handle,
                                     struct tevent_req *req,
                                     off_t *copied)
 {
-       struct skel_cc_state *cc_state
-                       = tevent_req_data(req, struct skel_cc_state);
+       struct skel_offload_write_state *state
+                       = tevent_req_data(req, struct skel_offload_write_state);
        NTSTATUS status;
 
-       *copied = cc_state->copied;
+       *copied = state->copied;
        if (tevent_req_is_nterror(req, &status)) {
                tevent_req_received(req);
                return status;
@@ -668,14 +804,17 @@ static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
 
 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
                                struct files_struct *fsp,
-                               const char *fname,
+                               const struct smb_filename *smb_fname,
                                TALLOC_CTX *mem_ctx,
                                unsigned int *num_streams,
                                struct stream_struct **streams)
 {
        return SMB_VFS_NEXT_STREAMINFO(handle,
-                                      fsp,
-                                      fname, mem_ctx, num_streams, streams);
+                               fsp,
+                               smb_fname,
+                               mem_ctx,
+                               num_streams,
+                               streams);
 }
 
 static int skel_get_real_filename(struct vfs_handle_struct *handle,
@@ -688,9 +827,9 @@ static int skel_get_real_filename(struct vfs_handle_struct *handle,
 }
 
 static const char *skel_connectpath(struct vfs_handle_struct *handle,
-                                   const char *filename)
+                               const struct smb_filename *smb_fname)
 {
-       return SMB_VFS_NEXT_CONNECTPATH(handle, filename);
+       return SMB_VFS_NEXT_CONNECTPATH(handle, smb_fname);
 }
 
 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
@@ -767,8 +906,44 @@ static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle,
        return SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data);
 }
 
+static NTSTATUS skel_get_dos_attributes(struct vfs_handle_struct *handle,
+                               struct smb_filename *smb_fname,
+                               uint32_t *dosmode)
+{
+       return SMB_VFS_NEXT_GET_DOS_ATTRIBUTES(handle,
+                               smb_fname,
+                               dosmode);
+}
+
+static NTSTATUS skel_fget_dos_attributes(struct vfs_handle_struct *handle,
+                               struct files_struct *fsp,
+                               uint32_t *dosmode)
+{
+       return SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle,
+                               fsp,
+                               dosmode);
+}
+
+static NTSTATUS skel_set_dos_attributes(struct vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               uint32_t dosmode)
+{
+       return SMB_VFS_NEXT_SET_DOS_ATTRIBUTES(handle,
+                               smb_fname,
+                               dosmode);
+}
+
+static NTSTATUS skel_fset_dos_attributes(struct vfs_handle_struct *handle,
+                               struct files_struct *fsp,
+                               uint32_t dosmode)
+{
+       return SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle,
+                               fsp,
+                               dosmode);
+}
+
 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)
 {
@@ -777,25 +952,30 @@ 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)
 {
-       return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, mem_ctx,
-                                      ppdesc);
+       return SMB_VFS_NEXT_GET_NT_ACL(handle,
+                               smb_fname,
+                               security_info,
+                               mem_ctx,
+                               ppdesc);
 }
 
 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 SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
 }
 
-static int skel_chmod_acl(vfs_handle_struct *handle, const char *name,
-                         mode_t mode)
+static int skel_chmod_acl(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       mode_t mode)
 {
-       return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode);
+       return SMB_VFS_NEXT_CHMOD_ACL(handle, smb_fname, mode);
 }
 
 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
@@ -805,11 +985,11 @@ static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,
-                                      const char *path_p,
+                                      const struct smb_filename *smb_fname,
                                       SMB_ACL_TYPE_T type,
                                       TALLOC_CTX *mem_ctx)
 {
-       return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type, mem_ctx);
+       return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname, type, mem_ctx);
 }
 
 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle,
@@ -819,10 +999,12 @@ static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle,
 }
 
 static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle,
-                                     const char *path_p, TALLOC_CTX *mem_ctx,
-                                     char **blob_description, DATA_BLOB *blob)
+                               const struct smb_filename *smb_fname,
+                               TALLOC_CTX *mem_ctx,
+                               char **blob_description,
+                               DATA_BLOB *blob)
 {
-       return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, mem_ctx,
+       return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, smb_fname, mem_ctx,
                                                  blob_description, blob);
 }
 
@@ -834,10 +1016,13 @@ static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle,
                                                blob_description, blob);
 }
 
-static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name,
-                                SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
+static int skel_sys_acl_set_file(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               SMB_ACL_TYPE_T acltype,
+                               SMB_ACL_T theacl)
 {
-       return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
+       return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname,
+                       acltype, theacl);
 }
 
 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
@@ -847,15 +1032,18 @@ static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle,
-                                       const char *path)
+                                       const struct smb_filename *smb_fname)
 {
-       return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path);
+       return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, smb_fname);
 }
 
-static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path,
-                            const char *name, void *value, size_t size)
+static ssize_t skel_getxattr(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               const char *name,
+                               void *value,
+                               size_t size)
 {
-       return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size);
+       return SMB_VFS_NEXT_GETXATTR(handle, smb_fname, name, value, size);
 }
 
 static ssize_t skel_fgetxattr(vfs_handle_struct *handle,
@@ -865,10 +1053,12 @@ static ssize_t skel_fgetxattr(vfs_handle_struct *handle,
        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)
+static ssize_t skel_listxattr(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               char *list,
+                               size_t size)
 {
-       return SMB_VFS_NEXT_LISTXATTR(handle, path, list, size);
+       return SMB_VFS_NEXT_LISTXATTR(handle, smb_fname, list, size);
 }
 
 static ssize_t skel_flistxattr(vfs_handle_struct *handle,
@@ -878,10 +1068,11 @@ static ssize_t skel_flistxattr(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size);
 }
 
-static int skel_removexattr(vfs_handle_struct *handle, const char *path,
-                           const char *name)
+static int skel_removexattr(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       const char *name)
 {
-       return SMB_VFS_NEXT_REMOVEXATTR(handle, path, name);
+       return SMB_VFS_NEXT_REMOVEXATTR(handle, smb_fname, name);
 }
 
 static int skel_fremovexattr(vfs_handle_struct *handle,
@@ -890,11 +1081,15 @@ static int skel_fremovexattr(vfs_handle_struct *handle,
        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)
+static int skel_setxattr(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       const char *name,
+                       const void *value,
+                       size_t size,
+                       int flags)
 {
-       return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags);
+       return SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
+                       name, value, size, flags);
 }
 
 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
@@ -910,19 +1105,6 @@ static bool skel_aio_force(struct vfs_handle_struct *handle,
        return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
 }
 
-static bool skel_is_offline(struct vfs_handle_struct *handle,
-                           const struct smb_filename *fname,
-                           SMB_STRUCT_STAT *sbuf)
-{
-       return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
-}
-
-static int skel_set_offline(struct vfs_handle_struct *handle,
-                           const struct smb_filename *fname)
-{
-       return SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
-}
-
 /* VFS operations structure */
 
 struct vfs_fn_pointers skel_transparent_fns = {
@@ -937,6 +1119,9 @@ struct vfs_fn_pointers skel_transparent_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 */
 
@@ -995,11 +1180,12 @@ struct vfs_fn_pointers skel_transparent_fns = {
        .link_fn = skel_link,
        .mknod_fn = skel_mknod,
        .realpath_fn = skel_realpath,
-       .notify_watch_fn = skel_notify_watch,
        .chflags_fn = skel_chflags,
        .file_id_create_fn = skel_file_id_create,
-       .copy_chunk_send_fn = skel_copy_chunk_send,
-       .copy_chunk_recv_fn = skel_copy_chunk_recv,
+       .offload_read_send_fn = skel_offload_read_send,
+       .offload_read_recv_fn = skel_offload_read_recv,
+       .offload_write_send_fn = skel_offload_write_send,
+       .offload_write_recv_fn = skel_offload_write_recv,
        .get_compression_fn = skel_get_compression,
        .set_compression_fn = skel_set_compression,
 
@@ -1015,6 +1201,12 @@ struct vfs_fn_pointers skel_transparent_fns = {
        .fsctl_fn = skel_fsctl,
        .readdir_attr_fn = skel_readdir_attr,
 
+       /* DOS attributes. */
+       .get_dos_attributes_fn = skel_get_dos_attributes,
+       .fget_dos_attributes_fn = skel_fget_dos_attributes,
+       .set_dos_attributes_fn = skel_set_dos_attributes,
+       .fset_dos_attributes_fn = skel_fset_dos_attributes,
+
        /* NT ACL operations. */
 
        .fget_nt_acl_fn = skel_fget_nt_acl,
@@ -1046,13 +1238,10 @@ struct vfs_fn_pointers skel_transparent_fns = {
 
        /* aio operations */
        .aio_force_fn = skel_aio_force,
-
-       /* offline operations */
-       .is_offline_fn = skel_is_offline,
-       .set_offline_fn = skel_set_offline
 };
 
-NTSTATUS vfs_skel_transparent_init(void)
+static_decl_vfs;
+NTSTATUS vfs_skel_transparent_init(TALLOC_CTX *ctx)
 {
        return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent",
                                &skel_transparent_fns);