/proc questions -- free_proc_entry() unconditionally kfree's proc_dir_entry ??

From: David Adair (dadair@Brocade.COM)
Date: Wed May 10 2000 - 13:14:42 EDT

  • Next message: Tim Hockin: "Re: eepro100 probs"

    I would greatly appreciate any help in understanding the
    intent/history of the following code from fs/proc/generic.c:

    void free_proc_entry(struct proc_dir_entry *de)
    {
            int ino = de->low_ino;
            if (ino < PROC_DYNAMIC_FIRST &&
                ino >= PROC_DYNAMIC_FIRST+PROC_NDYNAMIC)
                    return;
            if (S_ISLNK(de->mode) && de->data)
                    kfree(de->data);
            kfree(de);
    }

    1. The first "if" statement appears to be dead code -- is this on purpose
       or should the condition be || ?

    2. Am I correct in assuming that it is bad luck to call proc_register()
    from a module (there is no proc_unregister()) ? This is probably just
    as well since create_proc_entry() seems more future proof anyway.

    3. Would the ability to mount additional (empty) procfs root directories
    be of benefit to anyone besides me ? I have 50-60 device operations
    that I would like to bind to user space by name with a file system
    instead of magic IOCTL numbers, but really hate to clutter up
    /proc with random side effects. Is this useful or just dumb ?

    Thank You
    David Adair

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



    This archive was generated by hypermail 2b29 : Wed May 10 2000 - 13:17:54 EDT