diff options
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 37 |
1 files changed, 25 insertions, 12 deletions
@@ -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> |
@@ -2930,8 +2931,10 @@ static int slab_memory_callback(struct notifier_block *self, | |||
2930 | case MEM_CANCEL_OFFLINE: | 2931 | case MEM_CANCEL_OFFLINE: |
2931 | break; | 2932 | break; |
2932 | } | 2933 | } |
2933 | 2934 | if (ret) | |
2934 | ret = notifier_from_errno(ret); | 2935 | ret = notifier_from_errno(ret); |
2936 | else | ||
2937 | ret = NOTIFY_OK; | ||
2935 | return ret; | 2938 | return ret; |
2936 | } | 2939 | } |
2937 | 2940 | ||
@@ -3594,7 +3597,7 @@ static int list_locations(struct kmem_cache *s, char *buf, | |||
3594 | for (i = 0; i < t.count; i++) { | 3597 | for (i = 0; i < t.count; i++) { |
3595 | struct location *l = &t.loc[i]; | 3598 | struct location *l = &t.loc[i]; |
3596 | 3599 | ||
3597 | if (len > PAGE_SIZE - 100) | 3600 | if (len > PAGE_SIZE - KSYM_SYMBOL_LEN - 100) |
3598 | break; | 3601 | break; |
3599 | len += sprintf(buf + len, "%7ld ", l->count); | 3602 | len += sprintf(buf + len, "%7ld ", l->count); |
3600 | 3603 | ||
@@ -4417,14 +4420,6 @@ __initcall(slab_sysfs_init); | |||
4417 | * The /proc/slabinfo ABI | 4420 | * The /proc/slabinfo ABI |
4418 | */ | 4421 | */ |
4419 | #ifdef CONFIG_SLABINFO | 4422 | #ifdef CONFIG_SLABINFO |
4420 | |||
4421 | ssize_t slabinfo_write(struct file *file, const char __user *buffer, | ||
4422 | size_t count, loff_t *ppos) | ||
4423 | { | ||
4424 | return -EINVAL; | ||
4425 | } | ||
4426 | |||
4427 | |||
4428 | static void print_slabinfo_header(struct seq_file *m) | 4423 | static void print_slabinfo_header(struct seq_file *m) |
4429 | { | 4424 | { |
4430 | seq_puts(m, "slabinfo - version: 2.1\n"); | 4425 | seq_puts(m, "slabinfo - version: 2.1\n"); |
@@ -4492,11 +4487,29 @@ static int s_show(struct seq_file *m, void *p) | |||
4492 | return 0; | 4487 | return 0; |
4493 | } | 4488 | } |
4494 | 4489 | ||
4495 | const struct seq_operations slabinfo_op = { | 4490 | static const struct seq_operations slabinfo_op = { |
4496 | .start = s_start, | 4491 | .start = s_start, |
4497 | .next = s_next, | 4492 | .next = s_next, |
4498 | .stop = s_stop, | 4493 | .stop = s_stop, |
4499 | .show = s_show, | 4494 | .show = s_show, |
4500 | }; | 4495 | }; |
4501 | 4496 | ||
4497 | static int slabinfo_open(struct inode *inode, struct file *file) | ||
4498 | { | ||
4499 | return seq_open(file, &slabinfo_op); | ||
4500 | } | ||
4501 | |||
4502 | static const struct file_operations proc_slabinfo_operations = { | ||
4503 | .open = slabinfo_open, | ||
4504 | .read = seq_read, | ||
4505 | .llseek = seq_lseek, | ||
4506 | .release = seq_release, | ||
4507 | }; | ||
4508 | |||
4509 | static int __init slab_proc_init(void) | ||
4510 | { | ||
4511 | proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations); | ||
4512 | return 0; | ||
4513 | } | ||
4514 | module_init(slab_proc_init); | ||
4502 | #endif /* CONFIG_SLABINFO */ | 4515 | #endif /* CONFIG_SLABINFO */ |