Lines Matching refs:group
37 struct psample_group *group, in psample_group_nl_fill() argument
48 ret = nla_put_u32(msg, PSAMPLE_ATTR_SAMPLE_GROUP, group->group_num); in psample_group_nl_fill()
52 ret = nla_put_u32(msg, PSAMPLE_ATTR_GROUP_REFCOUNT, group->refcount); in psample_group_nl_fill()
56 ret = nla_put_u32(msg, PSAMPLE_ATTR_GROUP_SEQ, group->seq); in psample_group_nl_fill()
71 struct psample_group *group; in psample_nl_cmd_get_group_dumpit() local
77 list_for_each_entry(group, &psample_groups_list, list) { in psample_nl_cmd_get_group_dumpit()
78 if (!net_eq(group->net, sock_net(msg->sk))) in psample_nl_cmd_get_group_dumpit()
84 err = psample_group_nl_fill(msg, group, PSAMPLE_CMD_NEW_GROUP, in psample_nl_cmd_get_group_dumpit()
118 static void psample_group_notify(struct psample_group *group, in psample_group_notify() argument
128 err = psample_group_nl_fill(msg, group, cmd, 0, 0, NLM_F_MULTI); in psample_group_notify()
130 genlmsg_multicast_netns(&psample_nl_family, group->net, msg, 0, in psample_group_notify()
139 struct psample_group *group; in psample_group_create() local
141 group = kzalloc(sizeof(*group), GFP_ATOMIC); in psample_group_create()
142 if (!group) in psample_group_create()
145 group->net = net; in psample_group_create()
146 group->group_num = group_num; in psample_group_create()
147 list_add_tail(&group->list, &psample_groups_list); in psample_group_create()
149 psample_group_notify(group, PSAMPLE_CMD_NEW_GROUP); in psample_group_create()
150 return group; in psample_group_create()
153 static void psample_group_destroy(struct psample_group *group) in psample_group_destroy() argument
155 psample_group_notify(group, PSAMPLE_CMD_DEL_GROUP); in psample_group_destroy()
156 list_del(&group->list); in psample_group_destroy()
157 kfree_rcu(group, rcu); in psample_group_destroy()
163 struct psample_group *group; in psample_group_lookup() local
165 list_for_each_entry(group, &psample_groups_list, list) in psample_group_lookup()
166 if ((group->group_num == group_num) && (group->net == net)) in psample_group_lookup()
167 return group; in psample_group_lookup()
173 struct psample_group *group; in psample_group_get() local
177 group = psample_group_lookup(net, group_num); in psample_group_get()
178 if (!group) { in psample_group_get()
179 group = psample_group_create(net, group_num); in psample_group_get()
180 if (!group) in psample_group_get()
183 group->refcount++; in psample_group_get()
187 return group; in psample_group_get()
191 void psample_group_take(struct psample_group *group) in psample_group_take() argument
194 group->refcount++; in psample_group_take()
199 void psample_group_put(struct psample_group *group) in psample_group_put() argument
203 if (--group->refcount == 0) in psample_group_put()
204 psample_group_destroy(group); in psample_group_put()
210 void psample_sample_packet(struct psample_group *group, struct sk_buff *skb, in psample_sample_packet() argument
261 ret = nla_put_u32(nl_skb, PSAMPLE_ATTR_SAMPLE_GROUP, group->group_num); in psample_sample_packet()
265 ret = nla_put_u32(nl_skb, PSAMPLE_ATTR_GROUP_SEQ, group->seq++); in psample_sample_packet()
282 genlmsg_multicast_netns(&psample_nl_family, group->net, nl_skb, 0, in psample_sample_packet()