Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net_sched: add struct net pointer to tcf_proto_ops->dump

It will be needed by the next patch.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

WANG Cong and committed by
David S. Miller
832d1d5b a56e1953

+16 -15
+1 -1
include/net/sch_generic.h
··· 204 204 void (*walk)(struct tcf_proto*, struct tcf_walker *arg); 205 205 206 206 /* rtnetlink specific */ 207 - int (*dump)(struct tcf_proto*, unsigned long, 207 + int (*dump)(struct net*, struct tcf_proto*, unsigned long, 208 208 struct sk_buff *skb, struct tcmsg*); 209 209 210 210 struct module *owner;
+6 -5
net/sched/cls_api.c
··· 340 340 return err; 341 341 } 342 342 343 - static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, 343 + static int tcf_fill_node(struct net *net, struct sk_buff *skb, struct tcf_proto *tp, 344 344 unsigned long fh, u32 portid, u32 seq, u16 flags, int event) 345 345 { 346 346 struct tcmsg *tcm; ··· 362 362 tcm->tcm_handle = fh; 363 363 if (RTM_DELTFILTER != event) { 364 364 tcm->tcm_handle = 0; 365 - if (tp->ops->dump && tp->ops->dump(tp, fh, skb, tcm) < 0) 365 + if (tp->ops->dump && tp->ops->dump(net, tp, fh, skb, tcm) < 0) 366 366 goto nla_put_failure; 367 367 } 368 368 nlh->nlmsg_len = skb_tail_pointer(skb) - b; ··· 385 385 if (!skb) 386 386 return -ENOBUFS; 387 387 388 - if (tcf_fill_node(skb, tp, fh, portid, n->nlmsg_seq, 0, event) <= 0) { 388 + if (tcf_fill_node(net, skb, tp, fh, portid, n->nlmsg_seq, 0, event) <= 0) { 389 389 kfree_skb(skb); 390 390 return -EINVAL; 391 391 } ··· 404 404 struct tcf_walker *arg) 405 405 { 406 406 struct tcf_dump_args *a = (void *)arg; 407 + struct net *net = sock_net(a->skb->sk); 407 408 408 - return tcf_fill_node(a->skb, tp, n, NETLINK_CB(a->cb->skb).portid, 409 + return tcf_fill_node(net, a->skb, tp, n, NETLINK_CB(a->cb->skb).portid, 409 410 a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTFILTER); 410 411 } 411 412 ··· 464 463 if (t > s_t) 465 464 memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0])); 466 465 if (cb->args[1] == 0) { 467 - if (tcf_fill_node(skb, tp, 0, NETLINK_CB(cb->skb).portid, 466 + if (tcf_fill_node(net, skb, tp, 0, NETLINK_CB(cb->skb).portid, 468 467 cb->nlh->nlmsg_seq, NLM_F_MULTI, 469 468 RTM_NEWTFILTER) <= 0) 470 469 break;
+1 -1
net/sched/cls_basic.c
··· 241 241 } 242 242 } 243 243 244 - static int basic_dump(struct tcf_proto *tp, unsigned long fh, 244 + static int basic_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, 245 245 struct sk_buff *skb, struct tcmsg *t) 246 246 { 247 247 struct basic_filter *f = (struct basic_filter *) fh;
+1 -1
net/sched/cls_bpf.c
··· 295 295 return ret; 296 296 } 297 297 298 - static int cls_bpf_dump(struct tcf_proto *tp, unsigned long fh, 298 + static int cls_bpf_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, 299 299 struct sk_buff *skb, struct tcmsg *tm) 300 300 { 301 301 struct cls_bpf_prog *prog = (struct cls_bpf_prog *) fh;
+1 -1
net/sched/cls_cgroup.c
··· 164 164 arg->count++; 165 165 } 166 166 167 - static int cls_cgroup_dump(struct tcf_proto *tp, unsigned long fh, 167 + static int cls_cgroup_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, 168 168 struct sk_buff *skb, struct tcmsg *t) 169 169 { 170 170 struct cls_cgroup_head *head = tp->root;
+1 -1
net/sched/cls_flow.c
··· 563 563 { 564 564 } 565 565 566 - static int flow_dump(struct tcf_proto *tp, unsigned long fh, 566 + static int flow_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, 567 567 struct sk_buff *skb, struct tcmsg *t) 568 568 { 569 569 struct flow_filter *f = (struct flow_filter *)fh;
+1 -1
net/sched/cls_fw.c
··· 324 324 } 325 325 } 326 326 327 - static int fw_dump(struct tcf_proto *tp, unsigned long fh, 327 + static int fw_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, 328 328 struct sk_buff *skb, struct tcmsg *t) 329 329 { 330 330 struct fw_head *head = (struct fw_head *)tp->root;
+1 -1
net/sched/cls_route.c
··· 551 551 } 552 552 } 553 553 554 - static int route4_dump(struct tcf_proto *tp, unsigned long fh, 554 + static int route4_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, 555 555 struct sk_buff *skb, struct tcmsg *t) 556 556 { 557 557 struct route4_filter *f = (struct route4_filter *)fh;
+1 -1
net/sched/cls_rsvp.h
··· 594 594 } 595 595 } 596 596 597 - static int rsvp_dump(struct tcf_proto *tp, unsigned long fh, 597 + static int rsvp_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, 598 598 struct sk_buff *skb, struct tcmsg *t) 599 599 { 600 600 struct rsvp_filter *f = (struct rsvp_filter *)fh;
+1 -1
net/sched/cls_tcindex.c
··· 422 422 } 423 423 424 424 425 - static int tcindex_dump(struct tcf_proto *tp, unsigned long fh, 425 + static int tcindex_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, 426 426 struct sk_buff *skb, struct tcmsg *t) 427 427 { 428 428 struct tcindex_data *p = PRIV(tp);
+1 -1
net/sched/cls_u32.c
··· 712 712 } 713 713 } 714 714 715 - static int u32_dump(struct tcf_proto *tp, unsigned long fh, 715 + static int u32_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, 716 716 struct sk_buff *skb, struct tcmsg *t) 717 717 { 718 718 struct tc_u_knode *n = (struct tc_u_knode *)fh;