lkml.org 
[lkml]   [2004]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH] Increase number of dynamic inodes in procfs (2.6.5)
    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;
    _

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:02    [W:0.022 / U:0.548 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site