Lines Matching refs:tlock
1201 static int tdb_next_lock(TDB_CONTEXT *tdb, struct tdb_traverse_lock *tlock,
1204 int want_next = (tlock->off != 0);
1207 for (; tlock->hash < tdb->header.hash_size; tlock->hash++) {
1208 if (tdb_lock(tdb, tlock->hash, F_WRLCK) == -1)
1212 if (!tlock->off) {
1213 if (ofs_read(tdb, TDB_HASH_TOP(tlock->hash),
1214 &tlock->off) == -1)
1218 if (unlock_record(tdb, tlock->off) != 0)
1224 if (rec_read(tdb, tlock->off, rec) == -1)
1226 tlock->off = rec->next;
1230 while( tlock->off) {
1232 if (rec_read(tdb, tlock->off, rec) == -1)
1236 if (lock_record(tdb, tlock->off) != 0)
1238 return tlock->off;
1241 current = tlock->off;
1242 tlock->off = rec->next;
1247 tdb_unlock(tdb, tlock->hash, F_WRLCK);
1254 tlock->off = 0;
1255 if (tdb_unlock(tdb, tlock->hash, F_WRLCK) != 0)