From: Brian Gerst <bgerst@quark.didntduck.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] minor slabinfo cleanup
Date: Tue, 30 Jul 2002 21:58:26 -0400 [thread overview]
Message-ID: <3D474442.6040804@quark.didntduck.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 147 bytes --]
This patch removes the use of a magic pointer value to print the
slabinfo version header. Resend against latest BK snapshot.
--
Brian Gerst
[-- Attachment #2: slabinfo-2 --]
[-- Type: text/plain, Size: 1276 bytes --]
diff -urN linux-bk/mm/slab.c linux/mm/slab.c
--- linux-bk/mm/slab.c Tue Jul 30 20:59:28 2002
+++ linux/mm/slab.c Tue Jul 30 21:56:02 2002
@@ -1904,10 +1904,22 @@
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.1"
+#if STATS
+ " (statistics)"
+#endif
+#ifdef CONFIG_SMP
+ " (SMP)"
+#endif
+ "\n");
+ };
p = &cache_cache.next;
- while (--n) {
+ while (n--) {
p = p->next;
if (p == &cache_cache.next)
return NULL;
@@ -1919,8 +1931,6 @@
{
kmem_cache_t *cachep = p;
++*pos;
- if (p == (void *)1)
- return &cache_cache;
cachep = list_entry(cachep->next.next, kmem_cache_t, next);
return cachep == &cache_cache ? NULL : cachep;
}
@@ -1941,22 +1951,6 @@
unsigned long num_slabs;
const char *name;
- if (p == (void*)1) {
- /*
- * Output format version, so at least we can change it
- * without _too_ many complaints.
- */
- seq_puts(m, "slabinfo - version: 1.1"
-#if STATS
- " (statistics)"
-#endif
-#ifdef CONFIG_SMP
- " (SMP)"
-#endif
- "\n");
- return 0;
- }
-
spin_lock_irq(&cachep->spinlock);
active_objs = 0;
num_slabs = 0;
next reply other threads:[~2002-07-31 2:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-31 1:58 Brian Gerst [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-07-09 22:47 Brian Gerst
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=3D474442.6040804@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®