ip6_flowlabel.c (163849ea9b4c5d50fbd324692461983d18faadad) ip6_flowlabel.c (2c8c1e7297e19bdef3c178c3ea41d898a7716e3e)
1/*
2 * ip6_flowlabel.c IPv6 flowlabel manager.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *

--- 140 unchanged lines hidden (view full) ---

149 if (!sched && atomic_read(&fl_size))
150 sched = now + FL_MAX_LINGER;
151 if (sched) {
152 mod_timer(&ip6_fl_gc_timer, sched);
153 }
154 write_unlock(&ip6_fl_lock);
155}
156
1/*
2 * ip6_flowlabel.c IPv6 flowlabel manager.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *

--- 140 unchanged lines hidden (view full) ---

149 if (!sched && atomic_read(&fl_size))
150 sched = now + FL_MAX_LINGER;
151 if (sched) {
152 mod_timer(&ip6_fl_gc_timer, sched);
153 }
154 write_unlock(&ip6_fl_lock);
155}
156
157static void ip6_fl_purge(struct net *net)
157static void __net_exit ip6_fl_purge(struct net *net)
158{
159 int i;
160
161 write_lock(&ip6_fl_lock);
162 for (i = 0; i <= FL_HASH_MASK; i++) {
163 struct ip6_flowlabel *fl, **flp;
164 flp = &fl_ht[i];
165 while ((fl = *flp) != NULL) {

--- 564 unchanged lines hidden (view full) ---

730static const struct file_operations ip6fl_seq_fops = {
731 .owner = THIS_MODULE,
732 .open = ip6fl_seq_open,
733 .read = seq_read,
734 .llseek = seq_lseek,
735 .release = seq_release_net,
736};
737
158{
159 int i;
160
161 write_lock(&ip6_fl_lock);
162 for (i = 0; i <= FL_HASH_MASK; i++) {
163 struct ip6_flowlabel *fl, **flp;
164 flp = &fl_ht[i];
165 while ((fl = *flp) != NULL) {

--- 564 unchanged lines hidden (view full) ---

730static const struct file_operations ip6fl_seq_fops = {
731 .owner = THIS_MODULE,
732 .open = ip6fl_seq_open,
733 .read = seq_read,
734 .llseek = seq_lseek,
735 .release = seq_release_net,
736};
737
738static int ip6_flowlabel_proc_init(struct net *net)
738static int __net_init ip6_flowlabel_proc_init(struct net *net)
739{
740 if (!proc_net_fops_create(net, "ip6_flowlabel",
741 S_IRUGO, &ip6fl_seq_fops))
742 return -ENOMEM;
743 return 0;
744}
745
739{
740 if (!proc_net_fops_create(net, "ip6_flowlabel",
741 S_IRUGO, &ip6fl_seq_fops))
742 return -ENOMEM;
743 return 0;
744}
745
746static void ip6_flowlabel_proc_fini(struct net *net)
746static void __net_exit ip6_flowlabel_proc_fini(struct net *net)
747{
748 proc_net_remove(net, "ip6_flowlabel");
749}
750#else
751static inline int ip6_flowlabel_proc_init(struct net *net)
752{
753 return 0;
754}
755static inline void ip6_flowlabel_proc_fini(struct net *net)
756{
747{
748 proc_net_remove(net, "ip6_flowlabel");
749}
750#else
751static inline int ip6_flowlabel_proc_init(struct net *net)
752{
753 return 0;
754}
755static inline void ip6_flowlabel_proc_fini(struct net *net)
756{
757 return ;
758}
759#endif
760
757}
758#endif
759
761static inline void ip6_flowlabel_net_exit(struct net *net)
760static void __net_exit ip6_flowlabel_net_exit(struct net *net)
762{
763 ip6_fl_purge(net);
764 ip6_flowlabel_proc_fini(net);
765}
766
767static struct pernet_operations ip6_flowlabel_net_ops = {
768 .init = ip6_flowlabel_proc_init,
769 .exit = ip6_flowlabel_net_exit,

--- 12 unchanged lines hidden ---
761{
762 ip6_fl_purge(net);
763 ip6_flowlabel_proc_fini(net);
764}
765
766static struct pernet_operations ip6_flowlabel_net_ops = {
767 .init = ip6_flowlabel_proc_init,
768 .exit = ip6_flowlabel_net_exit,

--- 12 unchanged lines hidden ---