[PATCH] Remove fcntl calls in tdb

Jeremy Allison jra at samba.org
Thu Jun 30 19:56:29 UTC 2016


On Thu, Jun 30, 2016 at 09:32:20AM +0200, Ralph Boehme wrote:
> 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;

That looks correct Ralph - can you send as a git format
patch and I'll push ?



More information about the samba-technical mailing list