s3: Plumb smb_filename through SMB_VFS_NTIMES
[sfrench/samba-autobuild/.git] / examples / VFS / skel_transparent.c
index f4cb9b15ba2e048dfa7523e6c54ba707e1f03fc7..cce1d13d8de38960569e28c1ecd88a04182c350b 100644 (file)
@@ -46,9 +46,9 @@ static void skel_disconnect(vfs_handle_struct *handle)
        SMB_VFS_NEXT_DISCONNECT(handle);
 }
 
-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 SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, 
                                         dfree, dsize);
@@ -79,9 +79,11 @@ static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle,  const char *fnam
        return SMB_VFS_NEXT_OPENDIR(handle, 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 SMB_VFS_NEXT_READDIR(handle, dirp);
+       return SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
 }
 
 static void skel_seekdir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp, long offset)
@@ -114,14 +116,15 @@ static int skel_closedir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dir)
        return SMB_VFS_NEXT_CLOSEDIR(handle, 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_filename *smb_fname,
+                    files_struct *fsp, int flags, mode_t mode)
 {
-       return SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode);
+       return SMB_VFS_NEXT_OPEN(handle, smb_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)
@@ -159,9 +162,11 @@ static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct
        return SMB_VFS_NEXT_RECVFILE(handle, 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 SMB_VFS_NEXT_RENAME(handle, oldname, newname);
+       return SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);
 }
 
 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
@@ -169,9 +174,9 @@ static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
        return SMB_VFS_NEXT_FSYNC(handle, 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 SMB_VFS_NEXT_STAT(handle, fname, sbuf);
+       return SMB_VFS_NEXT_STAT(handle, smb_fname);
 }
 
 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
@@ -179,14 +184,15 @@ static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_S
        return SMB_VFS_NEXT_FSTAT(handle, 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 SMB_VFS_NEXT_LSTAT(handle, path, sbuf);
+       return SMB_VFS_NEXT_LSTAT(handle, smb_fname);
 }
 
-static int skel_unlink(vfs_handle_struct *handle,  const char *path)
+static int skel_unlink(vfs_handle_struct *handle,
+                      const struct smb_filename *smb_fname)
 {
-       return SMB_VFS_NEXT_UNLINK(handle, path);
+       return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
 }
 
 static int skel_chmod(vfs_handle_struct *handle,  const char *path, mode_t mode)
@@ -224,9 +230,11 @@ static char *skel_getwd(vfs_handle_struct *handle,  char *buf)
        return SMB_VFS_NEXT_GETWD(handle, 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 struct smb_filename *smb_fname,
+                      struct smb_file_time *ft)
 {
-       return SMB_VFS_NEXT_NTIMES(handle, path, ts);
+       return SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft);
 }
 
 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
@@ -284,9 +292,9 @@ 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)
 {
-       return SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode);
+       return SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf);
 }
 
 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
@@ -302,17 +310,11 @@ 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, SEC_DESC *psd)
+       uint32 security_info_sent, const SEC_DESC *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,
-       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 +626,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 */