[PATCHES] a few small patches to tdb

Jeremy Allison jra at samba.org
Thu Feb 13 18:21:47 MST 2014


On Thu, Feb 13, 2014 at 05:20:39PM +0100, Michael Adam wrote:
> Attached find a few small patches to tdb.
> Two make the output of tdbtool dump a little more
> consistent, and two simplify and systematize
> tdb_delete_hash() a bit.
> 
> Review and push appreciated.

Ok, in this patch :

-------------------------------------------------
From: Michael Adam <obnox at samba.org>
Date: Thu, 13 Feb 2014 16:48:35 +0100
Subject: [PATCH 3/4] tdb: simplify tdb_delete_hash() a bit

Make the lock/unlock bracket more obvious by extracting
locking (and finding) from the special cases to the top
of the function. This also lets us take lock and find
the record outside the special case branches (use dead
records or not).

The only real change is that in the dead records case,
the record to delete is looked up before the current
dead records are potentially purged.
-------------------------------------------------

There is one more functional change you haven't
listed here.

That is with the change to call tdb_find_lock_hash()
first, if the record you're trying to delete doesn't
exist, in the dead records case the pruning of the
dead records on the hash chain of the missing record
doesn't get done, whereas in the existing code it
does get done.

Not I would doubt that's a problem, but tdb semantics
can be tricky :-), so I wanted to make sure you were
aware of this change.

If you are and you're ok with it, then please expand
the comment to include this change and I'll re-review.

Cheers,

	Jeremy.


More information about the samba-technical mailing list