s3: Plumb smb_filename through SMB_VFS_RENAME
[samba.git] / source3 / include / vfs.h
index ffa1a95ed0281326a2c8fe3801cd33af73ae8cd2..c3580da5d0fd0589eb9fad2f7a5a4e450cb310c4 100644 (file)
 /* Leave at 25 - not yet released. Add SMB_STRUCT_STAT to readdir. - sdann */
 /* Leave at 25 - not yet released. Add init_search_op call. - sdann */
 /* Leave at 25 - not yet released. Add locking calls. -- zkirsch. */
+/* Leave at 25 - not yet released. Add strict locking calls. -- drichards. */
+/* Changed to version 26 - Plumb struct smb_filename to SMB_VFS_CREATE_FILE,
+                          SMB_VFS_OPEN, SMB_VFS_STAT, SMB_VFS_LSTAT,
+                          SMB_VFS_RENAME.  */
 
-#define SMB_VFS_INTERFACE_VERSION 25
+#define SMB_VFS_INTERFACE_VERSION 26
 
 
 /* to bug old modules which are trying to compile with the old functions */
@@ -144,6 +148,7 @@ struct smb_request;
 struct ea_list;
 struct smb_file_time;
 struct blocking_lock_record;
+struct smb_filename;
 
 /*
     Available VFS operations. These values must be in sync with vfs_ops struct
@@ -220,9 +225,12 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_FILE_ID_CREATE,
        SMB_VFS_OP_STREAMINFO,
        SMB_VFS_OP_GET_REAL_FILENAME,
+       SMB_VFS_OP_CONNECTPATH,
        SMB_VFS_OP_BRL_LOCK_WINDOWS,
        SMB_VFS_OP_BRL_UNLOCK_WINDOWS,
        SMB_VFS_OP_BRL_CANCEL_WINDOWS,
+       SMB_VFS_OP_STRICT_LOCK,
+       SMB_VFS_OP_STRICT_UNLOCK,
 
        /* NT ACL operations. */
 
@@ -324,12 +332,13 @@ struct vfs_ops {
 
                /* File operations */
 
-               int (*open)(struct vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode);
+               int (*open)(struct vfs_handle_struct *handle,
+                           struct smb_filename *smb_fname, files_struct *fsp,
+                           int flags, mode_t mode);
                NTSTATUS (*create_file)(struct vfs_handle_struct *handle,
                                        struct smb_request *req,
                                        uint16_t root_dir_fid,
-                                       const char *fname,
-                                       uint32_t create_file_flags,
+                                       struct smb_filename *smb_fname,
                                        uint32_t access_mask,
                                        uint32_t share_access,
                                        uint32_t create_disposition,
@@ -340,8 +349,7 @@ struct vfs_ops {
                                        struct security_descriptor *sd,
                                        struct ea_list *ea_list,
                                        files_struct **result,
-                                       int *pinfo,
-                                       SMB_STRUCT_STAT *psbuf);
+                                       int *pinfo);
                int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp);
                ssize_t (*vfs_read)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n);
                ssize_t (*pread)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, SMB_OFF_T offset);
@@ -350,11 +358,13 @@ struct vfs_ops {
                SMB_OFF_T (*lseek)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset, int whence);
                ssize_t (*sendfile)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
                ssize_t (*recvfile)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t count);
-               int (*rename)(struct vfs_handle_struct *handle, const char *oldname, const char *newname);
+               int (*rename)(struct vfs_handle_struct *handle,
+                             const struct smb_filename *smb_fname_src,
+                             const struct smb_filename *smb_fname_dst);
                int (*fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp);
-               int (*stat)(struct vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf);
+               int (*stat)(struct vfs_handle_struct *handle, struct smb_filename *smb_fname);
                int (*fstat)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_STAT *sbuf);
-               int (*lstat)(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf);
+               int (*lstat)(struct vfs_handle_struct *handle, struct smb_filename *smb_filename);
                uint64_t (*get_alloc_size)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf);
                int (*unlink)(struct vfs_handle_struct *handle, const char *path);
                int (*chmod)(struct vfs_handle_struct *handle, const char *path, mode_t mode);
@@ -383,7 +393,8 @@ struct vfs_ops {
                                                          struct notify_event *ev),
                                         void *private_data, void *handle_p);
                int (*chflags)(struct vfs_handle_struct *handle, const char *path, unsigned int flags);
-               struct file_id (*file_id_create)(struct vfs_handle_struct *handle, SMB_DEV_T dev, SMB_INO_T inode);
+               struct file_id (*file_id_create)(struct vfs_handle_struct *handle,
+                                                const SMB_STRUCT_STAT *sbuf);
 
                NTSTATUS (*streaminfo)(struct vfs_handle_struct *handle,
                                       struct files_struct *fsp,
@@ -398,6 +409,9 @@ struct vfs_ops {
                                         TALLOC_CTX *mem_ctx,
                                         char **found_name);
 
+               const char *(*connectpath)(struct vfs_handle_struct *handle,
+                                          const char *filename);
+
                NTSTATUS (*brl_lock_windows)(struct vfs_handle_struct *handle,
                                             struct byte_range_lock *br_lck,
                                             struct lock_struct *plock,
@@ -414,6 +428,14 @@ struct vfs_ops {
                                           struct lock_struct *plock,
                                           struct blocking_lock_record *blr);
 
+               bool (*strict_lock)(struct vfs_handle_struct *handle,
+                                       struct files_struct *fsp,
+                                       struct lock_struct *plock);
+
+               void (*strict_unlock)(struct vfs_handle_struct *handle,
+                                       struct files_struct *fsp,
+                                       struct lock_struct *plock);
+
                /* NT ACL operations. */
 
                NTSTATUS (*fget_nt_acl)(struct vfs_handle_struct *handle,
@@ -552,9 +574,12 @@ struct vfs_ops {
                struct vfs_handle_struct *file_id_create;
                struct vfs_handle_struct *streaminfo;
                struct vfs_handle_struct *get_real_filename;
+               struct vfs_handle_struct *connectpath;
                struct vfs_handle_struct *brl_lock_windows;
                struct vfs_handle_struct *brl_unlock_windows;
                struct vfs_handle_struct *brl_cancel_windows;
+               struct vfs_handle_struct *strict_lock;
+               struct vfs_handle_struct *strict_unlock;
 
                /* NT ACL operations. */