s3: Add strict lock/unlock calls to the vfs layer to replace is_locked
[ira/wip.git] / source3 / include / vfs.h
index 6aea0ae6a08725742cb4122a68b1d0c20bfe7c2b..0c0e0938bd823fbaee9b43a1461ad79f171b2dcc 100644 (file)
 /* Leave at 25 - not yet released. Add create time to ntimes. -- tstecher. */
 /* Leave at 25 - not yet released. Add get_alloc_size call. -- tprouty. */
 /* 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. */
 
 #define SMB_VFS_INTERFACE_VERSION 25
 
@@ -141,17 +144,18 @@ struct vfs_statvfs_struct;
 struct smb_request;
 struct ea_list;
 struct smb_file_time;
+struct blocking_lock_record;
 
 /*
     Available VFS operations. These values must be in sync with vfs_ops struct
-    (struct vfs_fn_pointers and struct vfs_handle_pointers inside of struct vfs_ops). 
+    (struct vfs_fn_pointers and struct vfs_handle_pointers inside of struct vfs_ops).
     In particular, if new operations are added to vfs_ops, appropriate constants
     should be added to vfs_op_type so that order of them kept same as in vfs_ops.
 */
 
 typedef enum _vfs_op_type {
        SMB_VFS_OP_NOOP = -1,
-       
+
        /* Disk operations */
 
        SMB_VFS_OP_CONNECT = 0,
@@ -173,6 +177,7 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_MKDIR,
        SMB_VFS_OP_RMDIR,
        SMB_VFS_OP_CLOSEDIR,
+       SMB_VFS_OP_INIT_SEARCH_OP,
 
        /* File operations */
 
@@ -216,6 +221,11 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_FILE_ID_CREATE,
        SMB_VFS_OP_STREAMINFO,
        SMB_VFS_OP_GET_REAL_FILENAME,
+       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. */
 
@@ -250,7 +260,7 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_SYS_ACL_FREE_TEXT,
        SMB_VFS_OP_SYS_ACL_FREE_ACL,
        SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER,
-       
+
        /* EA operations. */
        SMB_VFS_OP_GETXATTR,
        SMB_VFS_OP_LGETXATTR,
@@ -313,6 +323,7 @@ struct vfs_ops {
                int (*mkdir)(struct vfs_handle_struct *handle, const char *path, mode_t mode);
                int (*rmdir)(struct vfs_handle_struct *handle, const char *path);
                int (*closedir)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dir);
+               void (*init_search_op)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);
 
                /* File operations */
 
@@ -375,7 +386,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,
@@ -390,6 +402,30 @@ struct vfs_ops {
                                         TALLOC_CTX *mem_ctx,
                                         char **found_name);
 
+               NTSTATUS (*brl_lock_windows)(struct vfs_handle_struct *handle,
+                                            struct byte_range_lock *br_lck,
+                                            struct lock_struct *plock,
+                                            bool blocking_lock,
+                                            struct blocking_lock_record *blr);
+
+               bool (*brl_unlock_windows)(struct vfs_handle_struct *handle,
+                                          struct messaging_context *msg_ctx,
+                                          struct byte_range_lock *br_lck,
+                                          const struct lock_struct *plock);
+
+               bool (*brl_cancel_windows)(struct vfs_handle_struct *handle,
+                                          struct byte_range_lock *br_lck,
+                                          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,
@@ -484,6 +520,7 @@ struct vfs_ops {
                struct vfs_handle_struct *mkdir;
                struct vfs_handle_struct *rmdir;
                struct vfs_handle_struct *closedir;
+               struct vfs_handle_struct *init_search_op;
 
                /* File operations */
 
@@ -527,6 +564,11 @@ 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 *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. */