Make conv_str_string() available to Samba3, and convert to use it.
authorAndrew Bartlett <abartlet@samba.org>
Tue, 24 Mar 2009 04:39:35 +0000 (15:39 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 24 Mar 2009 04:39:35 +0000 (15:39 +1100)
Note that the common version of this function uses uint64_t as the
parameter, and the callers have been modified to use this type.

Andrew Bartlett

lib/util/util.h
source3/modules/vfs_commit.c
source3/modules/vfs_prealloc.c
source3/modules/vfs_readahead.c
source3/modules/vfs_recycle.c

index defef127d93e4f162a8d2186a5a4ca6f40cf939b..b4ea95bbb8bd347f6f2cea3f3a5a883595fc2c58 100644 (file)
@@ -342,12 +342,10 @@ _PUBLIC_ bool set_boolean(const char *boolean_string, bool *boolean);
  */
 _PUBLIC_ bool conv_str_bool(const char * str, bool * val);
 
-#if _SAMBA_BUILD_ == 4
 /**
  * Convert a size specification like 16K into an integral number of bytes. 
  **/
 _PUBLIC_ bool conv_str_size(const char * str, uint64_t * val);
-#endif
 
 /**
  * Parse a uint64_t value from a string
index a8af0c514cd0f76bfe5255836d8ade2160cc4be4..46174236430a6e69a3e8764327ea4a860025294d 100644 (file)
@@ -66,8 +66,8 @@ enum eof_mode
 struct commit_info
 {
         /* For chunk-based commits */
-        SMB_OFF_T dbytes;      /* Dirty (uncommitted) bytes */
-        SMB_OFF_T dthresh;     /* Dirty data threshold */
+        uint64_t dbytes;       /* Dirty (uncommitted) bytes */
+        uint64_t dthresh;      /* Dirty data threshold */
         /* For commits on EOF */
         enum eof_mode on_eof;
         SMB_OFF_T eof;         /* Expected file size */
@@ -172,7 +172,7 @@ static int commit_open(
        int                 flags,
        mode_t              mode)
 {
-        SMB_OFF_T dthresh;
+        uint64_t dthresh;
        const char *eof_mode;
         struct commit_info *c = NULL;
         int fd;
index 4308fd6b7b83487bcaaf233e5c22795db8457bfd..92a99945dda55b611bb84727b57da7c98b9d3d7b 100644 (file)
@@ -114,7 +114,7 @@ static int prealloc_open(vfs_handle_struct* handle,
                        mode_t              mode)
 {
        int fd;
-       off64_t size = 0;
+       uint64_t size = 0;
 
        const char * dot;
        char fext[10];
index 362b82ad48b6a6a120dfa1e22a127cd1bbf4cd89..fb0e178c27e704983776e43ae4a676051e6413d8 100644 (file)
@@ -18,8 +18,8 @@
 #include "includes.h"
 
 struct readahead_data {
-       SMB_OFF_T off_bound;
-       SMB_OFF_T len;
+       uint64_t off_bound;
+       uint64_t len;
        bool didmsg;
 };
 
index 2f4138c3e5aafabb8f12c7cc9504dad0cfaaf8a5..3d60b2657f0ace7398b8d2d2f8da0645a3e61778 100644 (file)
@@ -152,9 +152,9 @@ static const char **recycle_noversions(vfs_handle_struct *handle)
        return tmp_lp;
 }
 
-static SMB_OFF_T recycle_maxsize(vfs_handle_struct *handle)
+static uint64_t recycle_maxsize(vfs_handle_struct *handle)
 {
-       SMB_OFF_T maxsize;
+       uint64_t maxsize;
        
        if (!conv_str_size(lp_parm_const_string(SNUM(handle->conn),
                                                "recycle", "maxsize", NULL),
@@ -167,9 +167,9 @@ static SMB_OFF_T recycle_maxsize(vfs_handle_struct *handle)
        return maxsize;
 }
 
-static SMB_OFF_T recycle_minsize(vfs_handle_struct *handle)
+static uint64_t recycle_minsize(vfs_handle_struct *handle)
 {
-       SMB_OFF_T minsize;
+       uint64_t minsize;
        
        if (!conv_str_size(lp_parm_const_string(SNUM(handle->conn),
                                                "recycle", "minsize", NULL),