aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-30 20:48:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-30 20:48:25 -0500
commit6a94cb73064c952255336cc57731904174b2c58f (patch)
treed19cc835db0a21e01909a92772868e1ad96f99ff /fs/xfs/xfs_trans.c
parentf57fa1d6a6b3414e853d3d17e339ac48816e4406 (diff)
parent0a8c5395f90f06d128247844b2515c8bf3f2826b (diff)
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs: (184 commits) [XFS] Fix race in xfs_write() between direct and buffered I/O with DMAPI [XFS] handle unaligned data in xfs_bmbt_disk_get_all [XFS] avoid memory allocations in xfs_fs_vcmn_err [XFS] Fix speculative allocation beyond eof [XFS] Remove XFS_BUF_SHUT() and friends [XFS] Use the incore inode size in xfs_file_readdir() [XFS] set b_error from bio error in xfs_buf_bio_end_io [XFS] use inode_change_ok for setattr permission checking [XFS] add a FMODE flag to make XFS invisible I/O less hacky [XFS] resync headers with libxfs [XFS] simplify projid check in xfs_rename [XFS] replace b_fspriv with b_mount [XFS] Remove unused tracing code [XFS] Remove unnecessary assertion [XFS] Remove unused variable in ktrace_free() [XFS] Check return value of xfs_buf_get_noaddr() [XFS] Fix hang after disallowed rename across directory quota domains [XFS] Fix compile with CONFIG_COMPAT enabled move inode tracing out of xfs_vnode. move vn_iowait / vn_iowake into xfs_aops.c ...
Diffstat (limited to 'fs/xfs/xfs_trans.c')
-rw-r--r--fs/xfs/xfs_trans.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 4e1c22a23be5..8570b826fedd 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -290,7 +290,7 @@ xfs_trans_dup(
290 ASSERT(tp->t_ticket != NULL); 290 ASSERT(tp->t_ticket != NULL);
291 291
292 ntp->t_flags = XFS_TRANS_PERM_LOG_RES | (tp->t_flags & XFS_TRANS_RESERVE); 292 ntp->t_flags = XFS_TRANS_PERM_LOG_RES | (tp->t_flags & XFS_TRANS_RESERVE);
293 ntp->t_ticket = tp->t_ticket; 293 ntp->t_ticket = xfs_log_ticket_get(tp->t_ticket);
294 ntp->t_blk_res = tp->t_blk_res - tp->t_blk_res_used; 294 ntp->t_blk_res = tp->t_blk_res - tp->t_blk_res_used;
295 tp->t_blk_res = tp->t_blk_res_used; 295 tp->t_blk_res = tp->t_blk_res_used;
296 ntp->t_rtx_res = tp->t_rtx_res - tp->t_rtx_res_used; 296 ntp->t_rtx_res = tp->t_rtx_res - tp->t_rtx_res_used;
@@ -1260,6 +1260,13 @@ xfs_trans_roll(
1260 trans = *tpp; 1260 trans = *tpp;
1261 1261
1262 /* 1262 /*
1263 * transaction commit worked ok so we can drop the extra ticket
1264 * reference that we gained in xfs_trans_dup()
1265 */
1266 xfs_log_ticket_put(trans->t_ticket);
1267
1268
1269 /*
1263 * Reserve space in the log for th next transaction. 1270 * Reserve space in the log for th next transaction.
1264 * This also pushes items in the "AIL", the list of logged items, 1271 * This also pushes items in the "AIL", the list of logged items,
1265 * out to disk if they are taking up space at the tail of the log 1272 * out to disk if they are taking up space at the tail of the log
@@ -1383,11 +1390,12 @@ xfs_trans_chunk_committed(
1383 xfs_log_item_desc_t *lidp; 1390 xfs_log_item_desc_t *lidp;
1384 xfs_log_item_t *lip; 1391 xfs_log_item_t *lip;
1385 xfs_lsn_t item_lsn; 1392 xfs_lsn_t item_lsn;
1386 struct xfs_mount *mp;
1387 int i; 1393 int i;
1388 1394
1389 lidp = licp->lic_descs; 1395 lidp = licp->lic_descs;
1390 for (i = 0; i < licp->lic_unused; i++, lidp++) { 1396 for (i = 0; i < licp->lic_unused; i++, lidp++) {
1397 struct xfs_ail *ailp;
1398
1391 if (xfs_lic_isfree(licp, i)) { 1399 if (xfs_lic_isfree(licp, i)) {
1392 continue; 1400 continue;
1393 } 1401 }
@@ -1424,19 +1432,19 @@ xfs_trans_chunk_committed(
1424 * This would cause the earlier transaction to fail 1432 * This would cause the earlier transaction to fail
1425 * the test below. 1433 * the test below.
1426 */ 1434 */
1427 mp = lip->li_mountp; 1435 ailp = lip->li_ailp;
1428 spin_lock(&mp->m_ail_lock); 1436 spin_lock(&ailp->xa_lock);
1429 if (XFS_LSN_CMP(item_lsn, lip->li_lsn) > 0) { 1437 if (XFS_LSN_CMP(item_lsn, lip->li_lsn) > 0) {
1430 /* 1438 /*
1431 * This will set the item's lsn to item_lsn 1439 * This will set the item's lsn to item_lsn
1432 * and update the position of the item in 1440 * and update the position of the item in
1433 * the AIL. 1441 * the AIL.
1434 * 1442 *
1435 * xfs_trans_update_ail() drops the AIL lock. 1443 * xfs_trans_ail_update() drops the AIL lock.
1436 */ 1444 */
1437 xfs_trans_update_ail(mp, lip, item_lsn); 1445 xfs_trans_ail_update(ailp, lip, item_lsn);
1438 } else { 1446 } else {
1439 spin_unlock(&mp->m_ail_lock); 1447 spin_unlock(&ailp->xa_lock);
1440 } 1448 }
1441 1449
1442 /* 1450 /*