diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-10-18 21:41:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:21:26 -0500 |
commit | de664ec1f8cf179f1d650563272c0de3f7636e2b (patch) | |
tree | 918eace9793e9c17cef5c1854ed3b34388df583f /source/lib/tdb/common/traverse.c | |
parent | d8af519c2d2fcab3baa822c5fd4c1079dcbd1de3 (diff) | |
download | samba-de664ec1f8cf179f1d650563272c0de3f7636e2b.tar.gz |
r19401: make tdb_lockall() much more efficient, and add a tdb_lockall_read()
call which does a read lock on all chains. These will be used to make
ldb searches more efficient
Diffstat (limited to 'source/lib/tdb/common/traverse.c')
-rw-r--r-- | source/lib/tdb/common/traverse.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/lib/tdb/common/traverse.c b/source/lib/tdb/common/traverse.c index 6f6510c38a8..fb2371d4039 100644 --- a/source/lib/tdb/common/traverse.c +++ b/source/lib/tdb/common/traverse.c @@ -208,7 +208,7 @@ int tdb_traverse_read(struct tdb_context *tdb, /* we need to get a read lock on the transaction lock here to cope with the lock ordering semantics of solaris10 */ - if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_RDLCK, F_SETLKW, 0) == -1) { + if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_RDLCK, F_SETLKW, 0, 1) == -1) { TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_traverse_read: failed to get transaction lock\n")); tdb->ecode = TDB_ERR_LOCK; return -1; @@ -218,7 +218,7 @@ int tdb_traverse_read(struct tdb_context *tdb, ret = tdb_traverse_internal(tdb, fn, private_data, &tl); tdb->traverse_read--; - tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_UNLCK, F_SETLKW, 0); + tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_UNLCK, F_SETLKW, 0, 1); return ret; } @@ -237,7 +237,7 @@ int tdb_traverse(struct tdb_context *tdb, return tdb_traverse_read(tdb, fn, private_data); } - if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_WRLCK, F_SETLKW, 0) == -1) { + if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_WRLCK, F_SETLKW, 0, 1) == -1) { TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_traverse: failed to get transaction lock\n")); tdb->ecode = TDB_ERR_LOCK; return -1; @@ -245,7 +245,7 @@ int tdb_traverse(struct tdb_context *tdb, ret = tdb_traverse_internal(tdb, fn, private_data, &tl); - tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_UNLCK, F_SETLKW, 0); + tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_UNLCK, F_SETLKW, 0, 1); return ret; } |