]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[PATCH] proc: Replace proc_inode.type with proc_inode.fd
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 26 Jun 2006 07:25:44 +0000 (00:25 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 26 Jun 2006 16:58:24 +0000 (09:58 -0700)
The sole renaming use of proc_inode.type is to discover the file descriptor
number, so just store the file descriptor number and don't wory about
processing this field.  This removes any /proc limits on the maximum number of
file descriptors, and clears the path to make the hard coded /proc inode
numbers go away.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/proc/base.c
fs/proc/inode.c
fs/proc/internal.h
include/linux/proc_fs.h

index fa0e6bee40fa0570e1fee4a9bd1e7fb4cc0142f3..9562df760901788dc79ae2add6ddec6021126076 100644 (file)
@@ -297,7 +297,7 @@ static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsm
        struct task_struct *task = proc_task(inode);
        struct files_struct *files;
        struct file *file;
-       int fd = proc_type(inode) - PROC_TID_FD_DIR;
+       int fd = proc_fd(inode);
 
        files = get_files_struct(task);
        if (files) {
@@ -1368,7 +1368,6 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st
         */
        get_task_struct(task);
        ei->task = task;
-       ei->type = ino;
        inode->i_uid = 0;
        inode->i_gid = 0;
        if (task_dumpable(task)) {
@@ -1418,7 +1417,7 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
 {
        struct inode *inode = dentry->d_inode;
        struct task_struct *task = proc_task(inode);
-       int fd = proc_type(inode) - PROC_TID_FD_DIR;
+       int fd = proc_fd(inode);
        struct files_struct *files;
 
        files = get_files_struct(task);
@@ -1525,6 +1524,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry,
        if (!inode)
                goto out;
        ei = PROC_I(inode);
+       ei->fd = fd;
        files = get_files_struct(task);
        if (!files)
                goto out_unlock;
index 722b9c4631113d627fc8e4be5359dbf81092c8ff..fbc94df138a76b94d7b5bcff19619d1e5784bab1 100644 (file)
@@ -95,7 +95,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
        if (!ei)
                return NULL;
        ei->task = NULL;
-       ei->type = 0;
+       ei->fd = 0;
        ei->op.proc_get_link = NULL;
        ei->pde = NULL;
        inode = &ei->vfs_inode;
index 0502f17b860def3b7e221783979aa4a4eba59a7d..6264b7a3a9f0a0d0a25f6231fe3bba0e734d773d 100644 (file)
@@ -46,7 +46,7 @@ static inline struct task_struct *proc_task(struct inode *inode)
        return PROC_I(inode)->task;
 }
 
-static inline int proc_type(struct inode *inode)
+static inline int proc_fd(struct inode *inode)
 {
-       return PROC_I(inode)->type;
+       return PROC_I(inode)->fd;
 }
index 5810d28fbed9c193ddc9d550b5eb1c97aee45a55..9dd84884abb144b9e84cd509ff34a877abba56ef 100644 (file)
@@ -249,7 +249,7 @@ extern void kclist_add(struct kcore_list *, void *, size_t);
 
 struct proc_inode {
        struct task_struct *task;
-       int type;
+       int fd;
        union {
                int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **);
                int (*proc_read)(struct task_struct *task, char *page);