/net/batman-adv/ |
H A D | hash.c | 21 #include "hash.h" 23 /* clears the hash */ 24 static void batadv_hash_init(struct batadv_hashtable *hash) argument 28 for (i = 0; i < hash->size; i++) { 29 INIT_HLIST_HEAD(&hash->table[i]); 30 spin_lock_init(&hash->list_locks[i]); 34 /* free only the hashtable and the hash itself. */ 35 void batadv_hash_destroy(struct batadv_hashtable *hash) argument 37 kfree(hash->list_locks); 38 kfree(hash 45 struct batadv_hashtable *hash; local 71 batadv_hash_set_lock_class(struct batadv_hashtable *hash, struct lock_class_key *key) argument [all...] |
H A D | originator.h | 23 #include "hash.h" 45 /* hashfunction to choose an entry in a hash table of given size 46 * hash algorithm from http://en.wikipedia.org/wiki/Hash_table 51 uint32_t hash = 0; local 55 hash += key[i]; 56 hash += (hash << 10); 57 hash ^= (hash >> 6); 60 hash 70 struct batadv_hashtable *hash = bat_priv->orig_hash; local [all...] |
H A D | hash.h | 40 spinlock_t *list_locks; /* spinlock for each hash list entry */ 44 /* allocates and clears the hash */ 48 void batadv_hash_set_lock_class(struct batadv_hashtable *hash, 51 /* free only the hashtable and the hash itself. */ 52 void batadv_hash_destroy(struct batadv_hashtable *hash); 54 /* remove the hash structure. if hashdata_free_cb != NULL, this function will be 55 * called to remove the elements inside of the hash. if you don't remove the 58 static inline void batadv_hash_delete(struct batadv_hashtable *hash, argument 67 for (i = 0; i < hash->size; i++) { 68 head = &hash 92 batadv_hash_bytes(uint32_t hash, const void *data, uint32_t size) argument 117 batadv_hash_add(struct batadv_hashtable *hash, batadv_hashdata_compare_cb compare, batadv_hashdata_choose_cb choose, const void *data, struct hlist_node *data_node) argument 162 batadv_hash_remove(struct batadv_hashtable *hash, batadv_hashdata_compare_cb compare, batadv_hashdata_choose_cb choose, void *data) argument [all...] |
H A D | bridge_loop_avoidance.c | 21 #include "hash.h" 45 uint32_t hash = 0; local 47 hash = batadv_hash_bytes(hash, &claim->addr, sizeof(claim->addr)); 48 hash = batadv_hash_bytes(hash, &claim->vid, sizeof(claim->vid)); 50 hash += (hash << 3); 51 hash ^= (hash >> 1 62 uint32_t hash = 0; local 145 struct batadv_hashtable *hash = bat_priv->bla.claim_hash; local 185 struct batadv_hashtable *hash = bat_priv->bla.backbone_hash; local 221 struct batadv_hashtable *hash; local 462 struct batadv_hashtable *hash; local 960 struct batadv_hashtable *hash; local 1014 struct batadv_hashtable *hash; local 1062 struct batadv_hashtable *hash; local 1116 struct batadv_hashtable *hash; local 1321 struct batadv_hashtable *hash = bat_priv->bla.backbone_hash; local 1604 struct batadv_hashtable *hash = bat_priv->bla.claim_hash; local 1648 struct batadv_hashtable *hash = bat_priv->bla.backbone_hash; local [all...] |
H A D | vis.c | 26 #include "hash.h" 31 /* hash class keys */ 69 /* hash function to choose an entry in a hash table of given size 70 * hash algorithm from http://en.wikipedia.org/wiki/Hash_table 77 uint32_t hash = 0; local 83 hash += key[i]; 84 hash += (hash << 10); 85 hash 98 struct batadv_hashtable *hash = bat_priv->vis.hash; local 251 struct batadv_hashtable *hash = bat_priv->vis.hash; local 515 struct batadv_hashtable *hash = bat_priv->orig_hash; local 567 struct batadv_hashtable *hash = bat_priv->orig_hash; local 668 struct batadv_hashtable *hash = bat_priv->vis.hash; local 695 struct batadv_hashtable *hash = bat_priv->orig_hash; local [all...] |
H A D | distributed-arp-table.c | 25 #include "hash.h" 84 spinlock_t *list_lock; /* protects write access to the hash lists */ 90 if (!bat_priv->dat.hash) 93 for (i = 0; i < bat_priv->dat.hash->size; i++) { 94 head = &bat_priv->dat.hash->table[i]; 95 list_lock = &bat_priv->dat.hash->list_locks[i]; 115 * hash table 133 * batadv_compare_dat - comparing function used in the local DAT hash table 201 * batadv_hash_dat - compute the hash value for an IP address 202 * @data: data to hash 210 uint32_t hash = 0; local 239 struct batadv_hashtable *hash = bat_priv->dat.hash; local 466 struct batadv_hashtable *hash = bat_priv->orig_hash; local 684 struct batadv_hashtable *hash = bat_priv->dat.hash; local [all...] |
H A D | network-coding.c | 23 #include "hash.h" 48 * batadv_nc_init - initialise coding hash table and start house keeping 281 * batadv_nc_purge_orig_hash - traverse entire originator hash to check if they 287 struct batadv_hashtable *hash = bat_priv->orig_hash; local 292 if (!hash) 296 for (i = 0; i < hash->size; i++) { 297 head = &hash->table[i]; 308 * batadv_nc_purge_paths - traverse all nc paths part of the hash and remove 311 * @hash: hash tabl 317 batadv_nc_purge_paths(struct batadv_priv *bat_priv, struct batadv_hashtable *hash, bool (*to_purge)(struct batadv_priv *, struct batadv_nc_path *)) argument 389 uint32_t hash = 0; local 439 batadv_nc_hash_find(struct batadv_hashtable *hash, void *data) argument 564 batadv_nc_process_nc_paths(struct batadv_priv *bat_priv, struct batadv_hashtable *hash, bool (*process_fn)(struct batadv_priv *, struct batadv_nc_path *, struct batadv_nc_packet *)) argument 834 batadv_nc_get_path(struct batadv_priv *bat_priv, struct batadv_hashtable *hash, uint8_t *src, uint8_t *dst) argument 1136 struct batadv_hashtable *hash = bat_priv->nc.coding_hash; local 1604 struct batadv_hashtable *hash = bat_priv->nc.decoding_hash; local 1748 struct batadv_hashtable *hash = bat_priv->orig_hash; local [all...] |
H A D | originator.c | 23 #include "hash.h" 33 /* hash class keys */ 183 struct batadv_hashtable *hash = bat_priv->orig_hash; local 190 if (!hash) 197 for (i = 0; i < hash->size; i++) { 198 head = &hash->table[i]; 199 list_lock = &hash->list_locks[i]; 210 batadv_hash_destroy(hash); 372 struct batadv_hashtable *hash = bat_priv->orig_hash; local 379 if (!hash) 432 struct batadv_hashtable *hash = bat_priv->orig_hash; local 534 struct batadv_hashtable *hash = bat_priv->orig_hash; local 617 struct batadv_hashtable *hash = bat_priv->orig_hash; local [all...] |
/net/core/ |
H A D | secure_seq.c | 42 u32 hash[MD5_DIGEST_WORDS]; local 45 memcpy(hash, saddr, 16); 53 md5_transform(hash, secret); 55 return seq_scale(hash[0]); 63 u32 hash[MD5_DIGEST_WORDS]; local 66 memcpy(hash, saddr, 16); 73 md5_transform(hash, secret); 75 return hash[0]; 83 u32 hash[MD5_DIGEST_WORDS]; local 85 hash[ 97 __u32 hash[4]; local 108 u32 hash[MD5_DIGEST_WORDS]; local 122 u32 hash[MD5_DIGEST_WORDS]; local 140 u32 hash[MD5_DIGEST_WORDS]; local 163 u32 hash[MD5_DIGEST_WORDS]; local [all...] |
H A D | flow_dissector.c | 167 * __skb_get_rxhash: calculate a flow hash based on src/dst addresses 168 * and src/dst port numbers. Sets rxhash in skb to non-zero hash value 169 * on success, zero indicates no valid hash. Also, sets l4_rxhash in skb 170 * if hash is a canonical 4-tuple hash over transport ports. 175 u32 hash; local 183 /* get a consistent hash (same value on both flow directions) */ 191 hash = jhash_3words((__force u32)keys.dst, 194 if (!hash) 195 hash 208 u32 hash; local 315 u32 hash; local [all...] |
/net/ceph/crush/ |
H A D | hash.c | 3 #include <linux/crush/hash.h> 7 * http://burtleburtle.net/bob/hash/evahash.html 26 __u32 hash = crush_hash_seed ^ a; local 30 crush_hashmix(b, x, hash); 31 crush_hashmix(y, a, hash); 32 return hash; 37 __u32 hash = crush_hash_seed ^ a ^ b; local 40 crush_hashmix(a, b, hash); 41 crush_hashmix(x, a, hash); 42 crush_hashmix(b, y, hash); 48 __u32 hash = crush_hash_seed ^ a ^ b ^ c; local 61 __u32 hash = crush_hash_seed ^ a ^ b ^ c ^ d; local 76 __u32 hash = crush_hash_seed ^ a ^ b ^ c ^ d ^ e; local [all...] |
/net/ipv6/ |
H A D | inet6_hashtables.c | 41 unsigned int hash; local 45 sk->sk_hash = hash = inet6_sk_ehashfn(sk); 46 list = &inet_ehash_bucket(hashinfo, hash)->chain; 47 lock = inet_ehash_lockp(hashinfo, hash); 63 * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so 82 unsigned int hash = inet6_ehashfn(net, daddr, hnum, saddr, sport); local 83 unsigned int slot = hash & hashinfo->ehash_mask; 90 if (sk->sk_hash != hash) 107 /* Must check for a TIME_WAIT'er before going to listener hash. */ 109 if (sk->sk_hash != hash) 170 unsigned int hash = inet_lhashfn(net, hnum); local 245 const unsigned int hash = inet6_ehashfn(net, daddr, lport, saddr, local [all...] |
/net/netfilter/ |
H A D | xt_cluster.c | 45 u_int32_t hash = 0; local 49 hash = xt_cluster_hash_ipv4(nf_ct_orig_ipv4_src(ct), info); 52 hash = xt_cluster_hash_ipv6(nf_ct_orig_ipv6_src(ct), info); 58 return (((u64)hash * info->total_nodes) >> 32); 95 unsigned long hash; local 127 hash = xt_cluster_hash(ct->master, info); 129 hash = xt_cluster_hash(ct, info); 131 return !!((1 << hash) & info->node_mask) ^ 174 MODULE_DESCRIPTION("Xtables: hash-based cluster match");
|
H A D | nf_conntrack_core.c | 86 /* The direction must be ignored, so we hash everything up to the 96 static u32 __hash_bucket(u32 hash, unsigned int size) argument 98 return ((u64)hash * size) >> 32; 101 static u32 hash_bucket(u32 hash, const struct net *net) argument 103 return __hash_bucket(hash, net->ct.htable_size); 323 const struct nf_conntrack_tuple *tuple, u32 hash) 327 unsigned int bucket = hash_bucket(hash, net); 334 hlist_nulls_for_each_entry_rcu(h, n, &net->ct.hash[bucket], hnnode) { 369 const struct nf_conntrack_tuple *tuple, u32 hash) 376 h = ____nf_conntrack_find(net, zone, tuple, hash); 322 ____nf_conntrack_find(struct net *net, u16 zone, const struct nf_conntrack_tuple *tuple, u32 hash) argument 368 __nf_conntrack_find_get(struct net *net, u16 zone, const struct nf_conntrack_tuple *tuple, u32 hash) argument 404 __nf_conntrack_hash_insert(struct nf_conn *ct, unsigned int hash, unsigned int repl_hash) argument 420 unsigned int hash, repl_hash; local 464 unsigned int hash, repl_hash; local 581 unsigned int hash = hash_conntrack(net, zone, tuple); local 608 early_drop(struct net *net, unsigned int hash) argument 674 __nf_conntrack_alloc(struct net *net, u16 zone, const struct nf_conntrack_tuple *orig, const struct nf_conntrack_tuple *repl, gfp_t gfp, u32 hash) argument 773 init_conntrack(struct net *net, struct nf_conn *tmpl, const struct nf_conntrack_tuple *tuple, struct nf_conntrack_l3proto *l3proto, struct nf_conntrack_l4proto *l4proto, struct sk_buff *skb, unsigned int dataoff, u32 hash) argument 882 u32 hash; local 1292 nf_ct_free_hashtable(void *hash, unsigned int size) argument 1415 struct hlist_nulls_head *hash; local 1441 struct hlist_nulls_head *hash, *old_hash; local [all...] |
H A D | xt_connlimit.c | 106 struct hlist_head *hash; local 111 hash = &data->iphash[connlimit_iphash6(addr, mask)]; 113 hash = &data->iphash[connlimit_iphash(addr->ip & mask->ip)]; 118 hlist_for_each_entry_safe(conn, n, hash, node) { 169 hlist_add_head(&conn->node, hash); 262 struct hlist_head *hash = info->data->iphash; local 268 hlist_for_each_entry_safe(conn, n, &hash[i], node) {
|
/net/netfilter/ipvs/ |
H A D | ip_vs_proto.c | 51 unsigned int hash = IP_VS_PROTO_HASH(pp->protocol); local 53 pp->next = ip_vs_proto_table[hash]; 54 ip_vs_proto_table[hash] = pp; 69 unsigned int hash = IP_VS_PROTO_HASH(pp->protocol); local 77 pd->next = ipvs->proto_data_table[hash]; 78 ipvs->proto_data_table[hash] = pd; 85 ipvs->proto_data_table[hash] = pd->next; 100 unsigned int hash = IP_VS_PROTO_HASH(pp->protocol); local 102 pp_p = &ip_vs_proto_table[hash]; 123 unsigned int hash local 145 unsigned int hash = IP_VS_PROTO_HASH(proto); local 163 unsigned int hash = IP_VS_PROTO_HASH(proto); local [all...] |
/net/ipv4/ |
H A D | inet_fragment.c | 64 hb = &f->hash[i]; 73 /* Relink to new hash chain. */ 74 hb_dest = &f->hash[hval]; 89 struct inet_frag_bucket *hb = &f->hash[i]; 136 unsigned int hash; local 139 hash = f->hashfn(fq); 140 hb = &f->hash[hash]; 252 unsigned int hash; local 254 read_lock(&f->lock); /* Protects against hash rebuil [all...] |
H A D | tcp_metrics.c | 9 #include <linux/hash.h> 135 unsigned int hash, 146 oldest = rcu_dereference(net->ipv4.tcp_metrics_hash[hash].chain); 163 tm->tcpm_next = net->ipv4.tcp_metrics_hash[hash].chain; 164 rcu_assign_pointer(net->ipv4.tcp_metrics_hash[hash].chain, tm); 193 struct net *net, unsigned int hash) 198 for (tm = rcu_dereference(net->ipv4.tcp_metrics_hash[hash].chain); tm; 212 unsigned int hash; local 219 hash = (__force unsigned int) addr.addr.a4; 223 hash 133 tcpm_new(struct dst_entry *dst, struct inetpeer_addr *addr, unsigned int hash, bool reclaim) argument 192 __tcp_get_metrics(const struct inetpeer_addr *addr, struct net *net, unsigned int hash) argument 246 unsigned int hash; local 281 unsigned int hash; local 856 parse_nl_addr(struct genl_info *info, struct inetpeer_addr *addr, unsigned int *hash, int optional) argument 884 unsigned int hash; local 964 unsigned int hash; local [all...] |
H A D | inet_hashtables.c | 29 * The bindhash mutex for snum's hash chain must be held here. 185 unsigned int hash = inet_lhashfn(net, hnum); local 186 struct inet_listen_hashbucket *ilb = &hashinfo->listening_hash[hash]; 217 if (get_nulls_value(node) != hash + LISTENING_NULLS_BASE) 246 unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport); local 247 unsigned int slot = hash & hashinfo->ehash_mask; 253 if (sk->sk_hash != hash) 276 /* Must check for a TIME_WAIT'er before going to listener hash. */ 278 if (sk->sk_hash != hash) 323 unsigned int hash local [all...] |
/net/sched/ |
H A D | cls_tcindex.c | 23 #define PERFECT_HASH_THRESHOLD 64 /* use perfect hash if not bigger */ 43 struct tcindex_filter_result *perfect; /* perfect hash; NULL if none */ 44 struct tcindex_filter **h; /* imperfect hash; only used if !perfect; 48 int hash; /* hash table size; 0 if undefined */ member in struct:tcindex_data 73 for (f = p->h[key % p->hash]; f; f = f->next) 137 p->hash = DEFAULT_HASH_SIZE; 160 for (i = 0; i < p->hash; i++) 188 return p->hash > (p->mask >> p->shift); 225 cp.hash [all...] |
/net/ceph/ |
H A D | ceph_hash.c | 6 * Robert Jenkin's hash function. 7 * http://burtleburtle.net/bob/hash/evahash.html 82 * linux dcache hash 86 unsigned long hash = 0; local 91 hash = (hash + (c << 4) + (c >> 4)) * 11; 93 return hash;
|
/net/sunrpc/ |
H A D | svcauth.c | 19 #include <linux/hash.h> 111 * 'auth_domains' are stored in a hash table indexed by name. 129 hlist_del(&dom->hash); 146 hlist_for_each_entry(hp, head, hash) { 154 hlist_add_head(&new->hash, head);
|
/net/sctp/ |
H A D | proc.c | 216 int hash = *(loff_t *)v; local 218 if (hash >= sctp_ep_hashsize) 221 head = &sctp_ep_hashtable[hash]; 230 sctp_sk(sk)->type, sk->sk_state, hash, 324 int hash = *(loff_t *)v; local 326 if (hash >= sctp_assoc_hashsize) 329 head = &sctp_assoc_hashtable[hash]; 341 assoc->state, hash, 444 int hash = *(loff_t *)v; local 446 if (hash > [all...] |
/net/appletalk/ |
H A D | aarp.c | 355 /* Expire all entries in a hash chain */ 367 /* Cleanup all hash chains -- module unloading */ 418 int hash = sa->s_node % (AARP_HASH_SIZE - 1); local 423 a = __aarp_find_entry(proxies[hash], dev, sa); 434 int hash = sa->s_node % (AARP_HASH_SIZE - 1); local 435 struct aarp_entry *a = __aarp_find_entry(proxies[hash], dev, sa); 488 int hash, retval = -EPROTONOSUPPORT; local 517 hash = sa->s_node % (AARP_HASH_SIZE - 1); 518 entry->next = proxies[hash]; 519 proxies[hash] 552 int hash; local 690 __aarp_resolved(struct aarp_entry **list, struct aarp_entry *a, int hash) argument 722 int hash, ret = 0; local [all...] |
/net/netlink/ |
H A D | af_netlink.c | 109 static inline struct hlist_head *nl_portid_hashfn(struct nl_portid_hash *hash, u32 portid) argument 111 return &hash->table[jhash_1word(portid, hash->rnd) & hash->mask]; 859 struct nl_portid_hash *hash = &nl_table[protocol].hash; local 864 head = nl_portid_hashfn(hash, portid); 895 static int nl_portid_hash_rehash(struct nl_portid_hash *hash, int grow) argument 902 omask = mask = hash->mask; 904 shift = hash 936 nl_portid_hash_dilute(struct nl_portid_hash *hash, int len) argument 979 struct nl_portid_hash *hash = &nl_table[sk->sk_protocol].hash; local 1186 struct nl_portid_hash *hash = &nl_table[sk->sk_protocol].hash; local 2681 struct nl_portid_hash *hash = &nl_table[i].hash; local 2729 struct nl_portid_hash *hash = &nl_table[i].hash; local 2912 struct nl_portid_hash *hash = &nl_table[i].hash; local [all...] |