diff options
author | Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> | 2008-06-24 16:50:15 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-26 20:53:17 -0400 |
commit | 7e79eedb3b22200cc8b774baea3a7bf28d766101 (patch) | |
tree | 6e0f8ab6c201c671a73bb7f452265a9bf54d3158 /fs/namei.c | |
parent | 2f1936b87783a3a56c9441b27b9ba7a747f11e8e (diff) | |
download | op-kernel-dev-7e79eedb3b22200cc8b774baea3a7bf28d766101.zip op-kernel-dev-7e79eedb3b22200cc8b774baea3a7bf28d766101.tar.gz |
[patch 4/5] vfs: reuse local variable in vfs_link()
Why not reuse "inode" which is assigned as
struct inode *inode = old_dentry->d_inode;
in the beginning of vfs_link() ?
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2524,19 +2524,19 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de return -EPERM; if (!dir->i_op || !dir->i_op->link) return -EPERM; - if (S_ISDIR(old_dentry->d_inode->i_mode)) + if (S_ISDIR(inode->i_mode)) return -EPERM; error = security_inode_link(old_dentry, dir, new_dentry); if (error) return error; - mutex_lock(&old_dentry->d_inode->i_mutex); + mutex_lock(&inode->i_mutex); DQUOT_INIT(dir); error = dir->i_op->link(old_dentry, dir, new_dentry); - mutex_unlock(&old_dentry->d_inode->i_mutex); + mutex_unlock(&inode->i_mutex); if (!error) - fsnotify_link(dir, old_dentry->d_inode, new_dentry); + fsnotify_link(dir, inode, new_dentry); return error; } |