return -1;
}
-int tdb_oob(struct tdb_context *tdb, tdb_off_t off, tdb_len_t len, int probe)
+int _tdb_oob(struct tdb_context *tdb, tdb_off_t off, tdb_len_t len, int probe)
{
- int ret;
-
- if (likely((off + len >= off) && (off + len <= tdb->map_size))) {
- return 0;
- }
-
- ret = tdb->methods->tdb_oob(tdb, off, len, probe);
+ int ret = tdb->methods->tdb_oob(tdb, off, len, probe);
return ret;
}
int tdb_free(struct tdb_context *tdb, tdb_off_t offset, struct tdb_record *rec);
tdb_off_t tdb_allocate(struct tdb_context *tdb, int hash, tdb_len_t length,
struct tdb_record *rec);
-int tdb_oob(struct tdb_context *tdb, tdb_off_t off, tdb_len_t len, int probe);
+
+int _tdb_oob(struct tdb_context *tdb, tdb_off_t off, tdb_len_t len, int probe);
+
+static inline int tdb_oob(
+ struct tdb_context *tdb, tdb_off_t off, tdb_len_t len, int probe)
+{
+ if (likely((off + len >= off) && (off + len <= tdb->map_size))) {
+ return 0;
+ }
+ return _tdb_oob(tdb, off, len, probe);
+}
+
+
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);