aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-11 06:32:45 -0400
committerChristoph Hellwig <hch@lst.de>2018-05-16 01:24:30 -0400
commita2dcdee3748b664bf011b4b12de64e945dd4c8c2 (patch)
treed113e8f1bff5bcb75f69f15532b3bf4d3be76f04
parent1d98c16d444f99b7869b271c25f23f58c1ac68c1 (diff)
net: move seq_file_single_net to <linux/seq_file_net.h>
This helper deals with single_{open,release}_net internals and thus belongs here. Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--include/linux/seq_file_net.h13
-rw-r--r--include/net/ip_vs.h12
2 files changed, 13 insertions, 12 deletions
diff --git a/include/linux/seq_file_net.h b/include/linux/seq_file_net.h
index 43ccd84127b6..ed20faa99e05 100644
--- a/include/linux/seq_file_net.h
+++ b/include/linux/seq_file_net.h
@@ -28,4 +28,17 @@ static inline struct net *seq_file_net(struct seq_file *seq)
28#endif 28#endif
29} 29}
30 30
31/*
32 * This one is needed for single_open_net since net is stored directly in
33 * private not as a struct i.e. seq_file_net can't be used.
34 */
35static inline struct net *seq_file_single_net(struct seq_file *seq)
36{
37#ifdef CONFIG_NET_NS
38 return (struct net *)seq->private;
39#else
40 return &init_net;
41#endif
42}
43
31#endif 44#endif
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index eb0bec043c96..aea7a124e66b 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -41,18 +41,6 @@ static inline struct netns_ipvs *net_ipvs(struct net* net)
41 return net->ipvs; 41 return net->ipvs;
42} 42}
43 43
44/* This one needed for single_open_net since net is stored directly in
45 * private not as a struct i.e. seq_file_net can't be used.
46 */
47static inline struct net *seq_file_single_net(struct seq_file *seq)
48{
49#ifdef CONFIG_NET_NS
50 return (struct net *)seq->private;
51#else
52 return &init_net;
53#endif
54}
55
56/* Connections' size value needed by ip_vs_ctl.c */ 44/* Connections' size value needed by ip_vs_ctl.c */
57extern int ip_vs_conn_tab_size; 45extern int ip_vs_conn_tab_size;
58 46