aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_iops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_iops.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 2903faf6a26a..76b570dd1ab2 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -367,21 +367,18 @@ xfs_vn_link(
367 struct inode *dir, 367 struct inode *dir,
368 struct dentry *dentry) 368 struct dentry *dentry)
369{ 369{
370 struct inode *inode; /* inode of guy being linked to */ 370 struct inode *inode = old_dentry->d_inode;
371 struct xfs_name name; 371 struct xfs_name name;
372 int error; 372 int error;
373 373
374 inode = old_dentry->d_inode;
375 xfs_dentry_to_name(&name, dentry); 374 xfs_dentry_to_name(&name, dentry);
376 375
377 igrab(inode);
378 error = xfs_link(XFS_I(dir), XFS_I(inode), &name); 376 error = xfs_link(XFS_I(dir), XFS_I(inode), &name);
379 if (unlikely(error)) { 377 if (unlikely(error))
380 iput(inode);
381 return -error; 378 return -error;
382 }
383 379
384 xfs_iflags_set(XFS_I(dir), XFS_IMODIFIED); 380 xfs_iflags_set(XFS_I(dir), XFS_IMODIFIED);
381 atomic_inc(&inode->i_count);
385 d_instantiate(dentry, inode); 382 d_instantiate(dentry, inode);
386 return 0; 383 return 0;
387} 384}