summaryrefslogtreecommitdiff
path: root/lib/tdb/common/tdb.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-12-20 16:36:02 +0100
committerStefan Metzmacher <metze@samba.org>2013-02-05 13:18:28 +0100
commit72cd5d5ff664dc46afb3dd6a5ea45a28ef7b8591 (patch)
tree345e21bb28f13b724fa9ec8ff28b266a2c06ec79 /lib/tdb/common/tdb.c
parent71247ec4bdefb3a1b16619f7ea7404bcbafb5b60 (diff)
downloadsamba-72cd5d5ff664dc46afb3dd6a5ea45a28ef7b8591.tar.gz
samba-72cd5d5ff664dc46afb3dd6a5ea45a28ef7b8591.tar.bz2
samba-72cd5d5ff664dc46afb3dd6a5ea45a28ef7b8591.zip
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 <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Feb 5 13:18:28 CET 2013 on sn-devel-104
Diffstat (limited to 'lib/tdb/common/tdb.c')
-rw-r--r--lib/tdb/common/tdb.c12
1 files changed, 6 insertions, 6 deletions
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;i<tdb->header.hash_size;i++) {
+ for (i=0;i<tdb->hash_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 */