aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slab_common.c')
-rw-r--r--mm/slab_common.c15
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
837static void *s_start(struct seq_file *m, loff_t *pos) 837void *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
906static int s_show(struct seq_file *m, void *p) 901static 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 */
928static const struct seq_operations slabinfo_op = { 925static 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
935static int slabinfo_open(struct inode *inode, struct file *file) 932static int slabinfo_open(struct inode *inode, struct file *file)