summaryrefslogtreecommitdiff
path: root/lib/tdb/common
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2010-02-17 12:40:57 +1030
committerRusty Russell <rusty@rustcorp.com.au>2010-02-17 12:40:57 +1030
commitd48c3e4982a38fb6b568ed3903e55e07a0fe5ca6 (patch)
tree5cabd05ae49c8ee3228491e51c5f6a4702b9e75e /lib/tdb/common
parent4738d474c412cc59d26fcea64007e99094e8b675 (diff)
downloadsamba-d48c3e4982a38fb6b568ed3903e55e07a0fe5ca6.tar.gz
samba-d48c3e4982a38fb6b568ed3903e55e07a0fe5ca6.tar.bz2
samba-d48c3e4982a38fb6b568ed3903e55e07a0fe5ca6.zip
tdb: use tdb_nest_lock() for seqnum lock.
This is pure overhead, but it centralizes the locking. Realloc (esp. as most implementations are lazy) is fast compared to the fnctl anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb/common')
-rw-r--r--lib/tdb/common/tdb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/tdb/common/tdb.c b/lib/tdb/common/tdb.c
index ad81a56877..7317a3aa52 100644
--- a/lib/tdb/common/tdb.c
+++ b/lib/tdb/common/tdb.c
@@ -59,14 +59,14 @@ static void tdb_increment_seqnum(struct tdb_context *tdb)
return;
}
- if (tdb_brlock(tdb, F_WRLCK, TDB_SEQNUM_OFS, 1,
- TDB_LOCK_WAIT|TDB_LOCK_PROBE) != 0) {
+ if (tdb_nest_lock(tdb, TDB_SEQNUM_OFS, F_WRLCK,
+ TDB_LOCK_WAIT|TDB_LOCK_PROBE) != 0) {
return;
}
tdb_increment_seqnum_nonblock(tdb);
- tdb_brunlock(tdb, F_WRLCK, TDB_SEQNUM_OFS, 1);
+ tdb_nest_unlock(tdb, TDB_SEQNUM_OFS, F_WRLCK, false);
}
static int tdb_key_compare(TDB_DATA key, TDB_DATA data, void *private_data)