Lines Matching refs:tdb
8 ** NOTE! The following LGPL license applies to the tdb
35 #include "tdb.h"
367 int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type)
371 if (!tdb->map_ptr) return -1;
372 rwlocks = (tdb_rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks);
390 int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type)
394 if (!tdb->map_ptr) return -1;
395 rwlocks = (tdb_rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks);
438 int tdb_clear_spinlocks(TDB_CONTEXT *tdb)
443 if (tdb->header.rwlocks == 0) return 0;
444 if (!tdb->map_ptr) return -1;
447 rwlocks = (tdb_rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks);
448 for(i = 0; i < tdb->header.hash_size+1; i++) {
456 int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type) { return -1; }
457 int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type) { return -1; }
460 int tdb_clear_spinlocks(TDB_CONTEXT *tdb)
462 tdb_off off = (tdb_off)((char *)&tdb->header.rwlocks
463 - (char *)&tdb->header);
465 tdb->header.rwlocks = 0;
466 if (lseek(tdb->fd, off, SEEK_SET) != off
467 || write(tdb->fd, (void *)&tdb->header.rwlocks,
468 sizeof(tdb->header.rwlocks))
469 != sizeof(tdb->header.rwlocks))