X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftdb.c;h=a3897831068dd99f5d0d67a12824d4a5cba6397b;hb=ef92843f2c74ab9d4fa7f167a2182e5e8955df91;hp=57b0777845e78805ff56298fd10517b4c8f351cb;hpb=acb26c9c3ee054c8b2141db25c9bd7be064e425c;p=ccan diff --git a/ccan/tdb2/tdb.c b/ccan/tdb2/tdb.c index 57b07778..a3897831 100644 --- a/ccan/tdb2/tdb.c +++ b/ccan/tdb2/tdb.c @@ -284,6 +284,10 @@ bool tdb_exists(struct tdb_context *tdb, TDB_DATA key) struct tdb_used_record rec; struct hash_info h; + if (tdb->flags & TDB_VERSION1) { + return tdb1_exists(tdb, key); + } + off = find_and_lock(tdb, key, F_RDLCK, &h, &rec, NULL); if (TDB_OFF_IS_ERR(off)) { tdb->last_error = off; @@ -522,6 +526,11 @@ enum TDB_ERROR tdb_parse_record_(struct tdb_context *tdb, struct hash_info h; enum TDB_ERROR ecode; + if (tdb->flags & TDB_VERSION1) { + return tdb->last_error = tdb1_parse_record(tdb, key, parse, + data); + } + off = find_and_lock(tdb, key, F_RDLCK, &h, &rec, NULL); if (TDB_OFF_IS_ERR(off)) { return tdb->last_error = off;