summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-12-06 00:05:15 +0000
committerJeremy Allison <jra@samba.org>2000-12-06 00:05:15 +0000
commit7e4c4721b4fbfa71ce6712ec5b9f3e8e8a105147 (patch)
tree2df359e8d49573fd79674cbb8cd592ce896a93d0 /source3/include
parent1cd8538b7abf0970082074d7a114bb9d013d00b2 (diff)
downloadsamba-7e4c4721b4fbfa71ce6712ec5b9f3e8e8a105147.tar.gz
samba-7e4c4721b4fbfa71ce6712ec5b9f3e8e8a105147.tar.bz2
samba-7e4c4721b4fbfa71ce6712ec5b9f3e8e8a105147.zip
Changed to sourceforge tdb code. This includes spinlocks (so we now have
a --with-spinlocks option to configure, this does mean the on-disk tdb format has changed, so 2.2alphaX sites will need to re-create their tdb's. The upside is no more tdb fragmentation and a +5% on netbench. Swings and roundabouts.... Jeremy. (This used to be commit 9dea7b7c257db487f8ced7dad3fce92fba03ea91)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/config.h.in5
-rw-r--r--source3/include/includes.h1
-rw-r--r--source3/include/proto.h25
3 files changed, 24 insertions, 7 deletions
diff --git a/source3/include/config.h.in b/source3/include/config.h.in
index 83e7a25cac..a647db2911 100644
--- a/source3/include/config.h.in
+++ b/source3/include/config.h.in
@@ -195,6 +195,11 @@
#undef PUTUTLINE_RETURNS_UTMP
#undef COMPILER_SUPPORTS_LL
#undef HAVE_YP_GET_DEFAULT_DOMAIN
+#undef USE_SPINLOCKS
+#undef SPARC_SPINLOCKS
+#undef INTEL_SPINLOCKS
+#undef MIPS_SPINLOCKS
+#undef POWERPC_SPINLOCKS
/* The number of bytes in a int. */
#undef SIZEOF_INT
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 605932dd21..1102f99d05 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -606,6 +606,7 @@ extern int errno;
#include "ubi_dLinkList.h"
#include "dlinklist.h"
#include "../tdb/tdb.h"
+#include "../tdb/spinlock.h"
#include "talloc.h"
#include "interfaces.h"
#include "hash.h"
diff --git a/source3/include/proto.h b/source3/include/proto.h
index b51b57716b..b46047ea12 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4006,23 +4006,34 @@ int smbw_stat_printjob(struct smbw_server *srv,char *path,
int smbw_fstat(int fd, struct stat *st);
int smbw_stat(const char *fname, struct stat *st);
+/*The following definitions come from tdb/spinlock.c */
+
+int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type);
+int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type);
+int tdb_create_rwlocks(int fd, unsigned int hash_size);
+int tdb_clear_spinlocks(TDB_CONTEXT *tdb);
+int tdb_clear_spinlocks(TDB_CONTEXT *tdb);
+
/*The following definitions come from tdb/tdb.c */
-char *tdb_error(TDB_CONTEXT *tdb);
-int tdb_update(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf);
+void tdb_printfreelist(TDB_CONTEXT *tdb);
+const char *tdb_errorstr(TDB_CONTEXT *tdb);
TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key);
int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_traverse(TDB_CONTEXT *tdb, int (*fn)(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void* state), void* state);
+int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *state);
TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb);
-TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA key);
+TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA oldkey);
int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key);
int tdb_store(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, int flag);
TDB_CONTEXT *tdb_open(char *name, int hash_size, int tdb_flags,
int open_flags, mode_t mode);
int tdb_close(TDB_CONTEXT *tdb);
-int tdb_lockchain(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_unlockchain(TDB_CONTEXT *tdb, TDB_DATA key);
-void tdb_printfreelist(TDB_CONTEXT *tdb);
+int tdb_lockall(TDB_CONTEXT *tdb);
+void tdb_unlockall(TDB_CONTEXT *tdb);
+int tdb_lockkeys(TDB_CONTEXT *tdb, u32 number, TDB_DATA keys[]);
+void tdb_unlockkeys(TDB_CONTEXT *tdb);
+int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
+void tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);
/*The following definitions come from tdb/tdbutil.c */