Lines Matching defs:groups
405 WARN_ON(nlk_sk(sk)->groups);
541 for (i = 0; i < NLGRPLONGS(tbl->groups); i++) {
545 mask |= nlk_sk(sk)->groups[i];
652 void (*release)(struct sock *sock, unsigned long *groups);
709 kfree(nlk->groups);
710 nlk->groups = NULL;
735 nlk->netlink_release(sk, nlk->groups);
744 if (test_bit(i, nlk->groups))
927 unsigned int groups;
932 groups = nl_table[sk->sk_protocol].groups;
938 if (nlk->ngroups >= groups)
945 new_groups = kzalloc(NLGRPSZ(groups), GFP_ATOMIC);
950 old_groups = nlk->groups;
958 smp_store_release(&nlk->groups, new_groups);
964 smp_store_release(&nlk->ngroups, groups);
975 static void netlink_undo_bind(int group, long unsigned int groups,
985 if (test_bit(undo, &groups))
997 unsigned long groups;
1005 groups = nladdr->nl_groups;
1008 if (groups) {
1017 groups &= (1UL << nlk->ngroups) - 1;
1029 if (nlk->netlink_bind && groups) {
1032 /* nl_groups is a u32, so cap the maximum groups we can bind */
1034 if (!test_bit(group, &groups))
1039 netlink_undo_bind(group, groups, sk);
1053 netlink_undo_bind(BITS_PER_TYPE(u32), groups, sk);
1058 if (!groups && (nlk->groups == NULL || !(u32)nlk->groups[0]))
1064 hweight32(groups) -
1065 hweight32(nlk->groups[0]));
1066 nlk->groups[0] = (nlk->groups[0] & ~0xffffffffUL) | groups;
1142 nladdr->nl_groups = nlk->groups ? nlk->groups[0] : 0;
1395 if (listeners && group - 1 < nl_table[sk->sk_protocol].groups)
1454 !test_bit(p->group - 1, nlk->groups))
1610 !test_bit(p->group - 1, nlk->groups))
1664 old = test_bit(group - 1, nlk->groups);
1666 __assign_bit(group - 1, nlk->groups, new);
1783 group = (u32)(nlk->groups[idx] >> shift);
2037 unsigned int groups;
2052 if (!cfg || cfg->groups < 32)
2053 groups = 32;
2055 groups = cfg->groups;
2057 listeners = kzalloc(sizeof(*listeners) + NLGRPSZ(groups), GFP_KERNEL);
2073 nl_table[unit].groups = groups;
2111 int __netlink_change_ngroups(struct sock *sk, unsigned int groups)
2116 if (groups < 32)
2117 groups = 32;
2119 if (NLGRPSZ(tbl->groups) < NLGRPSZ(groups)) {
2120 new = kzalloc(sizeof(*new) + NLGRPSZ(groups), GFP_ATOMIC);
2124 memcpy(new->masks, old->masks, NLGRPSZ(tbl->groups));
2129 tbl->groups = groups;
2135 * netlink_change_ngroups - change number of multicast groups
2137 * This changes the number of multicast groups that are available
2139 * change the number of groups to below 32. Also note that it does
2140 * not implicitly clear listeners from groups that are removed when
2141 * the number of groups is reduced.
2144 * @groups: The new number of groups.
2146 int netlink_change_ngroups(struct sock *sk, unsigned int groups)
2151 err = __netlink_change_ngroups(sk, groups);
2731 const unsigned long *groups;
2734 * nlk->groups under us. The old buffer is freed after an
2737 groups = READ_ONCE(nlk->groups);
2743 groups ? (u32)groups[0] : 0,
2884 int groups = 32;
2886 listeners = kzalloc(sizeof(*listeners) + NLGRPSZ(groups), GFP_KERNEL);
2892 nl_table[NETLINK_USERSOCK].groups = groups;