diff options
Diffstat (limited to 'mm/slab_common.c')
-rw-r--r-- | mm/slab_common.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index dcdab81bd240..06aeaf091f21 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c | |||
@@ -834,14 +834,9 @@ void print_slabinfo_header(struct seq_file *m) | |||
834 | seq_putc(m, '\n'); | 834 | seq_putc(m, '\n'); |
835 | } | 835 | } |
836 | 836 | ||
837 | static void *s_start(struct seq_file *m, loff_t *pos) | 837 | void *slab_start(struct seq_file *m, loff_t *pos) |
838 | { | 838 | { |
839 | loff_t n = *pos; | ||
840 | |||
841 | mutex_lock(&slab_mutex); | 839 | mutex_lock(&slab_mutex); |
842 | if (!n) | ||
843 | print_slabinfo_header(m); | ||
844 | |||
845 | return seq_list_start(&slab_caches, *pos); | 840 | return seq_list_start(&slab_caches, *pos); |
846 | } | 841 | } |
847 | 842 | ||
@@ -903,10 +898,12 @@ int cache_show(struct kmem_cache *s, struct seq_file *m) | |||
903 | return 0; | 898 | return 0; |
904 | } | 899 | } |
905 | 900 | ||
906 | static int s_show(struct seq_file *m, void *p) | 901 | static int slab_show(struct seq_file *m, void *p) |
907 | { | 902 | { |
908 | struct kmem_cache *s = list_entry(p, struct kmem_cache, list); | 903 | struct kmem_cache *s = list_entry(p, struct kmem_cache, list); |
909 | 904 | ||
905 | if (p == slab_caches.next) | ||
906 | print_slabinfo_header(m); | ||
910 | if (!is_root_cache(s)) | 907 | if (!is_root_cache(s)) |
911 | return 0; | 908 | return 0; |
912 | return cache_show(s, m); | 909 | return cache_show(s, m); |
@@ -926,10 +923,10 @@ static int s_show(struct seq_file *m, void *p) | |||
926 | * + further values on SMP and with statistics enabled | 923 | * + further values on SMP and with statistics enabled |
927 | */ | 924 | */ |
928 | static const struct seq_operations slabinfo_op = { | 925 | static const struct seq_operations slabinfo_op = { |
929 | .start = s_start, | 926 | .start = slab_start, |
930 | .next = slab_next, | 927 | .next = slab_next, |
931 | .stop = slab_stop, | 928 | .stop = slab_stop, |
932 | .show = s_show, | 929 | .show = slab_show, |
933 | }; | 930 | }; |
934 | 931 | ||
935 | static int slabinfo_open(struct inode *inode, struct file *file) | 932 | static int slabinfo_open(struct inode *inode, struct file *file) |