Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.25-rc7 /fs/file.c

Filename:/fs/file.c
Lines Added:5
Lines Deleted:3
Also changed in: (Previous) 2.6.25-rc6  2.6.25-rc5  2.6.25-rc4  2.6.25-rc3  2.6.25-rc2  2.6.25-rc1 
(Following) 2.6.25-rc8  2.6.25-rc9  2.6.25  2.6.25-git19  2.6.25-git20  2.6.26-rc1 

Location
[  2.6.25-rc7
  [  fs
     o  file.c

Patch

diff --git a/fs/file.c b/fs/file.c
index c5575de..5110acb 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -24,6 +24,8 @@ struct fdtable_defer {
    struct fdtable *next;
 };
 
+int sysctl_nr_open __read_mostly = 1024*1024;
+
 /*
  * We use this list to defer free fdtables that have vmalloced
  * sets/arrays. By keeping a per-cpu list, we avoid having to embed
@@ -147,8 +149,8 @@ static struct fdtable * alloc_fdtable(unsigned int nr)
    nr /= (1024 / sizeof(struct file *));
    nr = roundup_pow_of_two(nr + 1);
    nr *= (1024 / sizeof(struct file *));
-   if (nr > NR_OPEN)
-      nr = NR_OPEN;
+   if (nr > sysctl_nr_open)
+      nr = sysctl_nr_open;
 
    fdt = kmalloc(sizeof(struct fdtable), GFP_KERNEL);
    if (!fdt)
@@ -233,7 +235,7 @@ int expand_files(struct files_struct *files, int nr)
    if (nr < fdt->max_fds)
       return 0;
    /* Can we expand? */
-   if (nr >= NR_OPEN)
+   if (nr >= sysctl_nr_open)
       return -EMFILE;
 
    /* All good, so we try */


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.