seq_file_net.h 521 B

123456789101112131415161718192021222324252627
  1. #ifndef __SEQ_FILE_NET_H__
  2. #define __SEQ_FILE_NET_H__
  3. #include <linux/seq_file.h>
  4. struct net;
  5. extern struct net init_net;
  6. struct seq_net_private {
  7. #ifdef CONFIG_NET_NS
  8. struct net *net;
  9. #endif
  10. };
  11. int seq_open_net(struct inode *, struct file *,
  12. const struct seq_operations *, int);
  13. int seq_release_net(struct inode *, struct file *);
  14. static inline struct net *seq_file_net(struct seq_file *seq)
  15. {
  16. #ifdef CONFIG_NET_NS
  17. return ((struct seq_net_private *)seq->private)->net;
  18. #else
  19. return &init_net;
  20. #endif
  21. }
  22. #endif