From: Coywolf Qi Hunt <coywolf@gmail.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [patch] mnt_init() cleanup
Date: Wed, 9 Mar 2005 00:55:28 +0800 [thread overview]
Message-ID: <2cd57c9005030808554fd3c337@mail.gmail.com> (raw)
Hello akpm,
At the very beginning in 2.4 days, in mnt_init(), mount_hashtable
allocation page order was determined at runtime. Later the page order
got fixed to 0. This patch cleanups it.
Signed-off-by: Coywolf Qi Hunt <coywolf@gmail.com>
diff -Nrup 2.6.11/fs/namespace.c 2.6.11-cy/fs/namespace.c
--- 2.6.11/fs/namespace.c 2005-03-03 17:11:56.000000000 +0800
+++ 2.6.11-cy/fs/namespace.c 2005-03-08 04:52:30.000000000 +0800
@@ -1392,16 +1392,14 @@ static void __init init_mount_tree(void)
void __init mnt_init(unsigned long mempages)
{
struct list_head *d;
- unsigned long order;
unsigned int nr_hash;
int i;
mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct vfsmount),
0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
- order = 0;
mount_hashtable = (struct list_head *)
- __get_free_pages(GFP_ATOMIC, order);
+ __get_free_page(GFP_ATOMIC);
if (!mount_hashtable)
panic("Failed to allocate mount hash table\n");
@@ -1411,7 +1409,7 @@ void __init mnt_init(unsigned long mempa
* We don't guarantee that "sizeof(struct list_head)" is necessarily
* a power-of-two.
*/
- nr_hash = (1UL << order) * PAGE_SIZE / sizeof(struct list_head);
+ nr_hash = PAGE_SIZE / sizeof(struct list_head);
hash_bits = 0;
do {
hash_bits++;
@@ -1426,7 +1424,7 @@ void __init mnt_init(unsigned long mempa
hash_mask = nr_hash-1;
printk("Mount-cache hash table entries: %d (order: %ld, %ld bytes)\n",
- nr_hash, order, (PAGE_SIZE << order));
+ nr_hash, 0, PAGE_SIZE);
/* And initialize the newly allocated array */
d = mount_hashtable;
--
Coywolf Qi Hunt
Homepage http://sosdg.org/~coywolf/
reply other threads:[~2005-03-08 16:55 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=2cd57c9005030808554fd3c337@mail.gmail.com \
--to=coywolf@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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