Lines Matching refs:tlock
1150 static int tdb_next_lock(TDB_CONTEXT *tdb, struct tdb_traverse_lock *tlock, argument
1153 int want_next = (tlock->off != 0);
1156 for (; tlock->hash < tdb->header.hash_size; tlock->hash++) {
1186 if (!tlock->off && tlock->hash != 0) {
1189 for (;tlock->hash < tdb->header.hash_size;tlock->hash++) {
1190 if (0 != *(uint32_t *)(TDB_HASH_TOP(tlock->hash) + (unsigned char *)tdb->map_ptr)) {
1194 if (tlock->hash == tdb->header.hash_size) {
1198 if (ofs_read(tdb, TDB_HASH_TOP(tlock->hash), &off) == 0 &&
1205 if (tdb_lock(tdb, tlock->hash, F_WRLCK) == -1)
1209 if (!tlock->off) {
1210 if (ofs_read(tdb, TDB_HASH_TOP(tlock->hash),
1211 &tlock->off) == -1)
1215 if (unlock_record(tdb, tlock->off) != 0)
1221 if (rec_read(tdb, tlock->off, rec) == -1)
1223 tlock->off = rec->next;
1227 while( tlock->off) {
1229 if (rec_read(tdb, tlock->off, rec) == -1)
1233 if (tlock->off == rec->next) {
1240 if (lock_record(tdb, tlock->off) != 0)
1242 return tlock->off;
1246 current = tlock->off;
1247 tlock->off = rec->next;
1252 tdb_unlock(tdb, tlock->hash, F_WRLCK);
1259 tlock->off = 0;
1260 if (tdb_unlock(tdb, tlock->hash, F_WRLCK) != 0)