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>
This commit is contained in:
@@ -28,4 +28,17 @@ static inline struct net *seq_file_net(struct seq_file *seq)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* This one is needed for single_open_net since net is stored directly in
|
||||
* private not as a struct i.e. seq_file_net can't be used.
|
||||
*/
|
||||
static inline struct net *seq_file_single_net(struct seq_file *seq)
|
||||
{
|
||||
#ifdef CONFIG_NET_NS
|
||||
return (struct net *)seq->private;
|
||||
#else
|
||||
return &init_net;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user