aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2006-06-26 03:25:44 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 12:58:24 -0400
commitaed7a6c476d90660ac5af860158407ae9fe61c68 (patch)
treeb8b92412f457598a2348de0eb304b9b4ec204157 /fs
parent87bfbf679ffb1e95dd9ada694f66aafc4bfa5959 (diff)
[PATCH] proc: Replace proc_inode.type with proc_inode.fd
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/base.c6
-rw-r--r--fs/proc/inode.c2
-rw-r--r--fs/proc/internal.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index fa0e6bee40fa..9562df760901 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -297,7 +297,7 @@ static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsm
297 struct task_struct *task = proc_task(inode); 297 struct task_struct *task = proc_task(inode);
298 struct files_struct *files; 298 struct files_struct *files;
299 struct file *file; 299 struct file *file;
300 int fd = proc_type(inode) - PROC_TID_FD_DIR; 300 int fd = proc_fd(inode);
301 301
302 files = get_files_struct(task); 302 files = get_files_struct(task);
303 if (files) { 303 if (files) {
@@ -1368,7 +1368,6 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st
1368 */ 1368 */
1369 get_task_struct(task); 1369 get_task_struct(task);
1370 ei->task = task; 1370 ei->task = task;
1371 ei->type = ino;
1372 inode->i_uid = 0; 1371 inode->i_uid = 0;
1373 inode->i_gid = 0; 1372 inode->i_gid = 0;
1374 if (task_dumpable(task)) { 1373 if (task_dumpable(task)) {
@@ -1418,7 +1417,7 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
1418{ 1417{
1419 struct inode *inode = dentry->d_inode; 1418 struct inode *inode = dentry->d_inode;
1420 struct task_struct *task = proc_task(inode); 1419 struct task_struct *task = proc_task(inode);
1421 int fd = proc_type(inode) - PROC_TID_FD_DIR; 1420 int fd = proc_fd(inode);
1422 struct files_struct *files; 1421 struct files_struct *files;
1423 1422
1424 files = get_files_struct(task); 1423 files = get_files_struct(task);
@@ -1525,6 +1524,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry,
1525 if (!inode) 1524 if (!inode)
1526 goto out; 1525 goto out;
1527 ei = PROC_I(inode); 1526 ei = PROC_I(inode);
1527 ei->fd = fd;
1528 files = get_files_struct(task); 1528 files = get_files_struct(task);
1529 if (!files) 1529 if (!files)
1530 goto out_unlock; 1530 goto out_unlock;
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 722b9c463111..fbc94df138a7 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -95,7 +95,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
95 if (!ei) 95 if (!ei)
96 return NULL; 96 return NULL;
97 ei->task = NULL; 97 ei->task = NULL;
98 ei->type = 0; 98 ei->fd = 0;
99 ei->op.proc_get_link = NULL; 99 ei->op.proc_get_link = NULL;
100 ei->pde = NULL; 100 ei->pde = NULL;
101 inode = &ei->vfs_inode; 101 inode = &ei->vfs_inode;
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 0502f17b860d..6264b7a3a9f0 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -46,7 +46,7 @@ static inline struct task_struct *proc_task(struct inode *inode)
46 return PROC_I(inode)->task; 46 return PROC_I(inode)->task;
47} 47}
48 48
49static inline int proc_type(struct inode *inode) 49static inline int proc_fd(struct inode *inode)
50{ 50{
51 return PROC_I(inode)->type; 51 return PROC_I(inode)->fd;
52} 52}