Expose per-fsp extension talloc context.
[gd/samba/.git] / source3 / smbd / vfs.c
index 45d0788117c160dd298acfe226da56eb61d294ed..96d71da8d926b020e786caa8248fa7cc90d7bdc1 100644 (file)
@@ -263,19 +263,31 @@ void vfs_remove_fsp_extension(vfs_handle_struct *handle, files_struct *fsp)
        }
 }
 
-void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp)
+void *vfs_memctx_fsp_extension(vfs_handle_struct *handle, files_struct *fsp)
 {
        struct vfs_fsp_data *head;
 
        for (head = fsp->vfs_extension; head; head = head->next) {
                if (head->owner == handle) {
-                       return EXT_DATA_AREA(head);
+                       return head;
                }
        }
 
        return NULL;
 }
 
+void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp)
+{
+       struct vfs_fsp_data *head;
+
+       head = vfs_memctx_fsp_extension(handle, fsp);
+       if (head != NULL) {
+               return EXT_DATA_AREA(head);
+       }
+
+       return NULL;
+}
+
 #undef EXT_DATA_AREA
 
 /*****************************************************************