[PATCH] Remove fcntl calls in tdb
Ralph Boehme
slow at samba.org
Thu Jun 30 07:32:20 UTC 2016
Hi Bob!
On Thu, Jun 30, 2016 at 11:53:41AM +1200, Bob Campbell wrote:
> This patch removes a bunch of needless fcntl calls upon incrementing
> seqnum in TDB when there is already a transaction lock held. This was
> done as a result of trying to improve provisioning time. Although it
> doesn't actually reduce the time noticeably, it does remove some of the
> noise in strace so that we could look at what other system calls were
> taking lots of time.
while the behavioural change looks good, may I suggest to simply move
the check into tdb_increment_seqnum(), like so:
--- a/lib/tdb/common/tdb.c
+++ b/lib/tdb/common/tdb.c
@@ -59,6 +59,10 @@ static void tdb_increment_seqnum(struct tdb_context
*tdb)
return;
}
+ if (tdb->transaction != NULL) {
+ tdb_increment_seqnum_nonblock(tdb);
+ }
+
if (tdb_nest_lock(tdb, TDB_SEQNUM_OFS, F_WRLCK,
TDB_LOCK_WAIT|TDB_LOCK_PROBE) != 0) {
return;
Cheerio!
-slow
More information about the samba-technical
mailing list