- /* FIXME: Should we do header_uptodate and return retry here? */
- return tdb_nest_lock(tdb, TDB_HASH_LOCK_START + list, ltype, waitflag);
-}
-
-int tdb_unlock_list(struct tdb_context *tdb, tdb_off_t list, int ltype)
-{
- /* a allrecord lock allows us to avoid per chain locks */
- if (tdb->allrecord_lock.count) {
- if (tdb->allrecord_lock.ltype == F_RDLCK
- && ltype == F_WRLCK) {
- tdb->ecode = TDB_ERR_LOCK;
- tdb->log(tdb, TDB_DEBUG_FATAL, tdb->log_priv,
- "tdb_unlock_list RO allrecord!\n");
- return -1;
- }
- return 0;
- } else {
- return tdb_nest_unlock(tdb, TDB_HASH_LOCK_START + list, ltype);
- }
-}
-
-/* Free list locks come after hash locks */
-int tdb_lock_free_list(struct tdb_context *tdb, tdb_off_t flist,
- enum tdb_lock_flags waitflag)
-{
- /* You're supposed to have a hash lock first! */
- if (!(tdb->flags & TDB_NOLOCK) && !tdb_has_locks(tdb)) {
- tdb->ecode = TDB_ERR_LOCK;
- tdb->log(tdb, TDB_DEBUG_FATAL, tdb->log_priv,
- "tdb_lock_free_list without lock!\n");
+ if (tdb_has_free_lock(tdb)) {
+ tdb_logerr(tdb, TDB_ERR_LOCK, TDB_DEBUG_ERROR,
+ "tdb_lock_hashes: already have free lock");