printf: Remove unused 'bprintf'
[drm/drm-misc.git] / include / linux / seq_file_net.h
blob79638395bc32e6ebceb63c07564fc788bcd02043
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>
8 struct net;
9 extern struct net init_net;
11 struct seq_net_private {
12 #ifdef CONFIG_NET_NS
13 struct net *net;
14 netns_tracker ns_tracker;
15 #endif
18 static inline struct net *seq_file_net(struct seq_file *seq)
20 #ifdef CONFIG_NET_NS
21 return ((struct seq_net_private *)seq->private)->net;
22 #else
23 return &init_net;
24 #endif
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)
33 #ifdef CONFIG_NET_NS
34 return (struct net *)seq->private;
35 #else
36 return &init_net;
37 #endif
40 #endif