From: Brian Gerst <bgerst@quark.didntduck.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] Fix up slabinfo code
Date: Sat, 22 Feb 2003 11:53:52 -0500 [thread overview]
Message-ID: <3E57AB20.1000103@quark.didntduck.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 107 bytes --]
Move printing the header to s_start, removing the need for the special
pointer value.
--
Brian Gerst
[-- Attachment #2: slabinfo-1 --]
[-- Type: text/plain, Size: 1247 bytes --]
diff -urN linux-2.5.62-bk2/mm/slab.c linux/mm/slab.c
--- linux-2.5.62-bk2/mm/slab.c 2003-02-18 01:30:26.000000000 -0500
+++ linux/mm/slab.c 2003-02-22 11:45:35.000000000 -0500
@@ -2194,10 +2194,19 @@
struct list_head *p;
down(&cache_chain_sem);
- if (!n)
- return (void *)1;
+ if (!n) {
+ /*
+ * Output format version, so at least we can change it
+ * without _too_ many complaints.
+ */
+ seq_puts(m, "slabinfo - version: 1.2"
+#if STATS
+ " (statistics)"
+#endif
+ "\n");
+ }
p = cache_chain.next;
- while (--n) {
+ while (n--) {
p = p->next;
if (p == &cache_chain)
return NULL;
@@ -2209,8 +2218,6 @@
{
kmem_cache_t *cachep = p;
++*pos;
- if (p == (void *)1)
- return list_entry(cache_chain.next, kmem_cache_t, next);
return cachep->next.next == &cache_chain ? NULL
: list_entry(cachep->next.next, kmem_cache_t, next);
}
@@ -2234,20 +2241,6 @@
mm_segment_t old_fs;
char tmp;
-
- if (p == (void*)1) {
- /*
- * Output format version, so at least we can change it
- * without _too_ many complaints.
- */
- seq_puts(m, "slabinfo - version: 1.2"
-#if STATS
- " (statistics)"
-#endif
- "\n");
- return 0;
- }
-
check_irq_on();
spin_lock_irq(&cachep->spinlock);
active_objs = 0;
reply other threads:[~2003-02-22 16:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E57AB20.1000103@quark.didntduck.org \
--to=bgerst@quark.didntduck.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®