/* Packing errors into pointers and v.v. */
#define TDB_PTR_IS_ERR(ptr) \
- unlikely((void *)(ptr) >= (void *)(long)TDB_ERR_LAST)
+ unlikely((unsigned long)(ptr) >= (unsigned long)TDB_ERR_LAST)
#define TDB_PTR_ERR(p) ((enum TDB_ERROR)(long)(p))
#define TDB_ERR_PTR(err) ((void *)(long)(err))
int fd;
/* Lock information */
+ pid_t locker;
struct tdb_lock allrecord_lock;
size_t num_lockrecs;
struct tdb_lock *lockrecs;
/* Direct access information */
struct tdb_access_hdr *access;
+ /* Last error we returned. */
+ enum TDB_ERROR last_error;
+
/* The actual file information */
struct tdb_file *file;
};
tdb_len_t hash_range, int ltype);
/* For closing the file. */
-void tdb_unlock_all(struct tdb_context *tdb);
+void tdb_lock_cleanup(struct tdb_context *tdb);
/* Lock/unlock a particular free bucket. */
enum TDB_ERROR tdb_lock_free_bucket(struct tdb_context *tdb, tdb_off_t b_off,