aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_iops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-03-05 21:46:19 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-04-17 21:40:45 -0400
commit3937be5ba836a204d3d1df96b518eecd6cdacbb9 (patch)
tree89c21be058d0b1b43718f49025600346524cd68e /fs/xfs/linux-2.6/xfs_iops.c
parenta3da789640871c897901c5f766e33be78d56f35a (diff)
[XFS] cleanup vnode use in xfs_symlink and xfs_rename
SGI-PV: 976035 SGI-Modid: xfs-linux-melb:xfs-kern:30548a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_iops.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 1df48209d60a..215158cbac43 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -437,29 +437,33 @@ xfs_vn_symlink(
437 struct dentry *dentry, 437 struct dentry *dentry,
438 const char *symname) 438 const char *symname)
439{ 439{
440 struct inode *ip; 440 struct inode *inode;
441 bhv_vnode_t *cvp; /* used to lookup symlink to put in dentry */ 441 struct xfs_inode *cip = NULL;
442 int error; 442 int error;
443 mode_t mode; 443 mode_t mode;
444 444
445 cvp = NULL;
446
447 mode = S_IFLNK | 445 mode = S_IFLNK |
448 (irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO); 446 (irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO);
449 447
450 error = xfs_symlink(XFS_I(dir), dentry, (char *)symname, mode, 448 error = xfs_symlink(XFS_I(dir), dentry, (char *)symname, mode,
451 &cvp, NULL); 449 &cip, NULL);
452 if (likely(!error && cvp)) { 450 if (unlikely(error))
453 error = xfs_init_security(cvp, dir); 451 goto out;
454 if (likely(!error)) { 452
455 ip = vn_to_inode(cvp); 453 inode = cip->i_vnode;
456 d_instantiate(dentry, ip); 454
457 xfs_validate_fields(dir); 455 error = xfs_init_security(inode, dir);
458 xfs_validate_fields(ip); 456 if (unlikely(error))
459 } else { 457 goto out_cleanup_inode;
460 xfs_cleanup_inode(dir, cvp, dentry, 0); 458
461 } 459 d_instantiate(dentry, inode);
462 } 460 xfs_validate_fields(dir);
461 xfs_validate_fields(inode);
462 return 0;
463
464 out_cleanup_inode:
465 xfs_cleanup_inode(dir, inode, dentry, 0);
466 out:
463 return -error; 467 return -error;
464} 468}
465 469
@@ -487,12 +491,9 @@ xfs_vn_rename(
487 struct dentry *ndentry) 491 struct dentry *ndentry)
488{ 492{
489 struct inode *new_inode = ndentry->d_inode; 493 struct inode *new_inode = ndentry->d_inode;
490 bhv_vnode_t *tvp; /* target directory */
491 int error; 494 int error;
492 495
493 tvp = vn_from_inode(ndir); 496 error = xfs_rename(XFS_I(odir), odentry, XFS_I(ndir), ndentry);
494
495 error = xfs_rename(XFS_I(odir), odentry, tvp, ndentry);
496 if (likely(!error)) { 497 if (likely(!error)) {
497 if (new_inode) 498 if (new_inode)
498 xfs_validate_fields(new_inode); 499 xfs_validate_fields(new_inode);