From: Eric W. Biederman 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 Signed-off-by: Andrew Morton --- fs/proc/base.c | 6 +++--- fs/proc/inode.c | 2 +- fs/proc/internal.h | 4 ++-- include/linux/proc_fs.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff -puN fs/proc/base.c~proc-replace-proc_inodetype-with-proc_inodefd fs/proc/base.c --- devel/fs/proc/base.c~proc-replace-proc_inodetype-with-proc_inodefd 2006-02-27 20:58:55.000000000 -0800 +++ devel-akpm/fs/proc/base.c 2006-02-27 20:58:55.000000000 -0800 @@ -293,7 +293,7 @@ static int proc_fd_link(struct inode *in 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) { @@ -1359,7 +1359,6 @@ static struct inode *proc_pid_make_inode */ get_task_struct(task); ei->task = task; - ei->type = ino; inode->i_uid = 0; inode->i_gid = 0; if (task_dumpable(task)) { @@ -1409,7 +1408,7 @@ static int tid_fd_revalidate(struct dent { 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); @@ -1516,6 +1515,7 @@ static struct dentry *proc_lookupfd(stru if (!inode) goto out; ei = PROC_I(inode); + ei->fd = fd; files = get_files_struct(task); if (!files) goto out_unlock; diff -puN fs/proc/inode.c~proc-replace-proc_inodetype-with-proc_inodefd fs/proc/inode.c --- devel/fs/proc/inode.c~proc-replace-proc_inodetype-with-proc_inodefd 2006-02-27 20:58:55.000000000 -0800 +++ devel-akpm/fs/proc/inode.c 2006-02-27 20:58:55.000000000 -0800 @@ -95,7 +95,7 @@ static struct inode *proc_alloc_inode(st 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; diff -puN fs/proc/internal.h~proc-replace-proc_inodetype-with-proc_inodefd fs/proc/internal.h --- devel/fs/proc/internal.h~proc-replace-proc_inodetype-with-proc_inodefd 2006-02-27 20:58:55.000000000 -0800 +++ devel-akpm/fs/proc/internal.h 2006-02-27 20:58:55.000000000 -0800 @@ -46,7 +46,7 @@ static inline struct task_struct *proc_t 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; } diff -puN include/linux/proc_fs.h~proc-replace-proc_inodetype-with-proc_inodefd include/linux/proc_fs.h --- devel/include/linux/proc_fs.h~proc-replace-proc_inodetype-with-proc_inodefd 2006-02-27 20:58:55.000000000 -0800 +++ devel-akpm/include/linux/proc_fs.h 2006-02-27 20:58:55.000000000 -0800 @@ -250,7 +250,7 @@ extern void kclist_add(struct kcore_list 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); _