s3: vfs: add smb_vfs_ev_glue
[samba.git] / source3 / include / vfs.h
index 90d39acd3fc95f572f7e7f305a7cb95d99ab2214..a8bb9c121ac8da6d86fafc372701adfa18ad6206 100644 (file)
 /* Version 39 - Remove struct dfree_cached_info pointer from
                connection struct */
 /* Bump to version 40, Samba 4.10 will ship with that */
+/* Version 40 - Introduce smb_vfs_ev_glue infrastructure. */
 
 #define SMB_VFS_INTERFACE_VERSION 40
 
@@ -279,6 +280,9 @@ struct smb_file_time;
 struct blocking_lock_record;
 struct smb_filename;
 struct dfs_GetDFSReferral;
+struct tevent_context;
+struct pthreadpool_tevent;
+struct smb_vfs_ev_glue;
 
 typedef union unid_t {
        uid_t uid;
@@ -1500,4 +1504,29 @@ void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);
 void smb_vfs_assert_all_fns(const struct vfs_fn_pointers* fns,
                            const char *module);
 
+/*
+ * Notice the "Design of the smb_vfs_ev_glue infrastructure"
+ * comment in source3/smbd/vfs.c!
+ *
+ * This explains smb_vfs_ev_glue infrastructure in detail.
+ */
+struct tevent_context *smb_vfs_ev_glue_ev_ctx(const struct smb_vfs_ev_glue *evg);
+struct pthreadpool_tevent *smb_vfs_ev_glue_tp_fd_safe(const struct smb_vfs_ev_glue *evg);
+struct pthreadpool_tevent *smb_vfs_ev_glue_tp_path_safe(const struct smb_vfs_ev_glue *evg);
+struct pthreadpool_tevent *smb_vfs_ev_glue_tp_chdir_safe(const struct smb_vfs_ev_glue *evg);
+const struct smb_vfs_ev_glue *smb_vfs_ev_glue_get_root_glue(const struct smb_vfs_ev_glue *evg);
+struct smb_vfs_ev_glue *smb_vfs_ev_glue_create(TALLOC_CTX *mem_ctx,
+                               struct tevent_context *user_ev,
+                               struct pthreadpool_tevent *user_tp_fd_safe,
+                               struct pthreadpool_tevent *user_tp_path_safe,
+                               struct pthreadpool_tevent *user_tp_chdir_safe,
+                               struct tevent_context *root_ev,
+                               struct pthreadpool_tevent *root_tp_fd_safe,
+                               struct pthreadpool_tevent *root_tp_path_safe,
+                               struct pthreadpool_tevent *root_tp_chdir_safe);
+struct smb_vfs_ev_glue *smb_vfs_ev_glue_create_switch(
+                       TALLOC_CTX *mem_ctx,
+                       const struct smb_vfs_ev_glue *return_evg,
+                       const struct smb_vfs_ev_glue *run_evg);
+
 #endif /* _VFS_H */