X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=blobdiff_plain;f=lib%2Ftdb%2Fcommon%2Ffreelist.c;h=6358f64a04ab8db19693b05e6f84f282c44c348e;hp=c7d908edfdd36de58c3dce7d0218df14d164d779;hb=HEAD;hpb=09e756b1d651caef203a4b7e02234f6dea374b08 diff --git a/lib/tdb/common/freelist.c b/lib/tdb/common/freelist.c index c7d908edfdd..6358f64a04a 100644 --- a/lib/tdb/common/freelist.c +++ b/lib/tdb/common/freelist.c @@ -6,11 +6,11 @@ Copyright (C) Andrew Tridgell 1999-2005 Copyright (C) Paul `Rusty' Russell 2000 Copyright (C) Jeremy Allison 2000-2003 - + ** NOTE! The following LGPL license applies to the tdb ** library. This does NOT imply that all of Samba is released ** under the LGPL - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -56,7 +56,7 @@ int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off, struct tdb_record rec->magic, off)); return -1; } - if (tdb->methods->tdb_oob(tdb, rec->next+sizeof(*rec), 0) != 0) + if (tdb->methods->tdb_oob(tdb, rec->next, sizeof(*rec), 0) != 0) return -1; return 0; } @@ -143,7 +143,7 @@ left: tdb_off_t left = offset - sizeof(tdb_off_t); struct tdb_record l; tdb_off_t leftsize; - + /* Read in tailer and jump back to header */ if (tdb_ofs_read(tdb, left, &leftsize) == -1) { TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_free: left offset read failed at %u\n", left)); @@ -334,7 +334,7 @@ tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct tdb_rec bestfit.rec_len < length * multiplier) { break; } - + /* this multiplier means we only extremely rarely search more than 50 or so records. At 50 records we accept records up to 11 times larger than what we @@ -367,7 +367,7 @@ tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct tdb_rec /* return the size of the freelist - used to decide if we should repack */ -int tdb_freelist_size(struct tdb_context *tdb) +_PUBLIC_ int tdb_freelist_size(struct tdb_context *tdb) { tdb_off_t ptr; int count=0;