Lines Matching defs:hash_size
105 #define BUCKET(hash) ((hash) % tdb->header.hash_size)
252 if (list < -1 || list >= (int)tdb->header.hash_size) {
291 if (list < -1 || list >= (int)tdb->header.hash_size) {
292 TDB_LOG((tdb, 0, "tdb_unlock: list %d invalid (%d)\n", list, tdb->header.hash_size));
560 for (i=0;i<tdb->header.hash_size;i++) {
668 if (left > TDB_HASH_TOP(tdb->header.hash_size-1)) {
927 static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size)
933 size = sizeof(struct tdb_header) + (hash_size+1)*sizeof(tdb_off);
939 newdb->hash_size = hash_size;
965 ret = tdb_create_rwlocks(tdb->fd, hash_size);
1226 for (; tlock->hash < tdb->header.hash_size; tlock->hash++) {
1670 TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
1673 return tdb_open_ex(name, hash_size, tdb_flags, open_flags, mode, NULL);
1677 TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
1707 if (hash_size == 0)
1708 hash_size = DEFAULT_HASH_SIZE;
1720 if (tdb_new_database(tdb, hash_size) != 0) {
1757 if (!(open_flags & O_CREAT) || tdb_new_database(tdb, hash_size) == -1) {
1793 tdb->locked = calloc(tdb->header.hash_size+1, sizeof(tdb->locked[0]));
1899 for (i = 0; i < tdb->header.hash_size; i++)
1904 if (i < tdb->header.hash_size) {
1917 for (i=0; i < tdb->header.hash_size; i++)