1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __SEQ_FILE_NET_H__
3 #define __SEQ_FILE_NET_H__
5 #include <linux/seq_file.h>
6 #include <net/net_trackers.h>
9 extern struct net init_net;
11 struct seq_net_private {
14 netns_tracker ns_tracker;
18 static inline struct net *seq_file_net(struct seq_file *seq)
21 return ((struct seq_net_private *)seq->private)->net;
28 * This one is needed for proc_create_net_single since net is stored directly
29 * in private not as a struct i.e. seq_file_net can't be used.
31 static inline struct net *seq_file_single_net(struct seq_file *seq)
34 return (struct net *)seq->private;