summaryrefslogtreecommitdiff
path: root/lib/tdb/common/io.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2010-02-17 12:17:19 +1030
committerRusty Russell <rusty@rustcorp.com.au>2010-02-17 12:17:19 +1030
commit452b4a5a6efeecfb5c83475f1375ddc25bcddfbe (patch)
treeb511e6f9dadbe286fe6552ee7600140e3a3fbfa2 /lib/tdb/common/io.c
parentfffdce62fc1c9959f17c2dbb0a3939e95095fe54 (diff)
downloadsamba-452b4a5a6efeecfb5c83475f1375ddc25bcddfbe.tar.gz
samba-452b4a5a6efeecfb5c83475f1375ddc25bcddfbe.tar.bz2
samba-452b4a5a6efeecfb5c83475f1375ddc25bcddfbe.zip
tdb: cleanup: split brlock and brunlock methods.
This is taken from the CCAN code base: rather than using tdb_brlock for locking and unlocking, we split it into brlock and brunlock functions. For extra debugging information, brunlock says what kind of lock it is unlocking (even though fnctl locks don't need this). This requires an extra argument to tdb_transaction_unlock() so we know whether the lock was upgraded to a write lock or not. We also use a "flags" argument tdb_brlock: 1) TDB_LOCK_NOWAIT replaces lck_type = F_SETLK (vs F_SETLKW). 2) TDB_LOCK_MARK_ONLY replaces setting TDB_MARK_LOCK bit in ltype. 3) TDB_LOCK_PROBE replaces the "probe" argument. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb/common/io.c')
-rw-r--r--lib/tdb/common/io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/tdb/common/io.c b/lib/tdb/common/io.c
index d549715f83..85f69ab0d6 100644
--- a/lib/tdb/common/io.c
+++ b/lib/tdb/common/io.c
@@ -461,7 +461,8 @@ static const struct tdb_methods io_methods = {
tdb_next_hash_chain,
tdb_oob,
tdb_expand_file,
- tdb_brlock
+ tdb_brlock,
+ tdb_brunlock
};
/*