]> git.ozlabs.org Git - ccan/commitdiff
Import 03b3682e3fa53c9f5fdf2c4beac8b5d030fd2630 from ctdb:
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 2 Feb 2010 01:30:41 +0000 (12:00 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 2 Feb 2010 01:30:41 +0000 (12:00 +1030)
    tdb: rename 'struct list_struct' into 'struct tdb_record'

    metze
    (cherry picked from samba commit 3b62e250c066f44d0ab08a7db037b6b4f74a914b)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
ccan/tdb/check.c
ccan/tdb/dump.c
ccan/tdb/freelist.c
ccan/tdb/freelistcheck.c
ccan/tdb/io.c
ccan/tdb/tdb.c
ccan/tdb/tdb_private.h
ccan/tdb/test/run-3G-file.c
ccan/tdb/test/run-corrupt.c
ccan/tdb/transaction.c
ccan/tdb/traverse.c

index 0f0094f009bb76cc0fde89e5f555a646bd8cbf80..0a347715e35e03d5d5e67f551641f6c532b3c706 100644 (file)
@@ -64,7 +64,7 @@ corrupt:
 /* Generic record header check. */
 static bool tdb_check_record(struct tdb_context *tdb,
                             tdb_off_t off,
-                            const struct list_struct *rec)
+                            const struct tdb_record *rec)
 {
        tdb_off_t tailer;
 
@@ -229,7 +229,7 @@ static void record_offset(unsigned char bits[], tdb_off_t off)
 /* Check that an in-use record is valid. */
 static bool tdb_check_used_record(struct tdb_context *tdb,
                                  tdb_off_t off,
-                                 const struct list_struct *rec,
+                                 const struct tdb_record *rec,
                                  unsigned char **hashes,
                                  int (*check)(TDB_DATA, TDB_DATA, void *),
                                  void *private)
@@ -288,7 +288,7 @@ fail_put_key:
 /* Check that an unused record is valid. */
 static bool tdb_check_free_record(struct tdb_context *tdb,
                                  tdb_off_t off,
-                                 const struct list_struct *rec,
+                                 const struct tdb_record *rec,
                                  unsigned char **hashes)
 {
        if (!tdb_check_record(tdb, off, rec))
@@ -309,7 +309,7 @@ int tdb_check(struct tdb_context *tdb,
        unsigned int h;
        unsigned char **hashes;
        tdb_off_t off, recovery_start;
-       struct list_struct rec;
+       struct tdb_record rec;
        bool found_recovery = false;
 
        if (tdb_lockall(tdb) == -1)
index d1c902ddfdab0d0f73983837a0b77c8dda30b413..bdcbfab139b3133acdae64c4e5dda0ad2c332cb7 100644 (file)
@@ -30,7 +30,7 @@
 static tdb_off_t tdb_dump_record(struct tdb_context *tdb, int hash,
                                 tdb_off_t offset)
 {
-       struct list_struct rec;
+       struct tdb_record rec;
        tdb_off_t tailer_ofs, tailer;
 
        if (tdb->methods->tdb_read(tdb, offset, (char *)&rec, 
@@ -95,7 +95,7 @@ int tdb_printfreelist(struct tdb_context *tdb)
        int ret;
        long total_free = 0;
        tdb_off_t offset, rec_ptr;
-       struct list_struct rec;
+       struct tdb_record rec;
 
        if ((ret = tdb_lock(tdb, -1, F_WRLCK)) != 0)
                return ret;
index dedf78cf921e98d80eeeb3968b3484b47b273bf2..8113b54951cf83324a086deb24521a5bb2c572f8 100644 (file)
@@ -34,7 +34,7 @@
 #define USE_RIGHT_MERGES 0
 
 /* read a freelist record and check for simple errors */
-int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off, struct list_struct *rec)
+int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off, struct tdb_record *rec)
 {
        if (tdb->methods->tdb_read(tdb, off, rec, sizeof(*rec),DOCONV()) == -1)
                return -1;
@@ -87,7 +87,7 @@ static int remove_from_freelist(struct tdb_context *tdb, tdb_off_t off, tdb_off_
 
 /* update a record tailer (must hold allocation lock) */
 static int update_tailer(struct tdb_context *tdb, tdb_off_t offset,
-                        const struct list_struct *rec)
+                        const struct tdb_record *rec)
 {
        tdb_off_t totalsize;
 
@@ -99,7 +99,7 @@ static int update_tailer(struct tdb_context *tdb, tdb_off_t offset,
 
 /* Add an element into the freelist. Merge adjacent records if
    neccessary. */
-int tdb_free(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec)
+int tdb_free(struct tdb_context *tdb, tdb_off_t offset, struct tdb_record *rec)
 {
        /* Allocation and tailer lock */
        if (tdb_lock(tdb, -1, F_WRLCK) != 0)
@@ -115,7 +115,7 @@ int tdb_free(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec)
        /* Look right first (I'm an Australian, dammit) */
        if (offset + sizeof(*rec) + rec->rec_len + sizeof(*rec) <= tdb->map_size) {
                tdb_off_t right = offset + sizeof(*rec) + rec->rec_len;
-               struct list_struct r;
+               struct tdb_record r;
 
                if (tdb->methods->tdb_read(tdb, right, &r, sizeof(r), DOCONV()) == -1) {
                        TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_free: right read failed at %u\n", right));
@@ -141,7 +141,7 @@ left:
        /* Look left */
        if (offset - sizeof(tdb_off_t) > TDB_DATA_START(tdb->header.hash_size)) {
                tdb_off_t left = offset - sizeof(tdb_off_t);
-               struct list_struct l;
+               struct tdb_record l;
                tdb_off_t leftsize;
                
                /* Read in tailer and jump back to header */
@@ -220,9 +220,9 @@ update:
  */
 static tdb_off_t tdb_allocate_ofs(struct tdb_context *tdb, 
                                  tdb_len_t length, tdb_off_t rec_ptr,
-                                 struct list_struct *rec, tdb_off_t last_ptr)
+                                 struct tdb_record *rec, tdb_off_t last_ptr)
 {
-#define MIN_REC_SIZE (sizeof(struct list_struct) + sizeof(tdb_off_t) + 8)
+#define MIN_REC_SIZE (sizeof(struct tdb_record) + sizeof(tdb_off_t) + 8)
 
        if (rec->rec_len < length + MIN_REC_SIZE) {
                /* we have to grab the whole record */
@@ -268,12 +268,12 @@ static tdb_off_t tdb_allocate_ofs(struct tdb_context *tdb,
 }
 
 /* allocate some space from the free list. The offset returned points
-   to a unconnected list_struct within the database with room for at
+   to a unconnected tdb_record within the database with room for at
    least length bytes of total data
 
    0 is returned if the space could not be allocated
  */
-tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct list_struct *rec)
+tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct tdb_record *rec)
 {
        tdb_off_t rec_ptr, last_ptr, newrec_ptr;
        struct {
index 972b2a41c49e32f8d7ff479490702973f43ecc95..8d1ebabe04e85c9c3650797bde2a83f187b9ce2b 100644 (file)
@@ -46,7 +46,7 @@ static int seen_insert(struct tdb_context *mem_tdb, tdb_off_t rec_ptr)
 int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries)
 {
        struct tdb_context *mem_tdb = NULL;
-       struct list_struct rec;
+       struct tdb_record rec;
        tdb_off_t rec_ptr, last_ptr;
        int ret = -1;
 
index ca7d0819b99d9db45aebb757b054106d3a1f1961..929290c1407b092ab2b4eb38ca704efbf450cd75 100644 (file)
@@ -298,7 +298,7 @@ static int tdb_expand_file(struct tdb_context *tdb, tdb_off_t size, tdb_off_t ad
    file and doing the mmap again if necessary */
 int tdb_expand(struct tdb_context *tdb, tdb_off_t size)
 {
-       struct list_struct rec;
+       struct tdb_record rec;
        tdb_off_t offset, new_size;     
 
        if (tdb_lock(tdb, -1, F_WRLCK) == -1) {
@@ -435,7 +435,7 @@ int tdb_parse_data(struct tdb_context *tdb, TDB_DATA key,
 }
 
 /* read/write a record */
-int tdb_rec_read(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec)
+int tdb_rec_read(struct tdb_context *tdb, tdb_off_t offset, struct tdb_record *rec)
 {
        if (tdb->methods->tdb_read(tdb, offset, rec, sizeof(*rec),DOCONV()) == -1)
                return -1;
@@ -448,9 +448,9 @@ int tdb_rec_read(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *
        return tdb->methods->tdb_oob(tdb, rec->next+sizeof(*rec), 0);
 }
 
-int tdb_rec_write(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec)
+int tdb_rec_write(struct tdb_context *tdb, tdb_off_t offset, struct tdb_record *rec)
 {
-       struct list_struct r = *rec;
+       struct tdb_record r = *rec;
        return tdb->methods->tdb_write(tdb, offset, CONVERT(r), sizeof(r));
 }
 
index d43418033e7fcc32ea5648b4ac5c2672568e26b8..25f3cad6f83e0cacff151c677c6acde7ba41a85b 100644 (file)
@@ -77,7 +77,7 @@ static int tdb_key_compare(TDB_DATA key, TDB_DATA data, void *private_data)
 /* Returns 0 on fail.  On success, return offset of record, and fills
    in rec */
 static tdb_off_t tdb_find(struct tdb_context *tdb, TDB_DATA key, uint32_t hash,
-                       struct list_struct *r)
+                       struct tdb_record *r)
 {
        tdb_off_t rec_ptr;
        
@@ -111,7 +111,7 @@ static tdb_off_t tdb_find(struct tdb_context *tdb, TDB_DATA key, uint32_t hash,
 
 /* As tdb_find, but if you succeed, keep the lock */
 tdb_off_t tdb_find_lock_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash, int locktype,
-                          struct list_struct *rec)
+                          struct tdb_record *rec)
 {
        uint32_t rec_ptr;
 
@@ -129,7 +129,7 @@ tdb_off_t tdb_find_lock_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t has
 */
 static int tdb_update_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash, TDB_DATA dbuf)
 {
-       struct list_struct rec;
+       struct tdb_record rec;
        tdb_off_t rec_ptr;
 
        /* find entry */
@@ -164,7 +164,7 @@ static int tdb_update_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash,
 static TDB_DATA _tdb_fetch(struct tdb_context *tdb, TDB_DATA key)
 {
        tdb_off_t rec_ptr;
-       struct list_struct rec;
+       struct tdb_record rec;
        TDB_DATA ret;
        uint32_t hash;
 
@@ -210,7 +210,7 @@ int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key,
                     void *private_data)
 {
        tdb_off_t rec_ptr;
-       struct list_struct rec;
+       struct tdb_record rec;
        int ret;
        uint32_t hash;
 
@@ -241,7 +241,7 @@ int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key,
 */
 static int tdb_exists_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash)
 {
-       struct list_struct rec;
+       struct tdb_record rec;
        
        if (tdb_find_lock_hash(tdb, key, hash, F_RDLCK, &rec) == 0)
                return 0;
@@ -260,10 +260,10 @@ int tdb_exists(struct tdb_context *tdb, TDB_DATA key)
 }
 
 /* actually delete an entry in the database given the offset */
-int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct list_struct *rec)
+int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct tdb_record *rec)
 {
        tdb_off_t last_ptr, i;
-       struct list_struct lastrec;
+       struct tdb_record lastrec;
 
        if (tdb->read_only || tdb->traverse_read) return -1;
 
@@ -299,7 +299,7 @@ static int tdb_count_dead(struct tdb_context *tdb, uint32_t hash)
 {
        int res = 0;
        tdb_off_t rec_ptr;
-       struct list_struct rec;
+       struct tdb_record rec;
        
        /* read in the hash top */
        if (tdb_ofs_read(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1)
@@ -323,7 +323,7 @@ static int tdb_count_dead(struct tdb_context *tdb, uint32_t hash)
 static int tdb_purge_dead(struct tdb_context *tdb, uint32_t hash)
 {
        int res = -1;
-       struct list_struct rec;
+       struct tdb_record rec;
        tdb_off_t rec_ptr;
 
        if (tdb_lock(tdb, -1, F_WRLCK) == -1) {
@@ -359,7 +359,7 @@ static int tdb_purge_dead(struct tdb_context *tdb, uint32_t hash)
 static int tdb_delete_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash)
 {
        tdb_off_t rec_ptr;
-       struct list_struct rec;
+       struct tdb_record rec;
        int ret;
 
        if (tdb->max_dead_records != 0) {
@@ -422,7 +422,7 @@ int tdb_delete(struct tdb_context *tdb, TDB_DATA key)
  * See if we have a dead record around with enough space
  */
 static tdb_off_t tdb_find_dead(struct tdb_context *tdb, uint32_t hash,
-                              struct list_struct *r, tdb_len_t length)
+                              struct tdb_record *r, tdb_len_t length)
 {
        tdb_off_t rec_ptr;
        
@@ -450,7 +450,7 @@ static tdb_off_t tdb_find_dead(struct tdb_context *tdb, uint32_t hash,
 static int _tdb_store(struct tdb_context *tdb, TDB_DATA key,
                      TDB_DATA dbuf, int flag, uint32_t hash)
 {
-       struct list_struct rec;
+       struct tdb_record rec;
        tdb_off_t rec_ptr;
        char *p = NULL;
        int ret = -1;
@@ -739,7 +739,7 @@ void tdb_enable_seqnum(struct tdb_context *tdb)
  */
 static int tdb_free_region(struct tdb_context *tdb, tdb_off_t offset, ssize_t length)
 {
-       struct list_struct rec;
+       struct tdb_record rec;
        if (length <= sizeof(rec)) {
                /* the region is not worth adding */
                return 0;
@@ -788,7 +788,7 @@ int tdb_wipe_all(struct tdb_context *tdb)
        }
 
        if (recovery_head != 0) {
-               struct list_struct rec;
+               struct tdb_record rec;
                if (tdb->methods->tdb_read(tdb, recovery_head, &rec, sizeof(rec), DOCONV()) == -1) {
                        TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_wipe_all: failed to read recovery record\n"));
                        return -1;
index 6da29fa60a66351e41bccd67ae20de4c54e36ea5..2ccd2e788e4116529c68410e6e363833a3b87f3b 100644 (file)
@@ -136,9 +136,9 @@ void tdb_trace_2rec_retrec(struct tdb_context *tdb, const char *op,
 #define CONVERT(x) (DOCONV() ? tdb_convert(&x, sizeof(x)) : &x)
 
 
-/* the body of the database is made of one list_struct for the free space
+/* the body of the database is made of one tdb_record for the free space
    plus a separate data list for each hash value */
-struct list_struct {
+struct tdb_record {
        tdb_off_t next; /* offset of the next record in the list */
        tdb_len_t rec_len; /* total byte length of record */
        tdb_len_t key_len; /* byte length of key */
@@ -257,16 +257,16 @@ int tdb_write_unlock_record(struct tdb_context *tdb, tdb_off_t off);
 int tdb_ofs_read(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
 int tdb_ofs_write(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
 void *tdb_convert(void *buf, uint32_t size);
-int tdb_free(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
-tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct list_struct *rec);
+int tdb_free(struct tdb_context *tdb, tdb_off_t offset, struct tdb_record *rec);
+tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct tdb_record *rec);
 int tdb_ofs_read(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
 int tdb_ofs_write(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
 int tdb_lock_record(struct tdb_context *tdb, tdb_off_t off);
 int tdb_unlock_record(struct tdb_context *tdb, tdb_off_t off);
 int _tdb_transaction_cancel(struct tdb_context *tdb, int ltype);
-int tdb_rec_read(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
-int tdb_rec_write(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
-int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct list_struct *rec);
+int tdb_rec_read(struct tdb_context *tdb, tdb_off_t offset, struct tdb_record *rec);
+int tdb_rec_write(struct tdb_context *tdb, tdb_off_t offset, struct tdb_record *rec);
+int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct tdb_record *rec);
 unsigned char *tdb_alloc_read(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t len);
 int tdb_parse_data(struct tdb_context *tdb, TDB_DATA key,
                   tdb_off_t offset, tdb_len_t len,
@@ -274,11 +274,11 @@ int tdb_parse_data(struct tdb_context *tdb, TDB_DATA key,
                                 void *private_data),
                   void *private_data);
 tdb_off_t tdb_find_lock_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash, int locktype,
-                          struct list_struct *rec);
+                          struct tdb_record *rec);
 void tdb_io_init(struct tdb_context *tdb);
 int tdb_expand(struct tdb_context *tdb, tdb_off_t size);
 int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off,
-                     struct list_struct *rec);
+                     struct tdb_record *rec);
 
 
 #endif
index ba858c4d59fce5afe7ce047bc2eac89fa2750e17..11923458cdbd2a784a97c1f8d06801763f932647 100644 (file)
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
        TDB_DATA key, orig_data, data;
        uint32_t hash;
        tdb_off_t rec_ptr;
-       struct list_struct rec;
+       struct tdb_record rec;
 
        plan_tests(24);
        tdb = tdb_open("/tmp/test.tdb", 1024, TDB_CLEAR_IF_FIRST,
index 3bf78835527992f6e16b557b5da947fe06f4bcb6..eaa326bdd0e70274ce14fec0804feb5ae133100e 100644 (file)
@@ -76,9 +76,9 @@ static void check_test(struct tdb_context *tdb)
        /* From the free list chain and hash chains. */
        verifiable += 3 * sizeof(tdb_off_t);
        /* From the record headers & tailer */
-       verifiable += 5 * (sizeof(struct list_struct) + sizeof(uint32_t));
+       verifiable += 5 * (sizeof(struct tdb_record) + sizeof(uint32_t));
        /* The free block: we ignore datalen, keylen, full_hash. */
-       verifiable += sizeof(struct list_struct) - 3*sizeof(uint32_t) +
+       verifiable += sizeof(struct tdb_record) - 3*sizeof(uint32_t) +
                sizeof(uint32_t);
        /* Our check function verifies the key and data. */
        verifiable += ksize + dsize;
index 34137251bce51f2697184fbd8dc515315b9d64c6..e8b0e6856110a401d89a93c9e1336bb6acb5190f 100644 (file)
@@ -680,7 +680,7 @@ static int tdb_recovery_allocate(struct tdb_context *tdb,
                                 tdb_off_t *recovery_offset,
                                 tdb_len_t *recovery_max_size)
 {
-       struct list_struct rec;
+       struct tdb_record rec;
        const struct tdb_methods *methods = tdb->transaction->io_methods;
        tdb_off_t recovery_head;
 
@@ -766,7 +766,7 @@ static int transaction_setup_recovery(struct tdb_context *tdb,
        tdb_len_t recovery_size;
        unsigned char *data, *p;
        const struct tdb_methods *methods = tdb->transaction->io_methods;
-       struct list_struct *rec;
+       struct tdb_record *rec;
        tdb_off_t recovery_offset, recovery_max_size;
        tdb_off_t old_map_size = tdb->transaction->old_map_size;
        uint32_t magic, tailer;
@@ -786,7 +786,7 @@ static int transaction_setup_recovery(struct tdb_context *tdb,
                return -1;
        }
 
-       rec = (struct list_struct *)data;
+       rec = (struct tdb_record *)data;
        memset(rec, 0, sizeof(*rec));
 
        rec->magic    = 0;
@@ -869,7 +869,7 @@ static int transaction_setup_recovery(struct tdb_context *tdb,
        magic = TDB_RECOVERY_MAGIC;
        CONVERT(magic);
 
-       *magic_offset = recovery_offset + offsetof(struct list_struct, magic);
+       *magic_offset = recovery_offset + offsetof(struct tdb_record, magic);
 
        if (methods->tdb_write(tdb, *magic_offset, &magic, sizeof(magic)) == -1) {
                TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_setup_recovery: failed to write recovery magic\n"));
@@ -1118,7 +1118,7 @@ int tdb_transaction_recover(struct tdb_context *tdb)
        tdb_off_t recovery_head, recovery_eof;
        unsigned char *data, *p;
        uint32_t zero = 0;
-       struct list_struct rec;
+       struct tdb_record rec;
 
        /* find the recovery area */
        if (tdb_ofs_read(tdb, TDB_RECOVERY_HEAD, &recovery_head) == -1) {
@@ -1205,7 +1205,7 @@ int tdb_transaction_recover(struct tdb_context *tdb)
        }
 
        /* remove the recovery magic */
-       if (tdb_ofs_write(tdb, recovery_head + offsetof(struct list_struct, magic), 
+       if (tdb_ofs_write(tdb, recovery_head + offsetof(struct tdb_record, magic),
                          &zero) == -1) {
                TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to remove recovery magic\n"));
                tdb->ecode = TDB_ERR_IO;
index 1ca88d71b6326a6cf1a7f67170d030800c26a0c6..1532c6b25029f20042411039d5fb98340bee060e 100644 (file)
@@ -32,7 +32,7 @@
 /* Uses traverse lock: 0 = finish, TDB_NEXT_LOCK_ERR = error,
    other = record offset */
 static tdb_off_t tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock *tlock,
-                        struct list_struct *rec)
+                        struct tdb_record *rec)
 {
        int want_next = (tlock->off != 0);
 
@@ -145,7 +145,7 @@ static int _tdb_traverse(struct tdb_context *tdb,
                         struct tdb_traverse_lock *tl)
 {
        TDB_DATA key, dbuf;
-       struct list_struct rec;
+       struct tdb_record rec;
        int ret = 0, count = 0;
        tdb_off_t off;
 
@@ -270,7 +270,7 @@ int tdb_traverse(struct tdb_context *tdb,
 TDB_DATA tdb_firstkey(struct tdb_context *tdb)
 {
        TDB_DATA key;
-       struct list_struct rec;
+       struct tdb_record rec;
        tdb_off_t off;
 
        /* release any old lock */
@@ -302,7 +302,7 @@ TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA oldkey)
 {
        uint32_t oldhash;
        TDB_DATA key = tdb_null;
-       struct list_struct rec;
+       struct tdb_record rec;
        unsigned char *k = NULL;
        tdb_off_t off;