s3: OneFS implementation of change notify
[ira/wip.git] / source3 / modules / onefs.h
index 2044ebec48c4a965a81a7e747887062a3a2da113..ea452a454d84fcb08542f5d9b49c918ccce5b80d 100644 (file)
@@ -22,7 +22,7 @@
 #define _ONEFS_H
 
 #include "includes.h"
-
+#include "oplock_onefs.h"
 #include <sys/isi_acl.h>
 
 /* OneFS Module smb.conf parameters and defaults */
@@ -41,26 +41,36 @@ enum onefs_acl_wire_format
 #define PARM_ONEFS_TYPE "onefs"
 #define PARM_ACL_WIRE_FORMAT "acl wire format"
 #define PARM_ACL_WIRE_FORMAT_DEFAULT ACL_FORMAT_WINDOWS_SD
-#define PARM_SIMPLE_FILE_SHARING_COMPATIBILITY_MODE "simple file sharing compatibility mode"
-#define PARM_SIMPLE_FILE_SHARING_COMPATIBILITY_MODE_DEFAULT false
+#define PARM_ATIME_NOW         "atime now files"
+#define PARM_ATIME_NOW_DEFAULT  NULL
+#define PARM_ATIME_STATIC      "atime static files"
+#define PARM_ATIME_STATIC_DEFAULT NULL
+#define PARM_ATIME_SLOP                "atime now slop"
+#define PARM_ATIME_SLOP_DEFAULT         0
 #define PARM_CREATOR_OWNER_GETS_FULL_CONTROL "creator owner gets full control"
 #define PARM_CREATOR_OWNER_GETS_FULL_CONTROL_DEFAULT true
+#define PARM_CTIME_NOW         "ctime now files"
+#define PARM_CTIME_NOW_DEFAULT  NULL
+#define PARM_CTIME_SLOP                "ctime now slop"
+#define PARM_CTIME_SLOP_DEFAULT        0
+#define PARM_IGNORE_SACLS "ignore sacls"
+#define PARM_IGNORE_SACLS_DEFAULT false
+#define PARM_MTIME_NOW         "mtime now files"
+#define PARM_MTIME_NOW_DEFAULT NULL
+#define PARM_MTIME_STATIC      "mtime static files"
+#define PARM_MTIME_STATIC_DEFAULT NULL
+#define PARM_MTIME_SLOP                "mtime now slop"
+#define PARM_MTIME_SLOP_DEFAULT        0
+#define PARM_USE_READDIRPLUS "use readdirplus"
+#define PARM_USE_READDIRPLUS_DEFAULT true
+#define PARM_SIMPLE_FILE_SHARING_COMPATIBILITY_MODE "simple file sharing compatibility mode"
+#define PARM_SIMPLE_FILE_SHARING_COMPATIBILITY_MODE_DEFAULT false
 #define PARM_UNMAPPABLE_SIDS_DENY_EVERYONE "unmappable sids deny everyone"
 #define PARM_UNMAPPABLE_SIDS_DENY_EVERYONE_DEFAULT false
 #define PARM_UNMAPPABLE_SIDS_IGNORE "ignore unmappable sids"
 #define PARM_UNMAPPABLE_SIDS_IGNORE_DEFAULT false
 #define PARM_UNMAPPABLE_SIDS_IGNORE_LIST "unmappable sids ignore list"
 #define PARM_UNMAPPABLE_SIDS_IGNORE_LIST_DEFAULT NULL
-#define PARM_IGNORE_SACL "ignore sacl"
-#define PARM_IGNORE_SACL_DEFAULT false
-#define PARM_ATIME_NOW         "atime now files"
-#define PARM_ATIME_SLOP                "atime now slop"
-#define PARM_CTIME_NOW         "ctime now files"
-#define PARM_CTIME_SLOP                "ctime now slop"
-#define PARM_MTIME_NOW         "mtime now files"
-#define PARM_MTIME_SLOP                "mtime now slop"
-#define PARM_MTIME_STATIC      "mtime static files"
-#define PARM_ATIME_STATIC      "atime static files"
 
 #define IS_CTIME_NOW_PATH(conn,cfg,path)  ((conn) && is_in_path((path),\
        (cfg)->ctime_now_list,(conn)->case_sensitive))
@@ -81,7 +91,6 @@ enum onefs_acl_wire_format
 
 #define ONEFS_VFS_CONFIG_FAKETIMESTAMPS        0x00000001
 
-
 struct onefs_vfs_config
 {
        int32 init_flags;
@@ -113,6 +122,25 @@ struct onefs_vfs_config
 /*
  * vfs interface handlers
  */
+SMB_STRUCT_DIR *onefs_opendir(struct vfs_handle_struct *handle,
+                             const char *fname, const char *mask,
+                             uint32 attributes);
+
+SMB_STRUCT_DIRENT *onefs_readdir(struct vfs_handle_struct *handle,
+                                SMB_STRUCT_DIR *dirp, SMB_STRUCT_STAT *sbuf);
+
+void onefs_seekdir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
+                  long offset);
+
+long onefs_telldir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);
+
+void onefs_rewinddir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);
+
+int onefs_closedir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dir);
+
+void onefs_init_search_op(struct vfs_handle_struct *handle,
+                         SMB_STRUCT_DIR *dirp);
+
 NTSTATUS onefs_create_file(vfs_handle_struct *handle,
                           struct smb_request *req,
                           uint16_t root_dir_fid,
@@ -160,6 +188,31 @@ NTSTATUS onefs_streaminfo(vfs_handle_struct *handle,
 int onefs_vtimes_streams(vfs_handle_struct *handle, const char *fname,
                         int flags, struct timespec times[3]);
 
+NTSTATUS onefs_brl_lock_windows(vfs_handle_struct *handle,
+                               struct byte_range_lock *br_lck,
+                               struct lock_struct *plock,
+                               bool blocking_lock,
+                               struct blocking_lock_record *blr);
+
+bool onefs_brl_unlock_windows(vfs_handle_struct *handle,
+                             struct messaging_context *msg_ctx,
+                             struct byte_range_lock *br_lck,
+                             const struct lock_struct *plock);
+
+bool onefs_brl_cancel_windows(vfs_handle_struct *handle,
+                             struct byte_range_lock *br_lck,
+                             struct lock_struct *plock,
+                             struct blocking_lock_record *blr);
+
+NTSTATUS onefs_notify_watch(vfs_handle_struct *vfs_handle,
+                           struct sys_notify_context *ctx,
+                           struct notify_entry *e,
+                           void (*callback)(struct sys_notify_context *ctx,
+                                       void *private_data,
+                                       struct notify_event *ev),
+                           void *private_data,
+                           void *handle_p);
+
 NTSTATUS onefs_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                           uint32 security_info, SEC_DESC **ppdesc);
 
@@ -168,6 +221,7 @@ NTSTATUS onefs_get_nt_acl(vfs_handle_struct *handle, const char* name,
 
 NTSTATUS onefs_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                           uint32 security_info_sent, SEC_DESC *psd);
+
 /*
  * Utility functions
  */
@@ -179,6 +233,9 @@ NTSTATUS onefs_split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
 
 bool onefs_get_config(int snum, int config_type,
                      struct onefs_vfs_config *cfg);
+
+int onefs_rdp_add_dir_state(connection_struct *conn, SMB_STRUCT_DIR *dirp);
+
 /*
  * System Interfaces
  */
@@ -197,6 +254,7 @@ int onefs_sys_create_file(connection_struct *conn,
                          uint32_t ntfs_flags,
                          int *granted_oplock);
 
-
+ssize_t onefs_sys_recvfile(int fromfd, int tofd, SMB_OFF_T offset,
+                          size_t count);
 
 #endif /* _ONEFS_H */