diff options
Diffstat (limited to 'mm/slab_common.c')
-rw-r--r-- | mm/slab_common.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index 2d414508e9ec..538bade6df7d 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c | |||
@@ -497,6 +497,13 @@ void __init create_kmalloc_caches(unsigned long flags) | |||
497 | 497 | ||
498 | 498 | ||
499 | #ifdef CONFIG_SLABINFO | 499 | #ifdef CONFIG_SLABINFO |
500 | |||
501 | #ifdef CONFIG_SLAB | ||
502 | #define SLABINFO_RIGHTS (S_IWUSR | S_IRUSR) | ||
503 | #else | ||
504 | #define SLABINFO_RIGHTS S_IRUSR | ||
505 | #endif | ||
506 | |||
500 | void print_slabinfo_header(struct seq_file *m) | 507 | void print_slabinfo_header(struct seq_file *m) |
501 | { | 508 | { |
502 | /* | 509 | /* |
@@ -531,12 +538,12 @@ static void *s_start(struct seq_file *m, loff_t *pos) | |||
531 | return seq_list_start(&slab_caches, *pos); | 538 | return seq_list_start(&slab_caches, *pos); |
532 | } | 539 | } |
533 | 540 | ||
534 | static void *s_next(struct seq_file *m, void *p, loff_t *pos) | 541 | void *slab_next(struct seq_file *m, void *p, loff_t *pos) |
535 | { | 542 | { |
536 | return seq_list_next(p, &slab_caches, pos); | 543 | return seq_list_next(p, &slab_caches, pos); |
537 | } | 544 | } |
538 | 545 | ||
539 | static void s_stop(struct seq_file *m, void *p) | 546 | void slab_stop(struct seq_file *m, void *p) |
540 | { | 547 | { |
541 | mutex_unlock(&slab_mutex); | 548 | mutex_unlock(&slab_mutex); |
542 | } | 549 | } |
@@ -613,8 +620,8 @@ static int s_show(struct seq_file *m, void *p) | |||
613 | */ | 620 | */ |
614 | static const struct seq_operations slabinfo_op = { | 621 | static const struct seq_operations slabinfo_op = { |
615 | .start = s_start, | 622 | .start = s_start, |
616 | .next = s_next, | 623 | .next = slab_next, |
617 | .stop = s_stop, | 624 | .stop = slab_stop, |
618 | .show = s_show, | 625 | .show = s_show, |
619 | }; | 626 | }; |
620 | 627 | ||
@@ -633,7 +640,8 @@ static const struct file_operations proc_slabinfo_operations = { | |||
633 | 640 | ||
634 | static int __init slab_proc_init(void) | 641 | static int __init slab_proc_init(void) |
635 | { | 642 | { |
636 | proc_create("slabinfo", S_IRUSR, NULL, &proc_slabinfo_operations); | 643 | proc_create("slabinfo", SLABINFO_RIGHTS, NULL, |
644 | &proc_slabinfo_operations); | ||
637 | return 0; | 645 | return 0; |
638 | } | 646 | } |
639 | module_init(slab_proc_init); | 647 | module_init(slab_proc_init); |