diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-04-22 03:34:18 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-04-29 01:54:34 -0400 |
commit | 82dab941a192d081dd0b7cde3ed32603372d5acc (patch) | |
tree | 26ef7725199473cdb5c0ed94378b0bbbc6060624 /fs/xfs/xfs_vnodeops.c | |
parent | 1ac74e01df959e3e91baded7c83399372af945a2 (diff) |
[XFS] kill parent == child checks in xfs_remove and xfs_rmdir
VFS guaranteed these can't happen.
SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:30911a
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.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 308dfff76ae2..2ebfc60097d1 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -2180,7 +2180,7 @@ xfs_remove( | |||
2180 | xfs_itrace_ref(ip); | 2180 | xfs_itrace_ref(ip); |
2181 | 2181 | ||
2182 | error = XFS_QM_DQATTACH(mp, dp, 0); | 2182 | error = XFS_QM_DQATTACH(mp, dp, 0); |
2183 | if (!error && dp != ip) | 2183 | if (!error) |
2184 | error = XFS_QM_DQATTACH(mp, ip, 0); | 2184 | error = XFS_QM_DQATTACH(mp, ip, 0); |
2185 | if (error) { | 2185 | if (error) { |
2186 | REMOVE_DEBUG_TRACE(__LINE__); | 2186 | REMOVE_DEBUG_TRACE(__LINE__); |
@@ -2228,15 +2228,9 @@ xfs_remove( | |||
2228 | * inodes locked. | 2228 | * inodes locked. |
2229 | */ | 2229 | */ |
2230 | xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); | 2230 | xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); |
2231 | if (dp != ip) { | 2231 | |
2232 | /* | 2232 | IHOLD(dp); |
2233 | * Increment vnode ref count only in this case since | 2233 | xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); |
2234 | * there's an extra vnode reference in the case where | ||
2235 | * dp == ip. | ||
2236 | */ | ||
2237 | IHOLD(dp); | ||
2238 | xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); | ||
2239 | } | ||
2240 | 2234 | ||
2241 | /* | 2235 | /* |
2242 | * Entry must exist since we did a lookup in xfs_lock_dir_and_entry. | 2236 | * Entry must exist since we did a lookup in xfs_lock_dir_and_entry. |
@@ -2747,7 +2741,7 @@ xfs_rmdir( | |||
2747 | * Get the dquots for the inodes. | 2741 | * Get the dquots for the inodes. |
2748 | */ | 2742 | */ |
2749 | error = XFS_QM_DQATTACH(mp, dp, 0); | 2743 | error = XFS_QM_DQATTACH(mp, dp, 0); |
2750 | if (!error && dp != cdp) | 2744 | if (!error) |
2751 | error = XFS_QM_DQATTACH(mp, cdp, 0); | 2745 | error = XFS_QM_DQATTACH(mp, cdp, 0); |
2752 | if (error) { | 2746 | if (error) { |
2753 | IRELE(cdp); | 2747 | IRELE(cdp); |
@@ -2796,14 +2790,7 @@ xfs_rmdir( | |||
2796 | } | 2790 | } |
2797 | 2791 | ||
2798 | xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); | 2792 | xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); |
2799 | if (dp != cdp) { | 2793 | VN_HOLD(dir_vp); |
2800 | /* | ||
2801 | * Only increment the parent directory vnode count if | ||
2802 | * we didn't bump it in looking up cdp. The only time | ||
2803 | * we don't bump it is when we're looking up ".". | ||
2804 | */ | ||
2805 | VN_HOLD(dir_vp); | ||
2806 | } | ||
2807 | 2794 | ||
2808 | xfs_itrace_ref(cdp); | 2795 | xfs_itrace_ref(cdp); |
2809 | xfs_trans_ijoin(tp, cdp, XFS_ILOCK_EXCL); | 2796 | xfs_trans_ijoin(tp, cdp, XFS_ILOCK_EXCL); |