aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vfsops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@sgi.com>2005-09-02 02:24:19 -0400
committerNathan Scott <nathans@sgi.com>2005-09-02 02:24:19 -0400
commitcdb626878f6f5e37d678d30c9cacf5726b88a656 (patch)
tree2c9ff3f0ce5831bc34820ffbaffa8681fa1e0271 /fs/xfs/xfs_vfsops.c
parentbb3f724e12eb9c62c92ff6f14a856bc58ba35f5e (diff)
[XFS] replace vn_get usage by ihold
SGI-PV: 938306 SGI-Modid: xfs-linux:xfs-kern:194627a Signed-off-by: Christoph Hellwig <hch@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vfsops.c')
-rw-r--r--fs/xfs/xfs_vfsops.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index 42bcc0215203..b8ce6cad2b71 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -906,7 +906,6 @@ xfs_sync_inodes(
906 xfs_inode_t *ip_next; 906 xfs_inode_t *ip_next;
907 xfs_buf_t *bp; 907 xfs_buf_t *bp;
908 vnode_t *vp = NULL; 908 vnode_t *vp = NULL;
909 vmap_t vmap;
910 int error; 909 int error;
911 int last_error; 910 int last_error;
912 uint64_t fflag; 911 uint64_t fflag;
@@ -1101,48 +1100,21 @@ xfs_sync_inodes(
1101 * lock in xfs_ireclaim() after the inode is pulled from 1100 * lock in xfs_ireclaim() after the inode is pulled from
1102 * the mount list will sleep until we release it here. 1101 * the mount list will sleep until we release it here.
1103 * This keeps the vnode from being freed while we reference 1102 * This keeps the vnode from being freed while we reference
1104 * it. It is also cheaper and simpler than actually doing 1103 * it.
1105 * a vn_get() for every inode we touch here.
1106 */ 1104 */
1107 if (xfs_ilock_nowait(ip, lock_flags) == 0) { 1105 if (xfs_ilock_nowait(ip, lock_flags) == 0) {
1108
1109 if ((flags & SYNC_BDFLUSH) || (vp == NULL)) { 1106 if ((flags & SYNC_BDFLUSH) || (vp == NULL)) {
1110 ip = ip->i_mnext; 1107 ip = ip->i_mnext;
1111 continue; 1108 continue;
1112 } 1109 }
1113 1110
1114 /* 1111 vp = vn_grab(vp);
1115 * We need to unlock the inode list lock in order
1116 * to lock the inode. Insert a marker record into
1117 * the inode list to remember our position, dropping
1118 * the lock is now done inside the IPOINTER_INSERT
1119 * macro.
1120 *
1121 * We also use the inode list lock to protect us
1122 * in taking a snapshot of the vnode version number
1123 * for use in calling vn_get().
1124 */
1125 VMAP(vp, vmap);
1126 IPOINTER_INSERT(ip, mp);
1127
1128 vp = vn_get(vp, &vmap);
1129 if (vp == NULL) { 1112 if (vp == NULL) {
1130 /* 1113 ip = ip->i_mnext;
1131 * The vnode was reclaimed once we let go
1132 * of the inode list lock. Skip to the
1133 * next list entry. Remove the marker.
1134 */
1135
1136 XFS_MOUNT_ILOCK(mp);
1137
1138 mount_locked = B_TRUE;
1139 vnode_refed = B_FALSE;
1140
1141 IPOINTER_REMOVE(ip, mp);
1142
1143 continue; 1114 continue;
1144 } 1115 }
1145 1116
1117 IPOINTER_INSERT(ip, mp);
1146 xfs_ilock(ip, lock_flags); 1118 xfs_ilock(ip, lock_flags);
1147 1119
1148 ASSERT(vp == XFS_ITOV(ip)); 1120 ASSERT(vp == XFS_ITOV(ip));