]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/tdb.c
tdb2: unify tdb1_fetch into tdb_fetch
[ccan] / ccan / tdb2 / tdb.c
index a7aa4572382b0f8b10ef03c4adc08599fd7e7293..f02844e7c6fff6cdf00a760a1ce62f1cd803a1a4 100644 (file)
@@ -248,6 +248,9 @@ enum TDB_ERROR tdb_fetch(struct tdb_context *tdb, struct tdb_data key,
        struct hash_info h;
        enum TDB_ERROR ecode;
 
+       if (tdb->flags & TDB_VERSION1)
+               return tdb1_fetch(tdb, key, data);
+
        off = find_and_lock(tdb, key, F_RDLCK, &h, &rec, NULL);
        if (TDB_OFF_IS_ERR(off)) {
                return tdb->last_error = off;