[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-3340-gab0359a

Jeremy Allison jra at samba.org
Thu Jan 8 18:56:25 GMT 2009


The branch, v3-2-test has been updated
       via  ab0359a19986f744075bf861dd43626210c2ecf7 (commit)
      from  0e30f6d835016a73e89e3159d827a2703058d34b (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit ab0359a19986f744075bf861dd43626210c2ecf7
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Jan 8 10:55:28 2009 -0800

    Remove "strict allocate = partial" code that got accidentally committed.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source/include/local.h       |    4 ----
 source/include/smb.h         |    6 ------
 source/modules/vfs_default.c |    6 +-----
 source/param/loadparm.c      |   27 ++++++---------------------
 source/smbd/fileio.c         |    5 ++---
 source/smbd/vfs.c            |   13 ++-----------
 6 files changed, 11 insertions(+), 50 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/local.h b/source/include/local.h
index b0fd7cb..c125ded 100644
--- a/source/include/local.h
+++ b/source/include/local.h
@@ -253,8 +253,4 @@
 /* Windows minimum lock resolution timeout in ms */
 #define WINDOWS_MINIMUM_LOCK_TIMEOUT_MS 200
 
-/* When strict allocate = partial, define the limit on how far
- * ahead we will write. */
-#define STRICT_ALLOCATE_PARTIAL_LIMIT 0x200000
-
 #endif
diff --git a/source/include/smb.h b/source/include/smb.h
index 2aa708a..e248164 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -1966,10 +1966,4 @@ struct smb_extended_info {
 	char   samba_version_string[SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH];
 };
 
-enum smb_strict_allocate_options {
-	STRICT_ALLOCATE_OFF=0,
-	STRICT_ALLOCATE_ON=1,
-	STRICT_ALLOCATE_PARTIAL=2
-};
-
 #endif /* _SMB_H */
diff --git a/source/modules/vfs_default.c b/source/modules/vfs_default.c
index ff8e19a..2da97f1 100644
--- a/source/modules/vfs_default.c
+++ b/source/modules/vfs_default.c
@@ -759,14 +759,10 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_O
 	SMB_STRUCT_STAT st;
 	char c = 0;
 	SMB_OFF_T currpos;
-	enum smb_strict_allocate_options sa_options = lp_strict_allocate(SNUM(fsp->conn));
 
 	START_PROFILE(syscall_ftruncate);
 
-	/* Only use allocation truncate if strict allocate
- 	 * is set "on", not off or partial.
- 	 */
-	if (sa_options == STRICT_ALLOCATE_ON) {
+	if (lp_strict_allocate(SNUM(fsp->conn))) {
 		result = strict_allocate_ftruncate(handle, fsp, len);
 		END_PROFILE(syscall_ftruncate);
 		return result;
diff --git a/source/param/loadparm.c b/source/param/loadparm.c
index 456bc74..aa41bf9 100644
--- a/source/param/loadparm.c
+++ b/source/param/loadparm.c
@@ -445,7 +445,7 @@ struct service {
 	bool bWidelinks;
 	bool bSymlinks;
 	bool bSyncAlways;
-	int iStrictAllocate;
+	bool bStrictAllocate;
 	bool bStrictSync;
 	char magic_char;
 	struct bitmap *copymap;
@@ -588,7 +588,7 @@ static struct service sDefault = {
 	True,			/* bWidelinks */
 	True,			/* bSymlinks */
 	False,			/* bSyncAlways */
-	STRICT_ALLOCATE_OFF,	/* iStrictAllocate */
+	False,			/* bStrictAllocate */
 	False,			/* bStrictSync */
 	'~',			/* magic char */
 	NULL,			/* copymap */
@@ -861,21 +861,6 @@ static const struct enum_list enum_config_backend[] = {
 	{-1, NULL}
 };
 
-static const struct enum_list enum_strict_allocate[] = {
-	{STRICT_ALLOCATE_OFF, "No"},
-	{STRICT_ALLOCATE_OFF, "False"},
-	{STRICT_ALLOCATE_OFF, "0"},
-	{STRICT_ALLOCATE_OFF, "Off"},
-	{STRICT_ALLOCATE_OFF, "disabled"},
-	{STRICT_ALLOCATE_ON, "Yes"},
-	{STRICT_ALLOCATE_ON, "True"},
-	{STRICT_ALLOCATE_ON, "1"},
-	{STRICT_ALLOCATE_ON, "On"},
-	{STRICT_ALLOCATE_ON, "enabled"},
-	{STRICT_ALLOCATE_PARTIAL, "partial"},
-	{-1, NULL}
-};
-
 /* Note: We do not initialise the defaults union - it is not allowed in ANSI C
  *
  * The FLAG_HIDE is explicit. Paramters set this way do NOT appear in any edit
@@ -2409,11 +2394,11 @@ static struct parm_struct parm_table[] = {
 	},
 	{
 		.label		= "strict allocate",
-		.type		= P_ENUM,
+		.type		= P_BOOL,
 		.p_class	= P_LOCAL,
-		.ptr		= &sDefault.iStrictAllocate,
+		.ptr		= &sDefault.bStrictAllocate,
 		.special	= NULL,
-		.enum_list	= enum_strict_allocate,
+		.enum_list	= NULL,
 		.flags		= FLAG_ADVANCED | FLAG_SHARE,
 	},
 	{
@@ -5289,7 +5274,7 @@ FN_LOCAL_PARM_BOOL(lp_manglednames, bMangledNames)
 FN_LOCAL_BOOL(lp_widelinks, bWidelinks)
 FN_LOCAL_BOOL(lp_symlinks, bSymlinks)
 FN_LOCAL_BOOL(lp_syncalways, bSyncAlways)
-FN_LOCAL_INTEGER(lp_strict_allocate, iStrictAllocate)
+FN_LOCAL_BOOL(lp_strict_allocate, bStrictAllocate)
 FN_LOCAL_BOOL(lp_strict_sync, bStrictSync)
 FN_LOCAL_BOOL(lp_map_system, bMap_system)
 FN_LOCAL_BOOL(lp_delete_readonly, bDeleteReadonly)
diff --git a/source/smbd/fileio.c b/source/smbd/fileio.c
index e23f391..60aeeef 100644
--- a/source/smbd/fileio.c
+++ b/source/smbd/fileio.c
@@ -127,10 +127,9 @@ static ssize_t real_write_file(struct smb_request *req,
         if (pos == -1) {
                 ret = vfs_write_data(req, fsp, data, n);
         } else {
-		enum smb_strict_allocate_options sa_options = lp_strict_allocate(SNUM(fsp->conn));
 		fsp->fh->pos = pos;
-		if (pos && (sa_options != STRICT_ALLOCATE_OFF)) {
-			if (vfs_fill_sparse(fsp, pos, sa_options) == -1) {
+		if (pos && lp_strict_allocate(SNUM(fsp->conn))) {
+			if (vfs_fill_sparse(fsp, pos) == -1) {
 				return -1;
 			}
 		}
diff --git a/source/smbd/vfs.c b/source/smbd/vfs.c
index e8c0ebb..6cf156c 100644
--- a/source/smbd/vfs.c
+++ b/source/smbd/vfs.c
@@ -545,9 +545,8 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
 
 	/* Grow - we need to test if we have enough space. */
 
-	if (lp_strict_allocate(SNUM(fsp->conn)) == STRICT_ALLOCATE_OFF) {
+	if (!lp_strict_allocate(SNUM(fsp->conn)))
 		return 0;
-	}
 
 	len -= st.st_size;
 	len /= 1024; /* Len is now number of 1k blocks needed. */
@@ -601,7 +600,7 @@ int vfs_set_filelen(files_struct *fsp, SMB_OFF_T len)
 static char *sparse_buf;
 #define SPARSE_BUF_WRITE_SIZE (32*1024)
 
-int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len, enum smb_strict_allocate_options sa_options)
+int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len)
 {
 	int ret;
 	SMB_STRUCT_STAT st;
@@ -620,14 +619,6 @@ int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len, enum smb_strict_allocate_o
 		return 0;
 	}
 
-	/* If strict allocate is set to "partial", ignore all allocate
- 	 * retquests over the STRICT_ALLOCATE_PARTIAL_LIMIT. */
-
-	if ((sa_options == STRICT_ALLOCATE_PARTIAL) &&
-			(len - st.st_size > STRICT_ALLOCATE_PARTIAL_LIMIT)) {
-		return 0;
-	}
-
 	DEBUG(10,("vfs_fill_sparse: write zeros in file %s from len %.0f to len %.0f (%.0f bytes)\n",
 		fsp->fsp_name, (double)st.st_size, (double)len, (double)(len - st.st_size)));
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list