diff options
author | Christoph Hellwig <hch@lst.de> | 2018-04-13 19:44:18 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 07:23:35 +0200 |
commit | fddda2b7b521185f3aa018f9559eb33b0aee53a9 (patch) | |
tree | ece18b3d82822f8eaefd8b0afa2f93307e83b253 /include/linux/proc_fs.h | |
parent | 7aed53d1dfd14d468e065212ce45068e2b50c1fa (diff) | |
download | lwn-fddda2b7b521185f3aa018f9559eb33b0aee53a9.tar.gz lwn-fddda2b7b521185f3aa018f9559eb33b0aee53a9.zip |
proc: introduce proc_create_seq{,_data}
Variants of proc_create{,_data} that directly take a struct seq_operations
argument and drastically reduces the boilerplate code in the callers.
All trivial callers converted over.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/proc_fs.h')
-rw-r--r-- | include/linux/proc_fs.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 4edcde510631..f368a896a8cb 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -9,6 +9,7 @@ #include <linux/fs.h> struct proc_dir_entry; +struct seq_operations; #ifdef CONFIG_PROC_FS @@ -23,6 +24,12 @@ extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t, extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t, struct proc_dir_entry *); struct proc_dir_entry *proc_create_mount_point(const char *name); + +struct proc_dir_entry *proc_create_seq_data(const char *name, umode_t mode, + struct proc_dir_entry *parent, const struct seq_operations *ops, + void *data); +#define proc_create_seq(name, mode, parent, ops) \ + proc_create_seq_data(name, mode, parent, ops, NULL) extern struct proc_dir_entry *proc_create_data(const char *, umode_t, struct proc_dir_entry *, @@ -57,6 +64,8 @@ static inline struct proc_dir_entry *proc_mkdir_data(const char *name, umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; } static inline struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode, struct proc_dir_entry *parent) { return NULL; } +#define proc_create_seq_data(name, mode, parent, ops, data) ({NULL;}) +#define proc_create_seq(name, mode, parent, ops) ({NULL;}) #define proc_create(name, mode, parent, proc_fops) ({NULL;}) #define proc_create_data(name, mode, parent, proc_fops, data) ({NULL;}) |