aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-09-19 11:00:54 -0400
committerAlex Elder <aelder@sgi.com>2011-10-11 22:15:08 -0400
commitddc3415aba1cb2f86d1fcad720cea834ee178f54 (patch)
tree7a31a932ce0b7080557be062ccc7c3c0e181b140 /fs/xfs/xfs_vnodeops.c
parent23bb0be1a237c8732ce1a43140e5cb103a676b92 (diff)
xfs: simplify xfs_trans_ijoin* again
There is no reason to keep a reference to the inode even if we unlock it during transaction commit because we never drop a reference between the ijoin and commit. Also use this fact to merge xfs_trans_ijoin_ref back into xfs_trans_ijoin - the third argument decides if an unlock is needed now. I'm actually starting to wonder if allowing inodes to be unlocked at transaction commit really is worth the effort. The only real benefit is that they can be unlocked earlier when commiting a synchronous transactions, but that could be solved by doing the log force manually after the unlock, too. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index c9c8e8230b21..fc38f15808c6 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -219,7 +219,7 @@ xfs_free_eofblocks(
219 } 219 }
220 220
221 xfs_ilock(ip, XFS_ILOCK_EXCL); 221 xfs_ilock(ip, XFS_ILOCK_EXCL);
222 xfs_trans_ijoin(tp, ip); 222 xfs_trans_ijoin(tp, ip, 0);
223 223
224 error = xfs_itruncate_data(&tp, ip, ip->i_size); 224 error = xfs_itruncate_data(&tp, ip, ip->i_size);
225 if (error) { 225 if (error) {
@@ -288,7 +288,7 @@ xfs_inactive_symlink_rmt(
288 xfs_ilock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); 288 xfs_ilock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL);
289 size = (int)ip->i_d.di_size; 289 size = (int)ip->i_d.di_size;
290 ip->i_d.di_size = 0; 290 ip->i_d.di_size = 0;
291 xfs_trans_ijoin(tp, ip); 291 xfs_trans_ijoin(tp, ip, 0);
292 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); 292 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
293 /* 293 /*
294 * Find the block(s) so we can inval and unmap them. 294 * Find the block(s) so we can inval and unmap them.
@@ -336,7 +336,7 @@ xfs_inactive_symlink_rmt(
336 * Mark it dirty so it will be logged and moved forward in the log as 336 * Mark it dirty so it will be logged and moved forward in the log as
337 * part of every commit. 337 * part of every commit.
338 */ 338 */
339 xfs_trans_ijoin(tp, ip); 339 xfs_trans_ijoin(tp, ip, 0);
340 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); 340 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
341 /* 341 /*
342 * Get a new, empty transaction to return to our caller. 342 * Get a new, empty transaction to return to our caller.
@@ -469,7 +469,7 @@ xfs_inactive_attrs(
469 goto error_cancel; 469 goto error_cancel;
470 470
471 xfs_ilock(ip, XFS_ILOCK_EXCL); 471 xfs_ilock(ip, XFS_ILOCK_EXCL);
472 xfs_trans_ijoin(tp, ip); 472 xfs_trans_ijoin(tp, ip, 0);
473 xfs_idestroy_fork(ip, XFS_ATTR_FORK); 473 xfs_idestroy_fork(ip, XFS_ATTR_FORK);
474 474
475 ASSERT(ip->i_d.di_anextents == 0); 475 ASSERT(ip->i_d.di_anextents == 0);
@@ -663,7 +663,7 @@ xfs_inactive(
663 } 663 }
664 664
665 xfs_ilock(ip, XFS_ILOCK_EXCL); 665 xfs_ilock(ip, XFS_ILOCK_EXCL);
666 xfs_trans_ijoin(tp, ip); 666 xfs_trans_ijoin(tp, ip, 0);
667 667
668 error = xfs_itruncate_data(&tp, ip, 0); 668 error = xfs_itruncate_data(&tp, ip, 0);
669 if (error) { 669 if (error) {
@@ -687,7 +687,7 @@ xfs_inactive(
687 return VN_INACTIVE_CACHE; 687 return VN_INACTIVE_CACHE;
688 } 688 }
689 689
690 xfs_trans_ijoin(tp, ip); 690 xfs_trans_ijoin(tp, ip, 0);
691 } else { 691 } else {
692 error = xfs_trans_reserve(tp, 0, 692 error = xfs_trans_reserve(tp, 0,
693 XFS_IFREE_LOG_RES(mp), 693 XFS_IFREE_LOG_RES(mp),
@@ -700,7 +700,7 @@ xfs_inactive(
700 } 700 }
701 701
702 xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); 702 xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
703 xfs_trans_ijoin(tp, ip); 703 xfs_trans_ijoin(tp, ip, 0);
704 } 704 }
705 705
706 /* 706 /*
@@ -940,7 +940,7 @@ xfs_create(
940 * the transaction cancel unlocking dp so don't do it explicitly in the 940 * the transaction cancel unlocking dp so don't do it explicitly in the
941 * error path. 941 * error path.
942 */ 942 */
943 xfs_trans_ijoin_ref(tp, dp, XFS_ILOCK_EXCL); 943 xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL);
944 unlock_dp_on_error = B_FALSE; 944 unlock_dp_on_error = B_FALSE;
945 945
946 error = xfs_dir_createname(tp, dp, name, ip->i_ino, 946 error = xfs_dir_createname(tp, dp, name, ip->i_ino,
@@ -1261,8 +1261,8 @@ xfs_remove(
1261 1261
1262 xfs_lock_two_inodes(dp, ip, XFS_ILOCK_EXCL); 1262 xfs_lock_two_inodes(dp, ip, XFS_ILOCK_EXCL);
1263 1263
1264 xfs_trans_ijoin_ref(tp, dp, XFS_ILOCK_EXCL); 1264 xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL);
1265 xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL); 1265 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
1266 1266
1267 /* 1267 /*
1268 * If we're removing a directory perform some additional validation. 1268 * If we're removing a directory perform some additional validation.
@@ -1407,8 +1407,8 @@ xfs_link(
1407 1407
1408 xfs_lock_two_inodes(sip, tdp, XFS_ILOCK_EXCL); 1408 xfs_lock_two_inodes(sip, tdp, XFS_ILOCK_EXCL);
1409 1409
1410 xfs_trans_ijoin_ref(tp, sip, XFS_ILOCK_EXCL); 1410 xfs_trans_ijoin(tp, sip, XFS_ILOCK_EXCL);
1411 xfs_trans_ijoin_ref(tp, tdp, XFS_ILOCK_EXCL); 1411 xfs_trans_ijoin(tp, tdp, XFS_ILOCK_EXCL);
1412 1412
1413 /* 1413 /*
1414 * If the source has too many links, we can't make any more to it. 1414 * If the source has too many links, we can't make any more to it.
@@ -1602,7 +1602,7 @@ xfs_symlink(
1602 * transaction cancel unlocking dp so don't do it explicitly in the 1602 * transaction cancel unlocking dp so don't do it explicitly in the
1603 * error path. 1603 * error path.
1604 */ 1604 */
1605 xfs_trans_ijoin_ref(tp, dp, XFS_ILOCK_EXCL); 1605 xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL);
1606 unlock_dp_on_error = B_FALSE; 1606 unlock_dp_on_error = B_FALSE;
1607 1607
1608 /* 1608 /*
@@ -1735,7 +1735,7 @@ xfs_set_dmattrs(
1735 return error; 1735 return error;
1736 } 1736 }
1737 xfs_ilock(ip, XFS_ILOCK_EXCL); 1737 xfs_ilock(ip, XFS_ILOCK_EXCL);
1738 xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL); 1738 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
1739 1739
1740 ip->i_d.di_dmevmask = evmask; 1740 ip->i_d.di_dmevmask = evmask;
1741 ip->i_d.di_dmstate = state; 1741 ip->i_d.di_dmstate = state;
@@ -1878,7 +1878,7 @@ xfs_alloc_file_space(
1878 if (error) 1878 if (error)
1879 goto error1; 1879 goto error1;
1880 1880
1881 xfs_trans_ijoin(tp, ip); 1881 xfs_trans_ijoin(tp, ip, 0);
1882 1882
1883 xfs_bmap_init(&free_list, &firstfsb); 1883 xfs_bmap_init(&free_list, &firstfsb);
1884 error = xfs_bmapi_write(tp, ip, startoffset_fsb, 1884 error = xfs_bmapi_write(tp, ip, startoffset_fsb,
@@ -2176,7 +2176,7 @@ xfs_free_file_space(
2176 if (error) 2176 if (error)
2177 goto error1; 2177 goto error1;
2178 2178
2179 xfs_trans_ijoin(tp, ip); 2179 xfs_trans_ijoin(tp, ip, 0);
2180 2180
2181 /* 2181 /*
2182 * issue the bunmapi() call to free the blocks 2182 * issue the bunmapi() call to free the blocks
@@ -2349,7 +2349,7 @@ xfs_change_file_space(
2349 } 2349 }
2350 2350
2351 xfs_ilock(ip, XFS_ILOCK_EXCL); 2351 xfs_ilock(ip, XFS_ILOCK_EXCL);
2352 xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL); 2352 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
2353 2353
2354 if ((attr_flags & XFS_ATTR_DMI) == 0) { 2354 if ((attr_flags & XFS_ATTR_DMI) == 0) {
2355 ip->i_d.di_mode &= ~S_ISUID; 2355 ip->i_d.di_mode &= ~S_ISUID;