aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-04-22 03:34:06 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-04-29 01:54:12 -0400
commitcfa853e47df4fbee441ac0ac3fb592f076233145 (patch)
tree7e4baafba5ee0f05561580c301c5d360236063f3 /fs/xfs/xfs_vnodeops.c
parent579aa9caf552c639fc78168db4cfe7ffcf00c3b3 (diff)
[XFS] remove manual lookup from xfs_rename and simplify locking
->rename already gets the target inode passed if it exits. Pass it down to xfs_rename so that we can avoid looking it up again. Also simplify locking as the first lock section in xfs_rename can go away now: the isdir is an invariant over the lifetime of the inode, and new_parent and the nlink check are namespace topology protected by i_mutex in the VFS. The projid check needs to move into the second lock section anyway to not be racy. Also kill the now unused xfs_dir_lookup_int and remove the now-unused first_locked argumet to xfs_lock_inodes. SGI-PV: 976035 SGI-Modid: xfs-linux-melb:xfs-kern:30903a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 322ba094dcc8..308dfff76ae2 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1982,7 +1982,7 @@ again:
1982 1982
1983 ips[0] = ip; 1983 ips[0] = ip;
1984 ips[1] = dp; 1984 ips[1] = dp;
1985 xfs_lock_inodes(ips, 2, 0, XFS_ILOCK_EXCL); 1985 xfs_lock_inodes(ips, 2, XFS_ILOCK_EXCL);
1986 } 1986 }
1987 /* else e_inum == dp->i_ino */ 1987 /* else e_inum == dp->i_ino */
1988 /* This can happen if we're asked to lock /x/.. 1988 /* This can happen if we're asked to lock /x/..
@@ -2030,7 +2030,6 @@ void
2030xfs_lock_inodes( 2030xfs_lock_inodes(
2031 xfs_inode_t **ips, 2031 xfs_inode_t **ips,
2032 int inodes, 2032 int inodes,
2033 int first_locked,
2034 uint lock_mode) 2033 uint lock_mode)
2035{ 2034{
2036 int attempts = 0, i, j, try_lock; 2035 int attempts = 0, i, j, try_lock;
@@ -2038,13 +2037,8 @@ xfs_lock_inodes(
2038 2037
2039 ASSERT(ips && (inodes >= 2)); /* we need at least two */ 2038 ASSERT(ips && (inodes >= 2)); /* we need at least two */
2040 2039
2041 if (first_locked) { 2040 try_lock = 0;
2042 try_lock = 1; 2041 i = 0;
2043 i = 1;
2044 } else {
2045 try_lock = 0;
2046 i = 0;
2047 }
2048 2042
2049again: 2043again:
2050 for (; i < inodes; i++) { 2044 for (; i < inodes; i++) {
@@ -2406,7 +2400,7 @@ xfs_link(
2406 ips[1] = sip; 2400 ips[1] = sip;
2407 } 2401 }
2408 2402
2409 xfs_lock_inodes(ips, 2, 0, XFS_ILOCK_EXCL); 2403 xfs_lock_inodes(ips, 2, XFS_ILOCK_EXCL);
2410 2404
2411 /* 2405 /*
2412 * Increment vnode ref counts since xfs_trans_commit & 2406 * Increment vnode ref counts since xfs_trans_commit &