aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2006-01-08 04:00:36 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 23:12:39 -0500
commit85289f98ddc13f6cea82c59d6ff78f9d205dfccc (patch)
tree84db27aed1783fb1bc780f7ebd3d8cd14bdc90bd /mm/slab.c
parentf9f7500521b25dbf1aba476b81230489ad8e2c4b (diff)
[PATCH] slab: extract slabinfo header printing to separate function
This patch extracts slabinfo header printing to a separate function print_slabinfo_header() to make s_start() more readable. Signed-off-by: Matthew Dobson <colpatch@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/mm/slab.c b/mm/slab.c
index eb70fddf2059..3d3b5a46854f 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3364,32 +3364,37 @@ next:
3364 3364
3365#ifdef CONFIG_PROC_FS 3365#ifdef CONFIG_PROC_FS
3366 3366
3367static void *s_start(struct seq_file *m, loff_t *pos) 3367static void print_slabinfo_header(struct seq_file *m)
3368{ 3368{
3369 loff_t n = *pos; 3369 /*
3370 struct list_head *p; 3370 * Output format version, so at least we can change it
3371 3371 * without _too_ many complaints.
3372 down(&cache_chain_sem); 3372 */
3373 if (!n) {
3374 /*
3375 * Output format version, so at least we can change it
3376 * without _too_ many complaints.
3377 */
3378#if STATS 3373#if STATS
3379 seq_puts(m, "slabinfo - version: 2.1 (statistics)\n"); 3374 seq_puts(m, "slabinfo - version: 2.1 (statistics)\n");
3380#else 3375#else
3381 seq_puts(m, "slabinfo - version: 2.1\n"); 3376 seq_puts(m, "slabinfo - version: 2.1\n");
3382#endif 3377#endif
3383 seq_puts(m, "# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab>"); 3378 seq_puts(m, "# name <active_objs> <num_objs> <objsize> "
3384 seq_puts(m, " : tunables <limit> <batchcount> <sharedfactor>"); 3379 "<objperslab> <pagesperslab>");
3385 seq_puts(m, " : slabdata <active_slabs> <num_slabs> <sharedavail>"); 3380 seq_puts(m, " : tunables <limit> <batchcount> <sharedfactor>");
3381 seq_puts(m, " : slabdata <active_slabs> <num_slabs> <sharedavail>");
3386#if STATS 3382#if STATS
3387 seq_puts(m, " : globalstat <listallocs> <maxobjs> <grown> <reaped>" 3383 seq_puts(m, " : globalstat <listallocs> <maxobjs> <grown> <reaped> "
3388 " <error> <maxfreeable> <nodeallocs> <remotefrees>"); 3384 "<error> <maxfreeable> <nodeallocs> <remotefrees>");
3389 seq_puts(m, " : cpustat <allochit> <allocmiss> <freehit> <freemiss>"); 3385 seq_puts(m, " : cpustat <allochit> <allocmiss> <freehit> <freemiss>");
3390#endif 3386#endif
3391 seq_putc(m, '\n'); 3387 seq_putc(m, '\n');
3392 } 3388}
3389
3390static void *s_start(struct seq_file *m, loff_t *pos)
3391{
3392 loff_t n = *pos;
3393 struct list_head *p;
3394
3395 down(&cache_chain_sem);
3396 if (!n)
3397 print_slabinfo_header(m);
3393 p = cache_chain.next; 3398 p = cache_chain.next;
3394 while (n--) { 3399 while (n--) {
3395 p = p->next; 3400 p = p->next;