diff options
author | Christoph Hellwig <hch@lst.de> | 2018-05-15 16:57:23 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 08:23:35 +0300 |
commit | 3f3942aca6da351a12543aa776467791b63b3a78 (patch) | |
tree | 31030e086ea36920e07078ea2289b9b72c0b2939 /fs/proc/internal.h | |
parent | 44414d82cfe0f68cb59d0a42f599ccd893ae0032 (diff) | |
download | linux-3f3942aca6da351a12543aa776467791b63b3a78.tar.xz |
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>
Diffstat (limited to 'fs/proc/internal.h')
-rw-r--r-- | fs/proc/internal.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/proc/internal.h b/fs/proc/internal.h index bcfe830ffd59..84c68508a256 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h @@ -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; |