]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/proc_fs.h
rfkill: allocate static minor
[mirror_ubuntu-bionic-kernel.git] / include / linux / proc_fs.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1da177e4
LT
2/*
3 * The proc filesystem constants/structures
4 */
59d8053f
DH
5#ifndef _LINUX_PROC_FS_H
6#define _LINUX_PROC_FS_H
1da177e4 7
59d8053f
DH
8#include <linux/types.h>
9#include <linux/fs.h>
1da177e4 10
59d8053f 11struct proc_dir_entry;
1da177e4 12
1da177e4
LT
13#ifdef CONFIG_PROC_FS
14
1da177e4 15extern void proc_root_init(void);
59d8053f 16extern void proc_flush_task(struct task_struct *);
1da177e4 17
1da177e4
LT
18extern struct proc_dir_entry *proc_symlink(const char *,
19 struct proc_dir_entry *, const char *);
59d8053f 20extern struct proc_dir_entry *proc_mkdir(const char *, struct proc_dir_entry *);
270b5ac2
DH
21extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
22 struct proc_dir_entry *, void *);
59d8053f
DH
23extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t,
24 struct proc_dir_entry *);
f97df70b 25struct proc_dir_entry *proc_create_mount_point(const char *name);
59d8053f
DH
26
27extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
28 struct proc_dir_entry *,
29 const struct file_operations *,
30 void *);
31
855d9765 32struct proc_dir_entry *proc_create(const char *name, umode_t mode, struct proc_dir_entry *parent, const struct file_operations *proc_fops);
271a15ea
DH
33extern void proc_set_size(struct proc_dir_entry *, loff_t);
34extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
c30480b9 35extern void *PDE_DATA(const struct inode *);
4a520d27 36extern void *proc_get_parent_data(const struct inode *);
59d8053f
DH
37extern void proc_remove(struct proc_dir_entry *);
38extern void remove_proc_entry(const char *, struct proc_dir_entry *);
39extern int remove_proc_subtree(const char *, struct proc_dir_entry *);
40
41#else /* CONFIG_PROC_FS */
1da177e4 42
647f010b
AM
43static inline void proc_root_init(void)
44{
45}
46
60347f67
PE
47static inline void proc_flush_task(struct task_struct *task)
48{
49}
1da177e4 50
1da177e4 51static inline struct proc_dir_entry *proc_symlink(const char *name,
59d8053f 52 struct proc_dir_entry *parent,const char *dest) { return NULL;}
1da177e4
LT
53static inline struct proc_dir_entry *proc_mkdir(const char *name,
54 struct proc_dir_entry *parent) {return NULL;}
f97df70b 55static inline struct proc_dir_entry *proc_create_mount_point(const char *name) { return NULL; }
270b5ac2
DH
56static inline struct proc_dir_entry *proc_mkdir_data(const char *name,
57 umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; }
f12a20fc 58static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,
d161a13f 59 umode_t mode, struct proc_dir_entry *parent) { return NULL; }
59d8053f
DH
60#define proc_create(name, mode, parent, proc_fops) ({NULL;})
61#define proc_create_data(name, mode, parent, proc_fops, data) ({NULL;})
62
271a15ea
DH
63static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {}
64static inline void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid) {}
c30480b9 65static inline void *PDE_DATA(const struct inode *inode) {BUG(); return NULL;}
59d8053f 66static inline void *proc_get_parent_data(const struct inode *inode) { BUG(); return NULL; }
1da177e4 67
59d8053f
DH
68static inline void proc_remove(struct proc_dir_entry *de) {}
69#define remove_proc_entry(name, parent) do {} while (0)
70static inline int remove_proc_subtree(const char *name, struct proc_dir_entry *parent) { return 0; }
9043476f 71
59d8053f 72#endif /* CONFIG_PROC_FS */
1da177e4 73
f7790029
JL
74struct net;
75
270b5ac2
DH
76static inline struct proc_dir_entry *proc_net_mkdir(
77 struct net *net, const char *name, struct proc_dir_entry *parent)
78{
79 return proc_mkdir_data(name, 0, parent, net);
80}
81
c62cce2c
AV
82struct ns_common;
83int open_related_ns(struct ns_common *ns,
84 struct ns_common *(*get_ns)(struct ns_common *ns));
85
1da177e4 86#endif /* _LINUX_PROC_FS_H */