- /* FIXME: We can do a subset of this! */
- if (tdb->transaction)
- return NULL;
-
- if (unlikely(tdb_oob(tdb, off + len, true) == -1))
- return NULL;
- return (char *)tdb->map_ptr + off;
-}
-
-/* Either make a copy into pad and return that, or return ptr into mmap. */
-/* Note: pad has to be a real object, so we can't get here if len
- * overflows size_t */
-void *tdb_get(struct tdb_context *tdb, tdb_off_t off, void *pad, size_t len)
-{
- if (likely(!(tdb->flags & TDB_CONVERT))) {
- void *ret = tdb_direct(tdb, off, len);
- if (ret)
- return ret;
- }
-
- if (unlikely(tdb_oob(tdb, off + len, false) == -1))
- return NULL;
-
- if (tdb->methods->read(tdb, off, pad, len) == -1)
- return NULL;
- return tdb_convert(tdb, pad, len);