diff options
Diffstat (limited to 'fs/xfs/xfs_trans.c')
-rw-r--r-- | fs/xfs/xfs_trans.c | 22 |
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 | /* |