s3: Plumb smb_filename through SMB_VFS_RENAME
[samba.git] / examples / VFS / skel_opaque.c
index 42154c47a66682c283e499e6b7d6755a65d25d3e..5d05be9aabb0b2ffee21bf9a774ac5e19038bae6 100644 (file)
@@ -52,9 +52,9 @@ static void skel_disconnect(vfs_handle_struct *handle, connection_struct *conn)
        return;
 }
 
-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)
+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);
@@ -85,9 +85,11 @@ static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle,  const char *fnam
        return vfswrap_opendir(NULL,  fname, mask, attr);
 }
 
-static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp)
+static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
+                                      SMB_STRUCT_DIR *dirp,
+                                      SMB_STRUCT_STAT *sbuf)
 {
-       return vfswrap_readdir(NULL,  dirp);
+       return vfswrap_readdir(NULL,  dirp, sbuf);
 }
 
 static void skel_seekdir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp, long offset)
@@ -120,14 +122,15 @@ static int skel_closedir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dir)
        return vfswrap_closedir(NULL,  dir);
 }
 
-static int skel_open(vfs_handle_struct *handle,  const char *fname, files_struct *fsp, int flags, mode_t mode)
+static int skel_open(vfs_handle_struct *handle,  struct smb_fname *smb_fname,
+                    files_struct *fsp, int flags, mode_t mode)
 {
-       return vfswrap_open(NULL,  fname, flags, mode);
+       return vfswrap_open(NULL, smb_fname, 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 vfswrap_close(NULL, fsp, fd);
+       return vfswrap_close(NULL, fsp);
 }
 
 static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
@@ -166,9 +169,11 @@ static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct
        return vfswrap_recvfile(NULL, fromfd, tofsp, offset, n);
 }
 
-static int skel_rename(vfs_handle_struct *handle,  const char *oldname, const char *newname)
+static int skel_rename(vfs_handle_struct *handle,
+                      const smb_filename *smb_fname_src,
+                      const smb_filename *smb_fname_dst)
 {
-       return vfswrap_rename(NULL,  oldname, newname);
+       return vfswrap_rename(NULL, smb_fname_src, smb_fname_dst);
 }
 
 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
@@ -176,9 +181,9 @@ static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
        return vfswrap_fsync(NULL, fsp);
 }
 
-static int skel_stat(vfs_handle_struct *handle,  const char *fname, SMB_STRUCT_STAT *sbuf)
+static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
 {
-       return vfswrap_stat(NULL,  fname, sbuf);
+       return vfswrap_stat(NULL, smb_fname);
 }
 
 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
@@ -186,9 +191,9 @@ static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_S
        return vfswrap_fstat(NULL, fsp, sbuf);
 }
 
-static int skel_lstat(vfs_handle_struct *handle,  const char *path, SMB_STRUCT_STAT *sbuf)
+static int skel_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
 {
-       return vfswrap_lstat(NULL,  path, sbuf);
+       return vfswrap_lstat(NULL, smb_fname);
 }
 
 static int skel_unlink(vfs_handle_struct *handle,  const char *path)
@@ -231,9 +236,9 @@ static char *skel_getwd(vfs_handle_struct *handle,  char *buf)
        return vfswrap_getwd(NULL,  buf);
 }
 
-static int skel_ntimes(vfs_handle_struct *handle,  const char *path, const struct timespec ts[2])
+static int skel_ntimes(vfs_handle_struct *handle,  const char *path, struct smb_file_time *ft)
 {
-       return vfswrap_ntimes(NULL,  path, ts);
+       return vfswrap_ntimes(NULL,  path, ft);
 }
 
 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
@@ -292,7 +297,7 @@ 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,
-                                         SMB_DEV_T dev, SMB_INO_T inode)
+                                         const SMB_STRUCT_STAT *sbuf)
 {
        struct file_id id_zero;
        ZERO_STRUCT(id_zero);
@@ -307,7 +312,7 @@ static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
        return 0;
 }
 
-static size_t skel_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
+static size_t skel_get_nt_acl(vfs_handle_struct *handle,
        const char *name, uint32 security_info, SEC_DESC **ppdesc)
 {
        errno = ENOSYS;
@@ -315,14 +320,7 @@ 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,
-       uint32 security_info_sent, SEC_DESC *psd)
-{
-       errno = ENOSYS;
-       return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-static NTSTATUS skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const
-       char *name, uint32 security_info_sent, SEC_DESC *psd)
+       uint32 security_info_sent, const SEC_DESC *psd)
 {
        errno = ENOSYS;
        return NT_STATUS_NOT_IMPLEMENTED;
@@ -595,11 +593,6 @@ static int skel_set_offline(struct vfs_handle_struct *handle, const char *path)
        return vfswrap_set_offline(NULL, path);
 }
 
-static bool skel_is_remotestorage(struct vfs_handle_struct *handle, const char *path)
-{
-       return vfswrap_is_remotestorage(NULL, path);
-}
-
 /* VFS operations structure */
 
 static vfs_op_tuple skel_op_tuples[] = {
@@ -667,7 +660,6 @@ static vfs_op_tuple skel_op_tuples[] = {
        {SMB_VFS_OP(skel_fget_nt_acl),                  SMB_VFS_OP_FGET_NT_ACL,         SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_get_nt_acl),                   SMB_VFS_OP_GET_NT_ACL,          SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_fset_nt_acl),                  SMB_VFS_OP_FSET_NT_ACL,         SMB_VFS_LAYER_OPAQUE},
-       {SMB_VFS_OP(skel_set_nt_acl),                   SMB_VFS_OP_SET_NT_ACL,          SMB_VFS_LAYER_OPAQUE},
 
        /* POSIX ACL operations */
 
@@ -724,7 +716,6 @@ static vfs_op_tuple skel_op_tuples[] = {
         /* offline operations */
        {SMB_VFS_OP(skel_is_offline),                   SMB_VFS_OP_IS_OFFLINE,                  SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_set_offline),                  SMB_VFS_OP_SET_OFFLINE,                 SMB_VFS_LAYER_OPAQUE},
-       {SMB_VFS_OP(skel_is_remotestorage),             SMB_VFS_OP_IS_REMOTESTORAGE,            SMB_VFS_LAYER_OPAQUE},
 
        {NULL,                                          SMB_VFS_OP_NOOP,                        SMB_VFS_LAYER_NOOP}
 };