Commit 8571daf0 authored by Rusty Russell's avatar Rusty Russell

tdb2: make tdb1_null static.

It's only used in two files, make it static in one and do it manually
in the other.
parent e487983a
...@@ -42,6 +42,4 @@ uint64_t tdb1_incompatible_hash(const void *key, size_t len, uint64_t seed, void ...@@ -42,6 +42,4 @@ uint64_t tdb1_incompatible_hash(const void *key, size_t len, uint64_t seed, void
/* @} ******************************************************************/ /* @} ******************************************************************/
extern TDB_DATA tdb1_null;
#endif /* tdb1.h */ #endif /* tdb1.h */
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include "tdb1_private.h" #include "tdb1_private.h"
#include <assert.h> #include <assert.h>
TDB_DATA tdb1_null;
/* /*
non-blocking increment of the tdb sequence number if the tdb has been opened using non-blocking increment of the tdb sequence number if the tdb has been opened using
the TDB_SEQNUM flag the TDB_SEQNUM flag
...@@ -191,8 +189,11 @@ static TDB_DATA _tdb1_fetch(struct tdb_context *tdb, TDB_DATA key) ...@@ -191,8 +189,11 @@ static TDB_DATA _tdb1_fetch(struct tdb_context *tdb, TDB_DATA key)
/* find which hash bucket it is in */ /* find which hash bucket it is in */
hash = tdb_hash(tdb, key.dptr, key.dsize); hash = tdb_hash(tdb, key.dptr, key.dsize);
if (!(rec_ptr = tdb1_find_lock_hash(tdb,key,hash,F_RDLCK,&rec))) if (!(rec_ptr = tdb1_find_lock_hash(tdb,key,hash,F_RDLCK,&rec))) {
return tdb1_null; ret.dptr = NULL;
ret.dsize = 0;
return ret;
}
ret.dptr = tdb1_alloc_read(tdb, rec_ptr + sizeof(rec) + rec.key_len, ret.dptr = tdb1_alloc_read(tdb, rec_ptr + sizeof(rec) + rec.key_len,
rec.data_len); rec.data_len);
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#define TDB1_NEXT_LOCK_ERR ((tdb1_off_t)-1) #define TDB1_NEXT_LOCK_ERR ((tdb1_off_t)-1)
static TDB_DATA tdb1_null;
/* Uses traverse lock: 0 = finish, TDB1_NEXT_LOCK_ERR = error, /* Uses traverse lock: 0 = finish, TDB1_NEXT_LOCK_ERR = error,
other = record offset */ other = record offset */
static tdb1_off_t tdb1_next_lock(struct tdb_context *tdb, struct tdb1_traverse_lock *tlock, static tdb1_off_t tdb1_next_lock(struct tdb_context *tdb, struct tdb1_traverse_lock *tlock,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment