aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-02-07 03:15:45 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:28 -0500
commita1d4aebbfa91c55a6b0c629a9ccf6369be0c6e95 (patch)
tree2478c7be46b86b30c86666f72a8816c910c7a7d4
parenta90a088021f8f1e9a9cd83f06ac90e1f3aada4d4 (diff)
iget: stop PROCFS from using iget() and read_inode()
Stop the PROCFS filesystem from using iget() and read_inode(). Merge procfs_read_inode() into procfs_get_inode(), and have that call iget_locked() instead of iget(). [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: David Howells <dhowells@redhat.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/proc/inode.c60
1 files changed, 28 insertions, 32 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 1a551d92e1d8..6ecf6396f072 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -73,11 +73,6 @@ static void proc_delete_inode(struct inode *inode)
73 73
74struct vfsmount *proc_mnt; 74struct vfsmount *proc_mnt;
75 75
76static void proc_read_inode(struct inode * inode)
77{
78 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
79}
80
81static struct kmem_cache * proc_inode_cachep; 76static struct kmem_cache * proc_inode_cachep;
82 77
83static struct inode *proc_alloc_inode(struct super_block *sb) 78static struct inode *proc_alloc_inode(struct super_block *sb)
@@ -128,7 +123,6 @@ static int proc_remount(struct super_block *sb, int *flags, char *data)
128static const struct super_operations proc_sops = { 123static const struct super_operations proc_sops = {
129 .alloc_inode = proc_alloc_inode, 124 .alloc_inode = proc_alloc_inode,
130 .destroy_inode = proc_destroy_inode, 125 .destroy_inode = proc_destroy_inode,
131 .read_inode = proc_read_inode,
132 .drop_inode = generic_delete_inode, 126 .drop_inode = generic_delete_inode,
133 .delete_inode = proc_delete_inode, 127 .delete_inode = proc_delete_inode,
134 .statfs = simple_statfs, 128 .statfs = simple_statfs,
@@ -401,39 +395,41 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
401 if (de != NULL && !try_module_get(de->owner)) 395 if (de != NULL && !try_module_get(de->owner))
402 goto out_mod; 396 goto out_mod;
403 397
404 inode = iget(sb, ino); 398 inode = iget_locked(sb, ino);
405 if (!inode) 399 if (!inode)
406 goto out_ino; 400 goto out_ino;
407 401 if (inode->i_state & I_NEW) {
408 PROC_I(inode)->fd = 0; 402 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
409 PROC_I(inode)->pde = de; 403 PROC_I(inode)->fd = 0;
410 if (de) { 404 PROC_I(inode)->pde = de;
411 if (de->mode) { 405 if (de) {
412 inode->i_mode = de->mode; 406 if (de->mode) {
413 inode->i_uid = de->uid; 407 inode->i_mode = de->mode;
414 inode->i_gid = de->gid; 408 inode->i_uid = de->uid;
415 } 409 inode->i_gid = de->gid;
416 if (de->size) 410 }
417 inode->i_size = de->size; 411 if (de->size)
418 if (de->nlink) 412 inode->i_size = de->size;
419 inode->i_nlink = de->nlink; 413 if (de->nlink)
420 if (de->proc_iops) 414 inode->i_nlink = de->nlink;
421 inode->i_op = de->proc_iops; 415 if (de->proc_iops)
422 if (de->proc_fops) { 416 inode->i_op = de->proc_iops;
423 if (S_ISREG(inode->i_mode)) { 417 if (de->proc_fops) {
418 if (S_ISREG(inode->i_mode)) {
424#ifdef CONFIG_COMPAT 419#ifdef CONFIG_COMPAT
425 if (!de->proc_fops->compat_ioctl) 420 if (!de->proc_fops->compat_ioctl)
426 inode->i_fop = 421 inode->i_fop =
427 &proc_reg_file_ops_no_compat; 422 &proc_reg_file_ops_no_compat;
428 else 423 else
429#endif 424#endif
430 inode->i_fop = &proc_reg_file_ops; 425 inode->i_fop = &proc_reg_file_ops;
426 } else {
427 inode->i_fop = de->proc_fops;
428 }
431 } 429 }
432 else
433 inode->i_fop = de->proc_fops;
434 } 430 }
431 unlock_new_inode(inode);
435 } 432 }
436
437 return inode; 433 return inode;
438 434
439out_ino: 435out_ino: