diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-05 16:59:10 -0400 |
---|---|---|
committer | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-23 07:17:27 -0400 |
commit | a0ec95a8e69792e4ad642daac037c9b01ea3e2cd (patch) | |
tree | ec8f483871151c152c198b605ab7ebd6046271b8 /fs/proc | |
parent | d6917e19f3fda8e1f88bc23ddceed952927bd716 (diff) |
proc: move /proc/slab_allocators boilerplate to mm/slab.c
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/proc_misc.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 9e1d2684ce93..5bca02842d07 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -144,33 +144,6 @@ static const struct file_operations proc_slabinfo_operations = { | |||
144 | .llseek = seq_lseek, | 144 | .llseek = seq_lseek, |
145 | .release = seq_release, | 145 | .release = seq_release, |
146 | }; | 146 | }; |
147 | |||
148 | #ifdef CONFIG_DEBUG_SLAB_LEAK | ||
149 | extern const struct seq_operations slabstats_op; | ||
150 | static int slabstats_open(struct inode *inode, struct file *file) | ||
151 | { | ||
152 | unsigned long *n = kzalloc(PAGE_SIZE, GFP_KERNEL); | ||
153 | int ret = -ENOMEM; | ||
154 | if (n) { | ||
155 | ret = seq_open(file, &slabstats_op); | ||
156 | if (!ret) { | ||
157 | struct seq_file *m = file->private_data; | ||
158 | *n = PAGE_SIZE / (2 * sizeof(unsigned long)); | ||
159 | m->private = n; | ||
160 | n = NULL; | ||
161 | } | ||
162 | kfree(n); | ||
163 | } | ||
164 | return ret; | ||
165 | } | ||
166 | |||
167 | static const struct file_operations proc_slabstats_operations = { | ||
168 | .open = slabstats_open, | ||
169 | .read = seq_read, | ||
170 | .llseek = seq_lseek, | ||
171 | .release = seq_release_private, | ||
172 | }; | ||
173 | #endif | ||
174 | #endif | 147 | #endif |
175 | 148 | ||
176 | #ifdef CONFIG_MMU | 149 | #ifdef CONFIG_MMU |
@@ -338,9 +311,6 @@ void __init proc_misc_init(void) | |||
338 | /* And now for trickier ones */ | 311 | /* And now for trickier ones */ |
339 | #ifdef CONFIG_SLABINFO | 312 | #ifdef CONFIG_SLABINFO |
340 | proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations); | 313 | proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations); |
341 | #ifdef CONFIG_DEBUG_SLAB_LEAK | ||
342 | proc_create("slab_allocators", 0, NULL, &proc_slabstats_operations); | ||
343 | #endif | ||
344 | #endif | 314 | #endif |
345 | #ifdef CONFIG_MMU | 315 | #ifdef CONFIG_MMU |
346 | proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations); | 316 | proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations); |