Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a1d4aebbfa91c55a6b0c629a9ccf6369be0c6e95
Commit:     a1d4aebbfa91c55a6b0c629a9ccf6369be0c6e95
Parent:     a90a088021f8f1e9a9cd83f06ac90e1f3aada4d4
Author:     David Howells <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 7 00:15:45 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Feb 7 08:42:28 2008 -0800

    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().
    
    [EMAIL PROTECTED]: coding-style fixes]
    Signed-off-by: David Howells <[EMAIL PROTECTED]>
    Cc: "Eric W. Biederman" <[EMAIL PROTECTED]>
    Acked-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/proc/inode.c |   60 +++++++++++++++++++++++++-----------------------------
 1 files changed, 28 insertions(+), 32 deletions(-)

diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 1a551d9..6ecf639 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -73,11 +73,6 @@ static void proc_delete_inode(struct inode *inode)
 
 struct vfsmount *proc_mnt;
 
-static void proc_read_inode(struct inode * inode)
-{
-       inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
-}
-
 static struct kmem_cache * proc_inode_cachep;
 
 static 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)
 static const struct super_operations proc_sops = {
        .alloc_inode    = proc_alloc_inode,
        .destroy_inode  = proc_destroy_inode,
-       .read_inode     = proc_read_inode,
        .drop_inode     = generic_delete_inode,
        .delete_inode   = proc_delete_inode,
        .statfs         = simple_statfs,
@@ -401,39 +395,41 @@ struct inode *proc_get_inode(struct super_block *sb, 
unsigned int ino,
        if (de != NULL && !try_module_get(de->owner))
                goto out_mod;
 
-       inode = iget(sb, ino);
+       inode = iget_locked(sb, ino);
        if (!inode)
                goto out_ino;
-
-       PROC_I(inode)->fd = 0;
-       PROC_I(inode)->pde = de;
-       if (de) {
-               if (de->mode) {
-                       inode->i_mode = de->mode;
-                       inode->i_uid = de->uid;
-                       inode->i_gid = de->gid;
-               }
-               if (de->size)
-                       inode->i_size = de->size;
-               if (de->nlink)
-                       inode->i_nlink = de->nlink;
-               if (de->proc_iops)
-                       inode->i_op = de->proc_iops;
-               if (de->proc_fops) {
-                       if (S_ISREG(inode->i_mode)) {
+       if (inode->i_state & I_NEW) {
+               inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
+               PROC_I(inode)->fd = 0;
+               PROC_I(inode)->pde = de;
+               if (de) {
+                       if (de->mode) {
+                               inode->i_mode = de->mode;
+                               inode->i_uid = de->uid;
+                               inode->i_gid = de->gid;
+                       }
+                       if (de->size)
+                               inode->i_size = de->size;
+                       if (de->nlink)
+                               inode->i_nlink = de->nlink;
+                       if (de->proc_iops)
+                               inode->i_op = de->proc_iops;
+                       if (de->proc_fops) {
+                               if (S_ISREG(inode->i_mode)) {
 #ifdef CONFIG_COMPAT
-                               if (!de->proc_fops->compat_ioctl)
-                                       inode->i_fop =
-                                               &proc_reg_file_ops_no_compat;
-                               else
+                                       if (!de->proc_fops->compat_ioctl)
+                                               inode->i_fop =
+                                                       
&proc_reg_file_ops_no_compat;
+                                       else
 #endif
-                                       inode->i_fop = &proc_reg_file_ops;
+                                               inode->i_fop = 
&proc_reg_file_ops;
+                               } else {
+                                       inode->i_fop = de->proc_fops;
+                               }
                        }
-                       else
-                               inode->i_fop = de->proc_fops;
                }
+               unlock_new_inode(inode);
        }
-
        return inode;
 
 out_ino:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to