proc: introduce proc_create_single{,_data}

Variants of proc_create{,_data} that directly take a seq_file show
callback and drastically reduces the boilerplate code in the callers.

All trivial callers converted over.

Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Christoph Hellwig
2018-05-15 15:57:23 +02:00
parent 44414d82cf
commit 3f3942aca6
85 changed files with 235 additions and 1509 deletions

View File

@@ -44,7 +44,10 @@ struct proc_dir_entry {
struct completion *pde_unload_completion;
const struct inode_operations *proc_iops;
const struct file_operations *proc_fops;
const struct seq_operations *seq_ops;
union {
const struct seq_operations *seq_ops;
int (*single_show)(struct seq_file *, void *);
};
void *data;
unsigned int state_size;
unsigned int low_ino;