[PATCH] Remove fcntl calls in tdb

Jeremy Allison jra at samba.org
Fri Jul 1 18:25:58 UTC 2016


On Fri, Jul 01, 2016 at 09:22:54AM +1200, Bob Campbell wrote:
> Hi Jeremy,
> 
> A patch for this is attached. We've put an extra return under where it
> calls tdb_increment_seqnum_nonblock; I think this is the correct behavior.
> 
> Thanks.

LGTM. Ralph, are you OK with this also ?

> From 675c775ed01fe089e7f5a8fb75ec53b6d8cc50de Mon Sep 17 00:00:00 2001
> From: Bob Campbell <bobcampbell at catalyst.net.nz>
> Date: Thu, 30 Jun 2016 09:51:23 +1200
> Subject: [PATCH] tdb: avoid many fcntl calls when incrementing seqnum
> 
> Signed-off-by: Bob Campbell <bobcampbell at catalyst.net.nz>
> Signed-off-by: Garming Sam <garming at catalyst.net.nz>
> Pair-programmed-with: Garming Sam <garming at catalyst.net.nz>
> ---
>  lib/tdb/common/tdb.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/lib/tdb/common/tdb.c b/lib/tdb/common/tdb.c
> index 9885d8c..dd93680 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;
> -- 
> 1.9.1
> 




More information about the samba-technical mailing list