aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dfrag.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_dfrag.c')
-rw-r--r--fs/xfs/xfs_dfrag.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c
index d92407842e3b..5ce91a00425f 100644
--- a/fs/xfs/xfs_dfrag.c
+++ b/fs/xfs/xfs_dfrag.c
@@ -128,7 +128,6 @@ xfs_swap_extents(
128 xfs_swapext_t *sxp) 128 xfs_swapext_t *sxp)
129{ 129{
130 xfs_mount_t *mp; 130 xfs_mount_t *mp;
131 xfs_inode_t *ips[2];
132 xfs_trans_t *tp; 131 xfs_trans_t *tp;
133 xfs_bstat_t *sbp = &sxp->sx_stat; 132 xfs_bstat_t *sbp = &sxp->sx_stat;
134 bhv_vnode_t *vp, *tvp; 133 bhv_vnode_t *vp, *tvp;
@@ -153,16 +152,7 @@ xfs_swap_extents(
153 vp = VFS_I(ip); 152 vp = VFS_I(ip);
154 tvp = VFS_I(tip); 153 tvp = VFS_I(tip);
155 154
156 /* Lock in i_ino order */ 155 xfs_lock_two_inodes(ip, tip, lock_flags);
157 if (ip->i_ino < tip->i_ino) {
158 ips[0] = ip;
159 ips[1] = tip;
160 } else {
161 ips[0] = tip;
162 ips[1] = ip;
163 }
164
165 xfs_lock_inodes(ips, 2, lock_flags);
166 locked = 1; 156 locked = 1;
167 157
168 /* Verify that both files have the same format */ 158 /* Verify that both files have the same format */
@@ -265,7 +255,7 @@ xfs_swap_extents(
265 locked = 0; 255 locked = 0;
266 goto error0; 256 goto error0;
267 } 257 }
268 xfs_lock_inodes(ips, 2, XFS_ILOCK_EXCL); 258 xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL);
269 259
270 /* 260 /*
271 * Count the number of extended attribute blocks 261 * Count the number of extended attribute blocks