svn commit: samba r23367 - in branches: SAMBA_3_0/source/groupdb SAMBA_3_0/source/lib/ldb/include SAMBA_3_0/source/lib/ldb/ldb_tdb SAMBA_3_0_26/source/groupdb SAMBA_3_0_26/source/lib/ldb/include SAMBA_3_0_26/source/lib/ldb/ldb_tdb

tridge at samba.org tridge at samba.org
Wed Jun 6 13:02:16 GMT 2007


Author: tridge
Date: 2007-06-06 13:02:14 +0000 (Wed, 06 Jun 2007)
New Revision: 23367

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23367

Log:
check the "use mmap" option for ldb too
Modified:
   branches/SAMBA_3_0/source/groupdb/mapping_ldb.c
   branches/SAMBA_3_0/source/lib/ldb/include/ldb.h
   branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
   branches/SAMBA_3_0_26/source/groupdb/mapping_ldb.c
   branches/SAMBA_3_0_26/source/lib/ldb/include/ldb.h
   branches/SAMBA_3_0_26/source/lib/ldb/ldb_tdb/ldb_tdb.c


Changeset:
Modified: branches/SAMBA_3_0/source/groupdb/mapping_ldb.c
===================================================================
--- branches/SAMBA_3_0/source/groupdb/mapping_ldb.c	2007-06-06 12:52:48 UTC (rev 23366)
+++ branches/SAMBA_3_0/source/groupdb/mapping_ldb.c	2007-06-06 13:02:14 UTC (rev 23367)
@@ -67,6 +67,10 @@
 		flags |= LDB_FLG_NOSYNC;
 	}
 
+	if (!lp_use_mmap()) {
+		flags |= LDB_FLG_NOMMAP;
+	}
+
 	ret = ldb_connect(ldb, db_path, flags, NULL);
 	if (ret != LDB_SUCCESS) {
 		goto failed;

Modified: branches/SAMBA_3_0/source/lib/ldb/include/ldb.h
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/include/ldb.h	2007-06-06 12:52:48 UTC (rev 23366)
+++ branches/SAMBA_3_0/source/lib/ldb/include/ldb.h	2007-06-06 13:02:14 UTC (rev 23367)
@@ -233,6 +233,11 @@
 */
 #define LDB_FLG_RECONNECT 4
 
+/**
+   Flag to tell backends not to use mmap
+*/
+#define LDB_FLG_NOMMAP 8
+
 /*
    structures for ldb_parse_tree handling code
 */

Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2007-06-06 12:52:48 UTC (rev 23366)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2007-06-06 13:02:14 UTC (rev 23367)
@@ -1029,6 +1029,11 @@
 		tdb_flags |= TDB_NOSYNC;
 	}
 
+	/* and nommap option */
+	if (flags & LDB_FLG_NOMMAP) {
+		tdb_flags |= TDB_NOMMAP;
+	}
+
 	if (flags & LDB_FLG_RDONLY) {
 		open_flags = O_RDONLY;
 	} else {

Modified: branches/SAMBA_3_0_26/source/groupdb/mapping_ldb.c
===================================================================
--- branches/SAMBA_3_0_26/source/groupdb/mapping_ldb.c	2007-06-06 12:52:48 UTC (rev 23366)
+++ branches/SAMBA_3_0_26/source/groupdb/mapping_ldb.c	2007-06-06 13:02:14 UTC (rev 23367)
@@ -67,6 +67,10 @@
 		flags |= LDB_FLG_NOSYNC;
 	}
 
+	if (!lp_use_mmap()) {
+		flags |= LDB_FLG_NOMMAP;
+	}
+
 	ret = ldb_connect(ldb, db_path, flags, NULL);
 	if (ret != LDB_SUCCESS) {
 		goto failed;

Modified: branches/SAMBA_3_0_26/source/lib/ldb/include/ldb.h
===================================================================
--- branches/SAMBA_3_0_26/source/lib/ldb/include/ldb.h	2007-06-06 12:52:48 UTC (rev 23366)
+++ branches/SAMBA_3_0_26/source/lib/ldb/include/ldb.h	2007-06-06 13:02:14 UTC (rev 23367)
@@ -233,6 +233,11 @@
 */
 #define LDB_FLG_RECONNECT 4
 
+/**
+   Flag to tell backends not to use mmap
+*/
+#define LDB_FLG_NOMMAP 8
+
 /*
    structures for ldb_parse_tree handling code
 */

Modified: branches/SAMBA_3_0_26/source/lib/ldb/ldb_tdb/ldb_tdb.c
===================================================================
--- branches/SAMBA_3_0_26/source/lib/ldb/ldb_tdb/ldb_tdb.c	2007-06-06 12:52:48 UTC (rev 23366)
+++ branches/SAMBA_3_0_26/source/lib/ldb/ldb_tdb/ldb_tdb.c	2007-06-06 13:02:14 UTC (rev 23367)
@@ -1029,6 +1029,11 @@
 		tdb_flags |= TDB_NOSYNC;
 	}
 
+	/* and nommap option */
+	if (flags & LDB_FLG_NOMMAP) {
+		tdb_flags |= TDB_NOMMAP;
+	}
+
 	if (flags & LDB_FLG_RDONLY) {
 		open_flags = O_RDONLY;
 	} else {



More information about the samba-cvs mailing list