Lines Matching refs:newtbl

84 	struct mesh_table *newtbl;  in mesh_table_alloc()  local
86 newtbl = kmalloc(sizeof(struct mesh_table), GFP_ATOMIC); in mesh_table_alloc()
87 if (!newtbl) in mesh_table_alloc()
90 newtbl->hash_buckets = kzalloc(sizeof(struct hlist_head) * in mesh_table_alloc()
93 if (!newtbl->hash_buckets) { in mesh_table_alloc()
94 kfree(newtbl); in mesh_table_alloc()
98 newtbl->hashwlock = kmalloc(sizeof(spinlock_t) * in mesh_table_alloc()
100 if (!newtbl->hashwlock) { in mesh_table_alloc()
101 kfree(newtbl->hash_buckets); in mesh_table_alloc()
102 kfree(newtbl); in mesh_table_alloc()
106 newtbl->size_order = size_order; in mesh_table_alloc()
107 newtbl->hash_mask = (1 << size_order) - 1; in mesh_table_alloc()
108 atomic_set(&newtbl->entries, 0); in mesh_table_alloc()
109 get_random_bytes(&newtbl->hash_rnd, in mesh_table_alloc()
110 sizeof(newtbl->hash_rnd)); in mesh_table_alloc()
111 for (i = 0; i <= newtbl->hash_mask; i++) in mesh_table_alloc()
112 spin_lock_init(&newtbl->hashwlock[i]); in mesh_table_alloc()
113 spin_lock_init(&newtbl->gates_lock); in mesh_table_alloc()
115 return newtbl; in mesh_table_alloc()
156 struct mesh_table *newtbl) in mesh_table_grow() argument
166 newtbl->free_node = oldtbl->free_node; in mesh_table_grow()
167 newtbl->mean_chain_len = oldtbl->mean_chain_len; in mesh_table_grow()
168 newtbl->copy_node = oldtbl->copy_node; in mesh_table_grow()
169 newtbl->known_gates = oldtbl->known_gates; in mesh_table_grow()
170 atomic_set(&newtbl->entries, atomic_read(&oldtbl->entries)); in mesh_table_grow()
175 if (oldtbl->copy_node(p, newtbl) < 0) in mesh_table_grow()
181 for (i = 0; i <= newtbl->hash_mask; i++) { in mesh_table_grow()
182 hlist_for_each_safe(p, q, &newtbl->hash_buckets[i]) in mesh_table_grow()
621 struct mesh_table *oldtbl, *newtbl; in mesh_mpath_table_grow() local
625 newtbl = mesh_table_alloc(oldtbl->size_order + 1); in mesh_mpath_table_grow()
626 if (!newtbl) in mesh_mpath_table_grow()
628 if (mesh_table_grow(oldtbl, newtbl) < 0) { in mesh_mpath_table_grow()
629 __mesh_table_free(newtbl); in mesh_mpath_table_grow()
632 rcu_assign_pointer(mesh_paths, newtbl); in mesh_mpath_table_grow()
642 struct mesh_table *oldtbl, *newtbl; in mesh_mpp_table_grow() local
646 newtbl = mesh_table_alloc(oldtbl->size_order + 1); in mesh_mpp_table_grow()
647 if (!newtbl) in mesh_mpp_table_grow()
649 if (mesh_table_grow(oldtbl, newtbl) < 0) { in mesh_mpp_table_grow()
650 __mesh_table_free(newtbl); in mesh_mpp_table_grow()
653 rcu_assign_pointer(mpp_paths, newtbl); in mesh_mpp_table_grow()
1050 static int mesh_path_node_copy(struct hlist_node *p, struct mesh_table *newtbl) in mesh_path_node_copy() argument
1063 hash_idx = mesh_table_hash(mpath->dst, mpath->sdata, newtbl); in mesh_path_node_copy()
1065 &newtbl->hash_buckets[hash_idx]); in mesh_path_node_copy()