Lines Matching defs:hash_size
77 #define TDB_DATA_START(hash_size) (TDB_HASH_TOP(hash_size-1) + TDB_SPINLOCK_SIZE(hash_size))
102 #define BUCKET(hash) ((hash) % tdb->header.hash_size)
258 if (list < -1 || list >= (int)tdb->header.hash_size) {
297 if (list < -1 || list >= (int)tdb->header.hash_size) {
298 TDB_LOG((tdb, 0, "tdb_unlock: list %d invalid (%d)\n", list, tdb->header.hash_size));
553 for (i=0;i<tdb->header.hash_size;i++) {
661 if (left > TDB_DATA_START(tdb->header.hash_size)) {
922 static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size)
928 size = sizeof(struct tdb_header) + (hash_size+1)*sizeof(tdb_off);
934 newdb->hash_size = hash_size;
957 ret = tdb_create_rwlocks(tdb->fd, hash_size);
1207 for (; tlock->hash < tdb->header.hash_size; tlock->hash++) {
1669 TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
1672 return tdb_open_ex(name, hash_size, tdb_flags, open_flags, mode, NULL, NULL);
1676 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]));
1905 for (i = 0; i < tdb->header.hash_size; i++)
1910 if (i < tdb->header.hash_size) {
1923 for (i=0; i < tdb->header.hash_size; i++)