Skip to content

Commit a2dcdee

Browse files
author
Christoph Hellwig
committed
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>
1 parent 1d98c16 commit a2dcdee

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎include/linux/seq_file_net.h‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,17 @@ static inline struct net *seq_file_net(struct seq_file *seq)
2828
#endif
2929
}
3030

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+
*/
35+
static 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+
3144
#endif

‎include/net/ip_vs.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,6 @@ static inline struct netns_ipvs *net_ipvs(struct net* net)
4141
return net->ipvs;
4242
}
4343

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-
*/
47-
static 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-
5644
/* Connections' size value needed by ip_vs_ctl.c */
5745
extern int ip_vs_conn_tab_size;
5846

0 commit comments

Comments
 (0)