Fix based on Elrond's code to reduce the store size on removing dead records.
authorJeremy Allison <jra@samba.org>
Wed, 3 May 2000 20:33:25 +0000 (20:33 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 3 May 2000 20:33:25 +0000 (20:33 +0000)
Jeremy.
(This used to be commit 09e92a61a966d09f543ba541ddb3240cc4718579)

source3/locking/brlock.c

index c590c5127231011d12a74f464e85ebb2900bd568..51f3175dbf3350b7693c7ea99b4ede5c7124500a 100644 (file)
@@ -126,6 +126,7 @@ static int delete_fn(TDB_CONTEXT *ttdb, TDB_DATA kbuf, TDB_DATA dbuf, void *stat
        if (count == 0) {
                tdb_delete(tdb, kbuf);
        } else if (count < (dbuf.dsize / sizeof(*locks))) {
+               dbuf.dsize = count * sizeof(*locks);
                tdb_store(tdb, kbuf, dbuf, TDB_REPLACE);
        }