svn commit: samba r2125 - in branches/SAMBA_4_0/source/lib: .

tridge at samba.org tridge at samba.org
Tue Aug 31 08:21:29 GMT 2004


Author: tridge
Date: 2004-08-31 08:21:29 +0000 (Tue, 31 Aug 2004)
New Revision: 2125

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/lib&rev=2125&nolog=1

Log:
the lp_use_mmap() in map_file() is inappropriate for 2 reasons, so I have removed it.

 - lp_use_mmap() is really meant to cope with systems that have broken
   mmap coherence, but map_file() doesn't need coherence, as its maps
   read only

 - map_file() is used to map the charset files before loadparm has
   loaded, so lp_use_mmap() is always returning false for the major
   use of map_file()


Modified:
   branches/SAMBA_4_0/source/lib/util_file.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util_file.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util_file.c	2004-08-31 07:14:34 UTC (rev 2124)
+++ branches/SAMBA_4_0/source/lib/util_file.c	2004-08-31 08:21:29 UTC (rev 2125)
@@ -366,20 +366,18 @@
 	size_t s2 = 0;
 	void *p = NULL;
 #ifdef HAVE_MMAP
-	if (lp_use_mmap()) {
-		int fd;
-		fd = open(fname, O_RDONLY, 0);
-		if (fd == -1) {
-			DEBUG(2,("Failed to load %s - %s\n", fname, strerror(errno)));
-			return NULL;
-		}
-		p = mmap(NULL, size, PROT_READ, MAP_SHARED|MAP_FILE, fd, 0);
-		close(fd);
-		if (p == MAP_FAILED) {
-			DEBUG(1,("Failed to mmap %s - %s\n", fname, strerror(errno)));
-			return NULL;
-		}
+	int fd;
+	fd = open(fname, O_RDONLY, 0);
+	if (fd == -1) {
+		DEBUG(2,("Failed to load %s - %s\n", fname, strerror(errno)));
+		return NULL;
 	}
+	p = mmap(NULL, size, PROT_READ, MAP_SHARED|MAP_FILE, fd, 0);
+	close(fd);
+	if (p == MAP_FAILED) {
+		DEBUG(1,("Failed to mmap %s - %s\n", fname, strerror(errno)));
+		return NULL;
+	}
 #endif
 	if (!p) {
 		p = file_load(fname, &s2);



More information about the samba-cvs mailing list