From 72cd5d5ff664dc46afb3dd6a5ea45a28ef7b8591 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 20 Dec 2012 16:36:02 +0100 Subject: tdb: Remove "header" from tdb_context header.hash_size was the only thing we ever referenced outside of tdb_open_ex and its direct callees. So this shrinks the tdb_context by 164 bytes. Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Tue Feb 5 13:18:28 CET 2013 on sn-devel-104 --- lib/tdb/common/tdb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/tdb/common/tdb.c') diff --git a/lib/tdb/common/tdb.c b/lib/tdb/common/tdb.c index 7d1a40ea22..a2ae187f57 100644 --- a/lib/tdb/common/tdb.c +++ b/lib/tdb/common/tdb.c @@ -713,7 +713,7 @@ _PUBLIC_ int tdb_get_seqnum(struct tdb_context *tdb) _PUBLIC_ int tdb_hash_size(struct tdb_context *tdb) { - return tdb->header.hash_size; + return tdb->hash_size; } _PUBLIC_ size_t tdb_map_size(struct tdb_context *tdb) @@ -840,7 +840,7 @@ _PUBLIC_ int tdb_wipe_all(struct tdb_context *tdb) } /* wipe the hashes */ - for (i=0;iheader.hash_size;i++) { + for (i=0;ihash_size;i++) { if (tdb_ofs_write(tdb, TDB_HASH_TOP(i), &offset) == -1) { TDB_LOG((tdb, TDB_DEBUG_FATAL,"tdb_wipe_all: failed to write hash %d\n", i)); goto failed; @@ -857,8 +857,8 @@ _PUBLIC_ int tdb_wipe_all(struct tdb_context *tdb) for the recovery area */ if (recovery_size == 0) { /* the simple case - the whole file can be used as a freelist */ - data_len = (tdb->map_size - TDB_DATA_START(tdb->header.hash_size)); - if (tdb_free_region(tdb, TDB_DATA_START(tdb->header.hash_size), data_len) != 0) { + data_len = (tdb->map_size - TDB_DATA_START(tdb->hash_size)); + if (tdb_free_region(tdb, TDB_DATA_START(tdb->hash_size), data_len) != 0) { goto failed; } } else { @@ -870,8 +870,8 @@ _PUBLIC_ int tdb_wipe_all(struct tdb_context *tdb) move the recovery area or we risk subtle data corruption */ - data_len = (recovery_head - TDB_DATA_START(tdb->header.hash_size)); - if (tdb_free_region(tdb, TDB_DATA_START(tdb->header.hash_size), data_len) != 0) { + data_len = (recovery_head - TDB_DATA_START(tdb->hash_size)); + if (tdb_free_region(tdb, TDB_DATA_START(tdb->hash_size), data_len) != 0) { goto failed; } /* and the 2nd free list entry after the recovery area - if any */ -- cgit