aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-10-05 18:42:17 -0400
committerAlexey Dobriyan <adobriyan@gmail.com>2008-10-23 07:20:06 -0400
commit7b3c3a50a3e0ea46815150d420fa276ac254572b (patch)
treea49118d99ae5bac99b660d8a44c20df2b15a7037 /mm/slub.c
parenta0ec95a8e69792e4ad642daac037c9b01ea3e2cd (diff)
proc: move /proc/slabinfo boilerplate to mm/slub.c, mm/slab.c
Lose dummy ->write hook in case of SLUB, it's possible now. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 0c83e6afe7b2..7ad489af9561 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -14,6 +14,7 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/proc_fs.h>
17#include <linux/seq_file.h> 18#include <linux/seq_file.h>
18#include <linux/cpu.h> 19#include <linux/cpu.h>
19#include <linux/cpuset.h> 20#include <linux/cpuset.h>
@@ -4417,14 +4418,6 @@ __initcall(slab_sysfs_init);
4417 * The /proc/slabinfo ABI 4418 * The /proc/slabinfo ABI
4418 */ 4419 */
4419#ifdef CONFIG_SLABINFO 4420#ifdef CONFIG_SLABINFO
4420
4421ssize_t slabinfo_write(struct file *file, const char __user *buffer,
4422 size_t count, loff_t *ppos)
4423{
4424 return -EINVAL;
4425}
4426
4427
4428static void print_slabinfo_header(struct seq_file *m) 4421static void print_slabinfo_header(struct seq_file *m)
4429{ 4422{
4430 seq_puts(m, "slabinfo - version: 2.1\n"); 4423 seq_puts(m, "slabinfo - version: 2.1\n");
@@ -4492,11 +4485,29 @@ static int s_show(struct seq_file *m, void *p)
4492 return 0; 4485 return 0;
4493} 4486}
4494 4487
4495const struct seq_operations slabinfo_op = { 4488static const struct seq_operations slabinfo_op = {
4496 .start = s_start, 4489 .start = s_start,
4497 .next = s_next, 4490 .next = s_next,
4498 .stop = s_stop, 4491 .stop = s_stop,
4499 .show = s_show, 4492 .show = s_show,
4500}; 4493};
4501 4494
4495static int slabinfo_open(struct inode *inode, struct file *file)
4496{
4497 return seq_open(file, &slabinfo_op);
4498}
4499
4500static const struct file_operations proc_slabinfo_operations = {
4501 .open = slabinfo_open,
4502 .read = seq_read,
4503 .llseek = seq_lseek,
4504 .release = seq_release,
4505};
4506
4507static int __init slab_proc_init(void)
4508{
4509 proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations);
4510 return 0;
4511}
4512module_init(slab_proc_init);
4502#endif /* CONFIG_SLABINFO */ 4513#endif /* CONFIG_SLABINFO */