From: Mike Waychison <Michael.Waychison@Sun.COM>
To: Ingo Oeser <ioe-lkml@rameria.de>
Cc: Mike Waychison <Michael.Waychison@Sun.COM>,
linux-kernel@vger.kernel.org, Ian Kent <raven@themaw.net>
Subject: Re: [NFS] RE: [autofs] multiple servers per automount
Date: Wed, 15 Oct 2003 12:16:07 -0400 [thread overview]
Message-ID: <3F8D72C7.4040005@sun.com> (raw)
In-Reply-To: <200310151228.02741.ioe-lkml@rameria.de>
[-- Attachment #1: Type: text/plain, Size: 717 bytes --]
Ingo Oeser wrote:
> On Wednesday 15 October 2003 01:12, Mike Waychison wrote:
>
>>The problem still remains in 2.6 that we limit the count to 256. I've
>>attached a quick patch that I've compiled and tested. I don't know if
>>there is a better way to handle dynamic assignment of minors (haven't
>>kept up to date in that realm), but if there is, then we should probably
>> use it instead.
>
>
>
> In your patch you allocate inside the spinlock.
>
> I would suggest to do sth. like the following:
>
Better yet.. we could move it into an __init section that will panic if
the allocation fails (this should be the desired behaviour..). This way
we don't even have to grab the lock either.
Mike Waychison
[-- Attachment #2: max_anon_2.patch --]
[-- Type: text/plain, Size: 1592 bytes --]
===== fs/namespace.c 1.49 vs edited =====
--- 1.49/fs/namespace.c Thu Jul 17 22:30:49 2003
+++ edited/fs/namespace.c Wed Oct 15 15:59:11 2003
@@ -23,6 +23,7 @@
#include <linux/mount.h>
#include <asm/uaccess.h>
+extern void __init super_init(void);
extern int __init init_rootfs(void);
extern int __init sysfs_init(void);
@@ -1154,6 +1155,7 @@
d++;
i--;
} while (i);
+ super_init();
sysfs_init();
init_rootfs();
init_mount_tree();
===== fs/super.c 1.108 vs edited =====
--- 1.108/fs/super.c Wed Oct 1 15:36:45 2003
+++ edited/fs/super.c Wed Oct 15 15:59:50 2003
@@ -24,6 +24,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
+#include <linux/init.h>
#include <linux/acct.h>
#include <linux/blkdev.h>
#include <linux/quotaops.h>
@@ -527,15 +528,22 @@
* Unnamed block devices are dummy devices used by virtual
* filesystems which don't use real block-devices. -- jrs
*/
-
-enum {Max_anon = 256};
-static unsigned long unnamed_dev_in_use[Max_anon/(8*sizeof(unsigned long))];
+enum {Max_anon = PAGE_SIZE * 8};
+static void *unnamed_dev_in_use;
static spinlock_t unnamed_dev_lock = SPIN_LOCK_UNLOCKED;/* protects the above */
+void __init super_init(void)
+{
+ unnamed_dev_in_use = (void *)get_zeroed_page(GFP_KERNEL);
+ if (!unnamed_dev_in_use)
+ panic("Could not allocate anonymous device map");
+}
+
int set_anon_super(struct super_block *s, void *data)
{
int dev;
spin_lock(&unnamed_dev_lock);
+
dev = find_first_zero_bit(unnamed_dev_in_use, Max_anon);
if (dev == Max_anon) {
spin_unlock(&unnamed_dev_lock);
next prev parent reply other threads:[~2003-10-15 16:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.44.0310142131090.3044-100000@raven.themaw.net>
2003-10-14 15:52 ` [NFS] RE: [autofs] multiple servers per automount Mike Waychison
2003-10-14 20:44 ` H. Peter Anvin
2003-10-14 23:12 ` Mike Waychison
2003-10-15 10:28 ` Ingo Oeser
2003-10-15 16:16 ` Mike Waychison [this message]
2003-10-23 13:37 ` Ian Kent
2003-10-23 17:00 ` Mike Waychison
2003-10-23 17:09 ` Tim Hockin
2003-10-24 0:47 ` Ian Kent
2003-10-24 1:42 ` Tim Hockin
2003-10-15 7:22 ` Ian Kent
2003-10-15 14:31 Lever, Charles
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=3F8D72C7.4040005@sun.com \
--to=michael.waychison@sun.com \
--cc=ioe-lkml@rameria.de \
--cc=linux-kernel@vger.kernel.org \
--cc=raven@themaw.net \
/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;
as well as URLs for NNTP newsgroup(s).