summaryrefslogtreecommitdiff
path: root/source3/tdb/tdb.h
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-08-24 22:48:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:29 -0500
commitfcbb2d3132df36057da73701f7e23f434034e6b0 (patch)
tree557cf0910ad98186f0851ce19abff8c9900e394f /source3/tdb/tdb.h
parent990d9d15db27f47d2a6cac306ab773d42427ade4 (diff)
downloadsamba-fcbb2d3132df36057da73701f7e23f434034e6b0.tar.gz
samba-fcbb2d3132df36057da73701f7e23f434034e6b0.tar.bz2
samba-fcbb2d3132df36057da73701f7e23f434034e6b0.zip
r2026: Simplify statcache to use an in-memory tdb. Modify tdb to use
a customer hash function for this tdb (yes it does make a difference on benchmarks). Remove the no longer used hash.c code. Jeremy. (This used to be commit 3fbadac85b8cad89b93d295968e99c38c8677575)
Diffstat (limited to 'source3/tdb/tdb.h')
-rw-r--r--source3/tdb/tdb.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/tdb/tdb.h b/source3/tdb/tdb.h
index eb120a8cec..8f4421d8fa 100644
--- a/source3/tdb/tdb.h
+++ b/source3/tdb/tdb.h
@@ -102,11 +102,13 @@ typedef struct tdb_context {
dev_t device; /* uniquely identifies this tdb */
ino_t inode; /* uniquely identifies this tdb */
void (*log_fn)(struct tdb_context *tdb, int level, const char *, ...); /* logging function */
+ u32 (*hash_fn)(TDB_DATA *key);
int open_flags; /* flags used in the open - needed by reopen */
} TDB_CONTEXT;
typedef int (*tdb_traverse_func)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *);
typedef void (*tdb_log_func)(TDB_CONTEXT *, int , const char *, ...);
+typedef u32 (*tdb_hash_func)(TDB_DATA *key);
TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
int open_flags, mode_t mode);
@@ -117,6 +119,7 @@ TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
int tdb_reopen(TDB_CONTEXT *tdb);
int tdb_reopen_all(void);
void tdb_logging_function(TDB_CONTEXT *tdb, tdb_log_func);
+void tdb_set_hash_function(TDB_CONTEXT *tdb, tdb_hash_func);
enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb);
const char *tdb_errorstr(TDB_CONTEXT *tdb);
TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key);