s3-vfs: Use the system. namespace for fake ACLs
[kai/samba.git] / source3 / modules / vfs_commit.c
index cade1170bab445801c31959937710f6e385821c6..865250a5d8a86a2d274107ff765e4cd608b8a272 100644 (file)
@@ -17,6 +17,8 @@
  */
 
 #include "includes.h"
+#include "system/filesys.h"
+#include "smbd/smbd.h"
 
 /* Commit data module.
  *
@@ -66,11 +68,11 @@ enum eof_mode
 struct commit_info
 {
         /* For chunk-based commits */
-        SMB_OFF_T dbytes;      /* Dirty (uncommitted) bytes */
-        SMB_OFF_T dthresh;     /* Dirty data threshold */
+        off_t dbytes;  /* Dirty (uncommitted) bytes */
+        off_t dthresh; /* Dirty data threshold */
         /* For commits on EOF */
         enum eof_mode on_eof;
-        SMB_OFF_T eof;         /* Expected file size */
+        off_t eof;             /* Expected file size */
 };
 
 static int commit_do(
@@ -119,7 +121,7 @@ static int commit_all(
 static int commit(
         struct vfs_handle_struct *     handle,
         files_struct *                 fsp,
-       SMB_OFF_T                       offset,
+       off_t                   offset,
         ssize_t                                last_write)
 {
         struct commit_info *c;
@@ -181,7 +183,7 @@ static int commit_open(
        int                 flags,
        mode_t              mode)
 {
-        SMB_OFF_T dthresh;
+        off_t dthresh;
        const char *eof_mode;
         struct commit_info *c = NULL;
         int fd;
@@ -233,7 +235,7 @@ static int commit_open(
                c->eof = st.st_ex_size;
         }
 
-        return 0;
+        return fd;
 }
 
 static ssize_t commit_write(
@@ -259,7 +261,7 @@ static ssize_t commit_pwrite(
         files_struct *      fsp,
         const void *        data,
         size_t              count,
-       SMB_OFF_T           offset)
+       off_t       offset)
 {
         ssize_t ret;
 
@@ -285,7 +287,7 @@ static int commit_close(
 static int commit_ftruncate(
         vfs_handle_struct * handle,
         files_struct *      fsp,
-        SMB_OFF_T           len)
+        off_t           len)
 {
         int result;
 
@@ -303,7 +305,7 @@ static int commit_ftruncate(
 }
 
 static struct vfs_fn_pointers vfs_commit_fns = {
-        .open = commit_open,
+        .open_fn = commit_open,
         .close_fn = commit_close,
         .write = commit_write,
         .pwrite = commit_pwrite,