Skip to contentSkip to conversation

remove remaining VN_HOLD calls

PATCH In review Christoph Hellwig 1 participant 1 message Jul 23, 2008 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 4/5 remove remaining VN_HOLD calls

Use IHOLD(ip) instead of VN_HOLD(VFS_I(ip)).

fs/xfs/quota/xfs_dquot.c +1 -1
Index: linux-2.6-xfs/fs/xfs/quota/xfs_dquot.c
===================================================================
@@ -431,7 +431,7 @@ xfs_qm_dqalloc(
 	 * when it unlocks the inode. Since we want to keep the quota
 	 * inode around, we bump the vnode ref count now.
 	 */
-	VN_HOLD(VFS_I(quotip));
+	IHOLD(quotip);
 
 	xfs_trans_ijoin(tp, quotip, XFS_ILOCK_EXCL);
 	nmaps = 1;
fs/xfs/xfs_bmap.c +1 -1
Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c
===================================================================
@@ -4000,7 +4000,7 @@ xfs_bmap_add_attrfork(
 		ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS;
 	}
 	ASSERT(ip->i_d.di_anextents == 0);
-	VN_HOLD(VFS_I(ip));
+	IHOLD(ip);
 	xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
 	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
 	switch (ip->i_d.di_format) {
fs/xfs/xfs_dfrag.c +3 -7
Index: linux-2.6-xfs/fs/xfs/xfs_dfrag.c
===================================================================
@@ -350,15 +350,11 @@ xfs_swap_extents(
 		break;
 	}
 
-	/*
-	 * Increment vnode ref counts since xfs_trans_commit &
-	 * xfs_trans_cancel will both unlock the inodes and
-	 * decrement the associated ref counts.
-	 */
-	VN_HOLD(vp);
-	VN_HOLD(tvp);
 
+	IHOLD(ip);
 	xfs_trans_ijoin(tp, ip, lock_flags);
+
+	IHOLD(tip);
 	xfs_trans_ijoin(tp, tip, lock_flags);
 
 	xfs_trans_log_inode(tp, ip,  ilf_fields);