diff options
author | Christoph Hellwig <hch@lst.de> | 2018-04-13 13:44:18 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 01:23:35 -0400 |
commit | fddda2b7b521185f3aa018f9559eb33b0aee53a9 (patch) | |
tree | ece18b3d82822f8eaefd8b0afa2f93307e83b253 /fs/cachefiles/proc.c | |
parent | 7aed53d1dfd14d468e065212ce45068e2b50c1fa (diff) |
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 'fs/cachefiles/proc.c')
-rw-r--r-- | fs/cachefiles/proc.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/fs/cachefiles/proc.c b/fs/cachefiles/proc.c index 125b90f6c796..0ce1aa56b67f 100644 --- a/fs/cachefiles/proc.c +++ b/fs/cachefiles/proc.c | |||
@@ -85,21 +85,6 @@ static const struct seq_operations cachefiles_histogram_ops = { | |||
85 | }; | 85 | }; |
86 | 86 | ||
87 | /* | 87 | /* |
88 | * open "/proc/fs/cachefiles/XXX" which provide statistics summaries | ||
89 | */ | ||
90 | static int cachefiles_histogram_open(struct inode *inode, struct file *file) | ||
91 | { | ||
92 | return seq_open(file, &cachefiles_histogram_ops); | ||
93 | } | ||
94 | |||
95 | static const struct file_operations cachefiles_histogram_fops = { | ||
96 | .open = cachefiles_histogram_open, | ||
97 | .read = seq_read, | ||
98 | .llseek = seq_lseek, | ||
99 | .release = seq_release, | ||
100 | }; | ||
101 | |||
102 | /* | ||
103 | * initialise the /proc/fs/cachefiles/ directory | 88 | * initialise the /proc/fs/cachefiles/ directory |
104 | */ | 89 | */ |
105 | int __init cachefiles_proc_init(void) | 90 | int __init cachefiles_proc_init(void) |
@@ -109,8 +94,8 @@ int __init cachefiles_proc_init(void) | |||
109 | if (!proc_mkdir("fs/cachefiles", NULL)) | 94 | if (!proc_mkdir("fs/cachefiles", NULL)) |
110 | goto error_dir; | 95 | goto error_dir; |
111 | 96 | ||
112 | if (!proc_create("fs/cachefiles/histogram", S_IFREG | 0444, NULL, | 97 | if (!proc_create_seq("fs/cachefiles/histogram", S_IFREG | 0444, NULL, |
113 | &cachefiles_histogram_fops)) | 98 | &cachefiles_histogram_ops)) |
114 | goto error_histogram; | 99 | goto error_histogram; |
115 | 100 | ||
116 | _leave(" = 0"); | 101 | _leave(" = 0"); |