Lines Matching refs:tlock
1216 static int tdb_next_lock(TDB_CONTEXT *tdb, struct tdb_traverse_lock *tlock,
1219 int want_next = (tlock->off != 0);
1226 for (; tlock->hash < tdb->header.hash_size; tlock->hash++) {
1227 if (tdb_lock(tdb, tlock->hash, F_WRLCK) == -1)
1231 if (!tlock->off) {
1232 if (ofs_read(tdb, TDB_HASH_TOP(tlock->hash),
1233 &tlock->off) == -1)
1237 if (unlock_record(tdb, tlock->off) != 0)
1243 if (rec_read(tdb, tlock->off, rec) == -1)
1245 tlock->off = rec->next;
1249 while( tlock->off) {
1251 if (rec_read(tdb, tlock->off, rec) == -1)
1255 if (lock_record(tdb, tlock->off) != 0)
1257 return tlock->off;
1260 current = tlock->off;
1261 tlock->off = rec->next;
1265 tdb_unlock(tdb, tlock->hash, F_WRLCK);
1272 tlock->off = 0;
1273 if (tdb_unlock(tdb, tlock->hash, F_WRLCK) != 0)