diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-10-20 09:55:47 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:15:35 -0500 |
commit | 7d52581978c7f95e18a3c5b5c38adc486af63023 (patch) | |
tree | 00515ad71cd84b3cf6a799ae1a535a9b3d0849c1 /source3/tdb/common/tdb.c | |
parent | 3da46073748c21a9202575883f3a57dacb2882ee (diff) | |
download | samba-7d52581978c7f95e18a3c5b5c38adc486af63023.tar.gz samba-7d52581978c7f95e18a3c5b5c38adc486af63023.tar.bz2 samba-7d52581978c7f95e18a3c5b5c38adc486af63023.zip |
r19426: merge nearly all the differences between Samba3 tdb and Samba4
tdb. This includes:
- the new tdb_lockall and tdb_lockall_read code, which will be needed
for the ldb speedups
- the tdb logging changes. This is an intermediate step to keep the
differences between the two branches small. The plan is still to
move to a tdb_init()/tdb_set_logging_function()/tdb_attach() style
of open which will make things much cleaner.
- the updated test suites and standalone tdb build code
- use libreplace headers
There are still some small differences I haven't merged. I'll discuss
those on the list.
(This used to be commit 48903c75edfaf75dbd3e9d052e615552cdff39b4)
Diffstat (limited to 'source3/tdb/common/tdb.c')
-rw-r--r-- | source3/tdb/common/tdb.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/source3/tdb/common/tdb.c b/source3/tdb/common/tdb.c index 524d404a50..addb5b4378 100644 --- a/source3/tdb/common/tdb.c +++ b/source3/tdb/common/tdb.c @@ -42,7 +42,7 @@ static void tdb_increment_seqnum(struct tdb_context *tdb) return; } - if (tdb_brlock(tdb, TDB_SEQNUM_OFS, F_WRLCK, F_SETLKW, 1) != 0) { + if (tdb_brlock(tdb, TDB_SEQNUM_OFS, F_WRLCK, F_SETLKW, 1, 1) != 0) { return; } @@ -53,7 +53,7 @@ static void tdb_increment_seqnum(struct tdb_context *tdb) seqnum++; tdb_ofs_write(tdb, TDB_SEQNUM_OFS, &seqnum); - tdb_brlock(tdb, TDB_SEQNUM_OFS, F_UNLCK, F_SETLKW, 1); + tdb_brlock(tdb, TDB_SEQNUM_OFS, F_UNLCK, F_SETLKW, 1, 1); } @@ -236,7 +236,7 @@ static int tdb_delete_hash(struct tdb_context *tdb, TDB_DATA key, u32 hash) } if (tdb_unlock(tdb, BUCKET(rec.full_hash), F_WRLCK) != 0) - TDB_LOG((tdb, 0, "tdb_delete: WARNING tdb_unlock failed!\n")); + TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_delete: WARNING tdb_unlock failed!\n")); return ret; } @@ -403,7 +403,7 @@ int tdb_fd(struct tdb_context *tdb) */ tdb_log_func tdb_log_fn(struct tdb_context *tdb) { - return tdb->log_fn; + return tdb->log.log_fn; } @@ -429,3 +429,14 @@ int tdb_hash_size(struct tdb_context *tdb) { return tdb->header.hash_size; } + +size_t tdb_map_size(struct tdb_context *tdb) +{ + return tdb->map_size; +} + +int tdb_get_flags(struct tdb_context *tdb) +{ + return tdb->flags; +} + |