Lines Matching refs:tlock
2662 static int tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock *tlock, in tdb_next_lock() argument
2665 int want_next = (tlock->off != 0); in tdb_next_lock()
2668 for (; tlock->hash < tdb->header.hash_size; tlock->hash++) { in tdb_next_lock()
2669 if (!tlock->off && tlock->hash != 0) { in tdb_next_lock()
2698 tdb->methods->next_hash_chain(tdb, &tlock->hash); in tdb_next_lock()
2699 if (tlock->hash == tdb->header.hash_size) { in tdb_next_lock()
2704 if (tdb_lock(tdb, tlock->hash, tlock->lock_rw) == -1) in tdb_next_lock()
2708 if (!tlock->off) { in tdb_next_lock()
2709 if (tdb_ofs_read(tdb, TDB_HASH_TOP(tlock->hash), in tdb_next_lock()
2710 &tlock->off) == -1) in tdb_next_lock()
2714 if (tdb_unlock_record(tdb, tlock->off) != 0) in tdb_next_lock()
2720 if (tdb_rec_read(tdb, tlock->off, rec) == -1) in tdb_next_lock()
2722 tlock->off = rec->next; in tdb_next_lock()
2726 while( tlock->off) { in tdb_next_lock()
2728 if (tdb_rec_read(tdb, tlock->off, rec) == -1) in tdb_next_lock()
2732 if (tlock->off == rec->next) { in tdb_next_lock()
2739 if (tdb_lock_record(tdb, tlock->off) != 0) in tdb_next_lock()
2741 return tlock->off; in tdb_next_lock()
2745 current = tlock->off; in tdb_next_lock()
2746 tlock->off = rec->next; in tdb_next_lock()
2751 tdb_unlock(tdb, tlock->hash, tlock->lock_rw); in tdb_next_lock()
2758 tlock->off = 0; in tdb_next_lock()
2759 if (tdb_unlock(tdb, tlock->hash, tlock->lock_rw) != 0) in tdb_next_lock()