]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
proc: no need to initialize proc_inode->fd in proc_get_inode()
authoryan <clouds.yan@gmail.com>
Wed, 26 Sep 2012 01:34:55 +0000 (11:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 27 Sep 2012 07:28:51 +0000 (17:28 +1000)
proc_get_inode() obtains the inode via a call to iget_locked().
iget_locked() calls alloc_inode() which will call proc_alloc_inode() which
clears proc_inode.fd, so there is no need to clear this field in
proc_get_inode().

If iget_locked() instead found the inode via find_inode_fast(), that inode
will not have I_NEW set so this change has no effect.

Signed-off-by: yan <clouds.yan@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/inode.c

index 7ac817b64a7193b71cf867f72fc0d94d68294c90..3b22bbdee9ec6e8bb9a8b6f19d19bc508e9d2879 100644 (file)
@@ -450,7 +450,6 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
                return NULL;
        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->mode) {