From: Andrew Morton <akpm@osdl.org>
To: Nathan Lynch <nathanl@austin.ibm.com>
Cc: linux-kernel@vger.kernel.org, olof@austin.ibm.com
Subject: Re: [PATCH] Increase number of dynamic inodes in procfs (2.6.5)
Date: Wed, 14 Apr 2004 19:51:16 -0700 [thread overview]
Message-ID: <20040414195116.778fa4b2.akpm@osdl.org> (raw)
In-Reply-To: <407DF5AD.5090909@austin.ibm.com>
Nathan Lynch <nathanl@austin.ibm.com> wrote:
>
> > This open-codes a simple version of lib/idr.c. Please use lib/idr.c
> > instead. There's an example in fs/super.c
>
> Ok, thanks for the tip. Is this better?
Looks OK. How well tested was it? Nothing calls init_proc_inum_idr().
Maybe all-zeroes happens to work.
Happily, there's an idr patch in -mm which allows us to initialise these
guys at compile time, so...
diff -puN fs/proc/generic.c~increase-number-of-dynamic-inodes-in-procfs-265-idr-init fs/proc/generic.c
--- 25/fs/proc/generic.c~increase-number-of-dynamic-inodes-in-procfs-265-idr-init 2004-04-14 19:47:41.313236640 -0700
+++ 25-akpm/fs/proc/generic.c 2004-04-14 19:48:42.484937128 -0700
@@ -277,16 +277,11 @@ static int xlate_proc_name(const char *n
return 0;
}
-static struct idr proc_inum_idr;
+static DEFINE_IDR(proc_inum_idr);
static spinlock_t proc_inum_lock = SPIN_LOCK_UNLOCKED; /* protects the above */
#define PROC_DYNAMIC_FIRST 0xF0000000UL
-void __init init_proc_inum_idr(void)
-{
- idr_init(&proc_inum_idr);
-}
-
/*
* Return an inode number between PROC_DYNAMIC_FIRST and
* 0xffffffff, or zero on failure.
@@ -376,6 +371,7 @@ struct dentry *proc_lookup(struct inode
continue;
if (!memcmp(dentry->d_name.name, de->name, de->namelen)) {
unsigned int ino = de->low_ino;
+
error = -EINVAL;
inode = proc_get_inode(dir->i_sb, ino, de);
break;
_
next prev parent reply other threads:[~2004-04-15 2:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-13 19:36 Nathan Lynch
2004-04-14 0:06 ` Andrew Morton
2004-04-14 5:01 ` Olof Johansson
2004-04-14 5:06 ` Olof Johansson
2004-04-14 5:19 ` Andrew Morton
2004-04-15 2:38 ` Nathan Lynch
2004-04-15 2:51 ` Andrew Morton [this message]
2004-04-15 3:13 ` Nathan Lynch
2004-04-15 3:21 ` Andrew Morton
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=20040414195116.778fa4b2.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathanl@austin.ibm.com \
--cc=olof@austin.ibm.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®