• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/bind9-45.101/bind9/lib/dns/

Lines Matching refs:bucket

90 #define DNS_ADB_INVALIDBUCKET (-1)      /*%< invalid bucket address */
133 * XXXRTH Have a per-bucket structure that contains all of these?
147 * XXXRTH Have a per-bucket structure that contains all of these?
513 unsigned int i, n, bucket;
574 bucket = isc_sockaddr_hash(&e->sockaddr, ISC_TRUE) % n;
575 e->lock_bucket = bucket;
576 ISC_LIST_APPEND(newentries[bucket], e, plink);
579 newentry_refcnt[bucket]++;
585 bucket = isc_sockaddr_hash(&e->sockaddr, ISC_TRUE) % n;
586 e->lock_bucket = bucket;
587 ISC_LIST_APPEND(newdeadentries[bucket], e, plink);
590 newentry_refcnt[bucket]++;
665 unsigned int i, n, bucket;
726 bucket = dns_name_fullhash(&name->name, ISC_TRUE) % n;
727 name->lock_bucket = bucket;
728 ISC_LIST_APPEND(newnames[bucket], name, plink);
731 newname_refcnt[bucket]++;
737 bucket = dns_name_fullhash(&name->name, ISC_TRUE) % n;
738 name->lock_bucket = bucket;
739 ISC_LIST_APPEND(newdeadnames[bucket], name, plink);
742 newname_refcnt[bucket]++;
804 * Requires the adbname bucket be locked and that no entry buckets be locked.
943 * Requires the name's bucket be locked.
950 int bucket;
997 bucket = name->lock_bucket;
998 ISC_LIST_UNLINK(adb->names[bucket], name, plink);
999 ISC_LIST_APPEND(adb->deadnames[bucket], name, plink);
1007 * Requires the name's bucket be locked and no entry buckets be locked.
1056 * Requires the name's bucket be locked.
1059 link_name(dns_adb_t *adb, int bucket, dns_adbname_t *name) {
1062 ISC_LIST_PREPEND(adb->names[bucket], name, plink);
1063 name->lock_bucket = bucket;
1064 adb->name_refcnt[bucket]++;
1068 * Requires the name's bucket be locked.
1072 int bucket;
1075 bucket = name->lock_bucket;
1076 INSIST(bucket != DNS_ADB_INVALIDBUCKET);
1079 ISC_LIST_UNLINK(adb->deadnames[bucket], name, plink);
1081 ISC_LIST_UNLINK(adb->names[bucket], name, plink);
1083 INSIST(adb->name_refcnt[bucket] > 0);
1084 adb->name_refcnt[bucket]--;
1085 if (adb->name_sd[bucket] && adb->name_refcnt[bucket] == 0)
1091 * Requires the entry's bucket be locked.
1094 link_entry(dns_adb_t *adb, int bucket, dns_adbentry_t *entry) {
1100 e = ISC_LIST_TAIL(adb->entries[bucket]);
1110 ISC_LIST_UNLINK(adb->entries[bucket], e, plink);
1111 ISC_LIST_PREPEND(adb->deadentries[bucket], e, plink);
1115 ISC_LIST_PREPEND(adb->entries[bucket], entry, plink);
1116 entry->lock_bucket = bucket;
1117 adb->entry_refcnt[bucket]++;
1121 * Requires the entry's bucket be locked.
1125 int bucket;
1128 bucket = entry->lock_bucket;
1129 INSIST(bucket != DNS_ADB_INVALIDBUCKET);
1132 ISC_LIST_UNLINK(adb->deadentries[bucket], entry, plink);
1134 ISC_LIST_UNLINK(adb->entries[bucket], entry, plink);
1136 INSIST(adb->entry_refcnt[bucket] > 0);
1137 adb->entry_refcnt[bucket]--;
1138 if (adb->entry_sd[bucket] && adb->entry_refcnt[bucket] == 0)
1158 unsigned int bucket;
1163 for (bucket = 0; bucket < adb->nnames; bucket++) {
1164 LOCK(&adb->namelocks[bucket]);
1165 adb->name_sd[bucket] = ISC_TRUE;
1167 name = ISC_LIST_HEAD(adb->names[bucket]);
1170 * This bucket has no names. We must decrement the
1192 UNLOCK(&adb->namelocks[bucket]);
1203 unsigned int bucket;
1208 for (bucket = 0; bucket < adb->nentries; bucket++) {
1209 LOCK(&adb->entrylocks[bucket]);
1210 adb->entry_sd[bucket] = ISC_TRUE;
1212 entry = ISC_LIST_HEAD(adb->entries[bucket]);
1213 if (adb->entry_refcnt[bucket] == 0) {
1215 * This bucket has no entries. We must decrement the
1238 UNLOCK(&adb->entrylocks[bucket]);
1244 * Name bucket must be locked
1256 * Assumes the name bucket is locked.
1398 * Assumes the name bucket is locked.
1544 int bucket;
1546 bucket = entry->lock_bucket;
1549 LOCK(&adb->entrylocks[bucket]);
1554 UNLOCK(&adb->entrylocks[bucket]);
1561 int bucket;
1565 bucket = entry->lock_bucket;
1568 LOCK(&adb->entrylocks[bucket]);
1575 (adb->entry_sd[bucket] || entry->expires == 0 || overmem ||
1582 UNLOCK(&adb->entrylocks[bucket]);
1932 * Search for the name. NOTE: The bucket is kept locked on both
1943 int bucket;
1945 bucket = dns_name_fullhash(name, ISC_FALSE) % adb->nnames;
1948 LOCK(&adb->namelocks[bucket]);
1949 *bucketp = bucket;
1950 } else if (*bucketp != bucket) {
1952 LOCK(&adb->namelocks[bucket]);
1953 *bucketp = bucket;
1956 adbname = ISC_LIST_HEAD(adb->names[bucket]);
1971 * Search for the address. NOTE: The bucket is kept locked on both
1978 * the bucket changes.
1985 int bucket;
1987 bucket = isc_sockaddr_hash(addr, ISC_TRUE) % adb->nentries;
1990 LOCK(&adb->entrylocks[bucket]);
1991 *bucketp = bucket;
1992 } else if (*bucketp != bucket) {
1994 LOCK(&adb->entrylocks[bucket]);
1995 *bucketp = bucket;
1999 for (entry = ISC_LIST_HEAD(adb->entries[bucket]);
2006 ISC_LIST_UNLINK(adb->entries[bucket], entry, plink);
2007 ISC_LIST_PREPEND(adb->entries[bucket], entry, plink);
2016 * Entry bucket MUST be locked!
2065 int bucket;
2067 bucket = DNS_ADB_INVALIDBUCKET;
2073 bucket = entry->lock_bucket;
2074 LOCK(&adb->entrylocks[bucket]);
2093 UNLOCK(&adb->entrylocks[bucket]);
2094 bucket = DNS_ADB_INVALIDBUCKET;
2103 bucket = entry->lock_bucket;
2104 LOCK(&adb->entrylocks[bucket]);
2123 UNLOCK(&adb->entrylocks[bucket]);
2124 bucket = DNS_ADB_INVALIDBUCKET;
2130 if (bucket != DNS_ADB_INVALIDBUCKET)
2131 UNLOCK(&adb->entrylocks[bucket]);
2153 * Name bucket must be locked; adb may be locked; no other locks held.
2196 * Name bucket must be locked; adb may be locked; no other locks held.
2199 check_stale_name(dns_adb_t *adb, int bucket, isc_stdtime_t now) {
2205 INSIST(bucket != DNS_ADB_INVALIDBUCKET);
2215 victim = ISC_LIST_TAIL(adb->names[bucket]);
2243 * Entry bucket must be locked; adb may be locked; no other locks held.
2277 cleanup_names(dns_adb_t *adb, int bucket, isc_stdtime_t now) {
2282 DP(CLEAN_LEVEL, "cleaning name bucket %d", bucket);
2284 LOCK(&adb->namelocks[bucket]);
2285 if (adb->name_sd[bucket]) {
2286 UNLOCK(&adb->namelocks[bucket]);
2290 name = ISC_LIST_HEAD(adb->names[bucket]);
2299 UNLOCK(&adb->namelocks[bucket]);
2307 cleanup_entries(dns_adb_t *adb, int bucket, isc_stdtime_t now) {
2311 DP(CLEAN_LEVEL, "cleaning entry bucket %d", bucket);
2313 LOCK(&adb->entrylocks[bucket]);
2314 entry = ISC_LIST_HEAD(adb->entries[bucket]);
2321 UNLOCK(&adb->entrylocks[bucket]);
2507 * Initialize the bucket locks for names and elements.
2748 int bucket;
2817 bucket = DNS_ADB_INVALIDBUCKET;
2818 adbname = find_name_and_lock(adb, name, find->options, &bucket);
2819 INSIST(bucket != DNS_ADB_INVALIDBUCKET);
2820 if (adb->name_sd[bucket]) {
2836 check_stale_name(adb, bucket, now);
2844 link_name(adb, bucket, adbname);
2853 ISC_LIST_UNLINK(adb->names[bucket], adbname, plink);
2854 ISC_LIST_PREPEND(adb->names[bucket], adbname, plink);
3023 find->name_bucket = bucket;
3076 UNLOCK(&adb->namelocks[bucket]);
3086 int bucket;
3103 bucket = find->name_bucket;
3104 INSIST(bucket == DNS_ADB_INVALIDBUCKET);
3144 int bucket;
3157 bucket = find->name_bucket;
3158 if (bucket == DNS_ADB_INVALIDBUCKET)
3164 unlock_bucket = bucket;
3166 bucket = find->name_bucket;
3167 if (bucket != DNS_ADB_INVALIDBUCKET) {
3173 bucket = DNS_ADB_INVALIDBUCKET;
3174 POST(bucket);
3256 fprintf(f, "; bucket %d\n", i);
3597 int bucket;
3613 bucket = name->lock_bucket;
3614 LOCK(&adb->namelocks[bucket]);
3655 UNLOCK(&adb->namelocks[bucket]);
3763 UNLOCK(&adb->namelocks[bucket]);
3850 int bucket;
3857 bucket = addr->entry->lock_bucket;
3858 LOCK(&adb->entrylocks[bucket]);
3878 UNLOCK(&adb->entrylocks[bucket]);
3887 int bucket;
3895 bucket = addr->entry->lock_bucket;
3896 LOCK(&adb->entrylocks[bucket]);
3910 UNLOCK(&adb->entrylocks[bucket]);
3917 int bucket;
3922 bucket = addr->entry->lock_bucket;
3923 LOCK(&adb->entrylocks[bucket]);
3932 UNLOCK(&adb->entrylocks[bucket]);
3939 int bucket;
3951 bucket = DNS_ADB_INVALIDBUCKET;
3952 entry = find_entry_and_lock(adb, sa, &bucket, now);
3953 INSIST(bucket != DNS_ADB_INVALIDBUCKET);
3954 if (adb->entry_sd[bucket]) {
3968 link_entry(adb, bucket, entry);
3983 UNLOCK(&adb->entrylocks[bucket]);
3992 int bucket;
4009 bucket = addr->entry->lock_bucket;
4010 LOCK(&adb->entrylocks[bucket]);
4016 UNLOCK(&adb->entrylocks[bucket]);
4055 int bucket;
4060 bucket = dns_name_hash(name, ISC_FALSE) % adb->nnames;
4061 LOCK(&adb->namelocks[bucket]);
4062 adbname = ISC_LIST_HEAD(adb->names[bucket]);
4073 UNLOCK(&adb->namelocks[bucket]);