diff options
author | Bob Campbell <bobcampbell@catalyst.net.nz> | 2016-06-30 09:51:23 +1200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2016-07-03 18:11:29 +0200 |
commit | 7700ee810b2cf1766849efbfe40be15f2b43c934 (patch) | |
tree | f3da3c30b3380d980b5d2ac487f099a0b869b69d /lib | |
parent | d820b046ac76705eff9817b76e5830096c28768f (diff) | |
download | samba-7700ee810b2cf1766849efbfe40be15f2b43c934.tar.gz |
tdb: avoid many fcntl calls when incrementing seqnum
Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Jul 3 18:11:30 CEST 2016 on sn-devel-144
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tdb/common/tdb.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tdb/common/tdb.c b/lib/tdb/common/tdb.c index 9885d8cfc9d..dd936801539 100644 --- a/lib/tdb/common/tdb.c +++ b/lib/tdb/common/tdb.c @@ -59,6 +59,11 @@ static void tdb_increment_seqnum(struct tdb_context *tdb) return; } + if (tdb->transaction != NULL) { + tdb_increment_seqnum_nonblock(tdb); + return; + } + if (tdb_nest_lock(tdb, TDB_SEQNUM_OFS, F_WRLCK, TDB_LOCK_WAIT|TDB_LOCK_PROBE) != 0) { return; |