Lines Matching refs:hash_size

138 #define TDB_HASHTABLE_SIZE(tdb) ((tdb->header.hash_size+1)*sizeof(tdb_off_t))
139 #define TDB_DATA_START(hash_size) TDB_HASH_TOP(hash_size-1)
160 #define BUCKET(hash) ((hash) % tdb->header.hash_size)
192 u32 hash_size; /* number of hash entries */
419 if (list < -1 || list >= (int)tdb->header.hash_size) {
518 if (list < -1 || list >= (int)tdb->header.hash_size) {
519 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_unlock: list %d invalid (%d)\n", list, tdb->header.hash_size));
644 0, 4*tdb->header.hash_size)) {
682 0, 4*tdb->header.hash_size)) {
948 for (;h < tdb->header.hash_size;h++) {
955 for (;h < tdb->header.hash_size;h++) {
1523 for (;h < tdb->header.hash_size;h++) {
1642 calloc(tdb->header.hash_size+1, sizeof(u32));
1713 tdb_brlock(tdb, FREELIST_TOP, F_UNLCK, F_SETLKW, 0, 4*tdb->header.hash_size);
2357 if (left > TDB_DATA_START(tdb->header.hash_size)) {
2586 mem_tdb = tdb_open("flval", tdb->header.hash_size,
2649 for (; tlock->hash < tdb->header.hash_size; tlock->hash++) {
2680 if (tlock->hash == tdb->header.hash_size) {
3004 for (i=0;i<tdb->header.hash_size;i++) {
3681 return tdb->header.hash_size;
3724 static int tdb_new_database(struct tdb_context *tdb, int hash_size)
3730 size = sizeof(struct tdb_header) + (hash_size+1)*sizeof(tdb_off_t);
3736 newdb->hash_size = hash_size;
3793 struct tdb_context *tdb_open(const char *name, int hash_size, int tdb_flags,
3796 return tdb_open_ex(name, hash_size, tdb_flags, open_flags, mode, NULL, NULL);
3806 struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
3849 if (hash_size == 0)
3850 hash_size = DEFAULT_HASH_SIZE;
3862 if (tdb_new_database(tdb, hash_size) != 0) {
3899 if (!(open_flags & O_CREAT) || tdb_new_database(tdb, hash_size) == -1) {