aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/quota/xfs_dquot_item.c33
-rw-r--r--fs/xfs/xfs_buf_item.c74
-rw-r--r--fs/xfs/xfs_extfree_item.c49
-rw-r--r--fs/xfs/xfs_inode_item.c17
-rw-r--r--fs/xfs/xfs_trans.c4
-rw-r--r--fs/xfs/xfs_trans.h6
6 files changed, 47 insertions, 136 deletions
diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c
index fb7054c1539d..fa2b6744937e 100644
--- a/fs/xfs/quota/xfs_dquot_item.c
+++ b/fs/xfs/quota/xfs_dquot_item.c
@@ -97,7 +97,8 @@ xfs_qm_dquot_logitem_pin(
97/* ARGSUSED */ 97/* ARGSUSED */
98STATIC void 98STATIC void
99xfs_qm_dquot_logitem_unpin( 99xfs_qm_dquot_logitem_unpin(
100 xfs_dq_logitem_t *logitem) 100 xfs_dq_logitem_t *logitem,
101 int remove)
101{ 102{
102 xfs_dquot_t *dqp = logitem->qli_dquot; 103 xfs_dquot_t *dqp = logitem->qli_dquot;
103 104
@@ -106,15 +107,6 @@ xfs_qm_dquot_logitem_unpin(
106 wake_up(&dqp->q_pinwait); 107 wake_up(&dqp->q_pinwait);
107} 108}
108 109
109/* ARGSUSED */
110STATIC void
111xfs_qm_dquot_logitem_unpin_remove(
112 xfs_dq_logitem_t *logitem,
113 xfs_trans_t *tp)
114{
115 xfs_qm_dquot_logitem_unpin(logitem);
116}
117
118/* 110/*
119 * Given the logitem, this writes the corresponding dquot entry to disk 111 * Given the logitem, this writes the corresponding dquot entry to disk
120 * asynchronously. This is called with the dquot entry securely locked; 112 * asynchronously. This is called with the dquot entry securely locked;
@@ -318,9 +310,7 @@ static struct xfs_item_ops xfs_dquot_item_ops = {
318 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*)) 310 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
319 xfs_qm_dquot_logitem_format, 311 xfs_qm_dquot_logitem_format,
320 .iop_pin = (void(*)(xfs_log_item_t*))xfs_qm_dquot_logitem_pin, 312 .iop_pin = (void(*)(xfs_log_item_t*))xfs_qm_dquot_logitem_pin,
321 .iop_unpin = (void(*)(xfs_log_item_t*))xfs_qm_dquot_logitem_unpin, 313 .iop_unpin = (void(*)(xfs_log_item_t*, int))xfs_qm_dquot_logitem_unpin,
322 .iop_unpin_remove = (void(*)(xfs_log_item_t*, xfs_trans_t*))
323 xfs_qm_dquot_logitem_unpin_remove,
324 .iop_trylock = (uint(*)(xfs_log_item_t*)) 314 .iop_trylock = (uint(*)(xfs_log_item_t*))
325 xfs_qm_dquot_logitem_trylock, 315 xfs_qm_dquot_logitem_trylock,
326 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_qm_dquot_logitem_unlock, 316 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_qm_dquot_logitem_unlock,
@@ -413,14 +403,7 @@ xfs_qm_qoff_logitem_pin(xfs_qoff_logitem_t *qf)
413 */ 403 */
414/*ARGSUSED*/ 404/*ARGSUSED*/
415STATIC void 405STATIC void
416xfs_qm_qoff_logitem_unpin(xfs_qoff_logitem_t *qf) 406xfs_qm_qoff_logitem_unpin(xfs_qoff_logitem_t *qf, int remove)
417{
418 return;
419}
420
421/*ARGSUSED*/
422STATIC void
423xfs_qm_qoff_logitem_unpin_remove(xfs_qoff_logitem_t *qf, xfs_trans_t *tp)
424{ 407{
425 return; 408 return;
426} 409}
@@ -524,9 +507,7 @@ static struct xfs_item_ops xfs_qm_qoffend_logitem_ops = {
524 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*)) 507 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
525 xfs_qm_qoff_logitem_format, 508 xfs_qm_qoff_logitem_format,
526 .iop_pin = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_pin, 509 .iop_pin = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_pin,
527 .iop_unpin = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_unpin, 510 .iop_unpin = (void(*)(xfs_log_item_t*, int))xfs_qm_qoff_logitem_unpin,
528 .iop_unpin_remove = (void(*)(xfs_log_item_t*,xfs_trans_t*))
529 xfs_qm_qoff_logitem_unpin_remove,
530 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_trylock, 511 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_trylock,
531 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_unlock, 512 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_unlock,
532 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) 513 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t))
@@ -545,9 +526,7 @@ static struct xfs_item_ops xfs_qm_qoff_logitem_ops = {
545 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*)) 526 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
546 xfs_qm_qoff_logitem_format, 527 xfs_qm_qoff_logitem_format,
547 .iop_pin = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_pin, 528 .iop_pin = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_pin,
548 .iop_unpin = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_unpin, 529 .iop_unpin = (void(*)(xfs_log_item_t*, int))xfs_qm_qoff_logitem_unpin,
549 .iop_unpin_remove = (void(*)(xfs_log_item_t*,xfs_trans_t*))
550 xfs_qm_qoff_logitem_unpin_remove,
551 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_trylock, 530 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_trylock,
552 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_unlock, 531 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_unlock,
553 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) 532 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t))
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 711f69abbbe4..93899953c603 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -388,20 +388,25 @@ xfs_buf_item_pin(
388 * Also drop the reference to the buf item for the current transaction. 388 * Also drop the reference to the buf item for the current transaction.
389 * If the XFS_BLI_STALE flag is set and we are the last reference, 389 * If the XFS_BLI_STALE flag is set and we are the last reference,
390 * then free up the buf log item and unlock the buffer. 390 * then free up the buf log item and unlock the buffer.
391 *
392 * If the remove flag is set we are called from uncommit in the
393 * forced-shutdown path. If that is true and the reference count on
394 * the log item is going to drop to zero we need to free the item's
395 * descriptor in the transaction.
391 */ 396 */
392STATIC void 397STATIC void
393xfs_buf_item_unpin( 398xfs_buf_item_unpin(
394 xfs_buf_log_item_t *bip) 399 xfs_buf_log_item_t *bip,
400 int remove)
395{ 401{
396 struct xfs_ail *ailp; 402 struct xfs_ail *ailp;
397 xfs_buf_t *bp; 403 xfs_buf_t *bp = bip->bli_buf;
398 int freed; 404 int freed;
399 int stale = bip->bli_flags & XFS_BLI_STALE; 405 int stale = bip->bli_flags & XFS_BLI_STALE;
400 406
401 bp = bip->bli_buf;
402 ASSERT(bp != NULL);
403 ASSERT(XFS_BUF_FSPRIVATE(bp, xfs_buf_log_item_t *) == bip); 407 ASSERT(XFS_BUF_FSPRIVATE(bp, xfs_buf_log_item_t *) == bip);
404 ASSERT(atomic_read(&bip->bli_refcount) > 0); 408 ASSERT(atomic_read(&bip->bli_refcount) > 0);
409
405 trace_xfs_buf_item_unpin(bip); 410 trace_xfs_buf_item_unpin(bip);
406 411
407 freed = atomic_dec_and_test(&bip->bli_refcount); 412 freed = atomic_dec_and_test(&bip->bli_refcount);
@@ -413,8 +418,26 @@ xfs_buf_item_unpin(
413 ASSERT(!(XFS_BUF_ISDELAYWRITE(bp))); 418 ASSERT(!(XFS_BUF_ISDELAYWRITE(bp)));
414 ASSERT(XFS_BUF_ISSTALE(bp)); 419 ASSERT(XFS_BUF_ISSTALE(bp));
415 ASSERT(bip->bli_format.blf_flags & XFS_BLF_CANCEL); 420 ASSERT(bip->bli_format.blf_flags & XFS_BLF_CANCEL);
421
416 trace_xfs_buf_item_unpin_stale(bip); 422 trace_xfs_buf_item_unpin_stale(bip);
417 423
424 if (remove) {
425 /*
426 * We have to remove the log item from the transaction
427 * as we are about to release our reference to the
428 * buffer. If we don't, the unlock that occurs later
429 * in xfs_trans_uncommit() will ry to reference the
430 * buffer which we no longer have a hold on.
431 */
432 xfs_trans_del_item(&bip->bli_item);
433
434 /*
435 * Since the transaction no longer refers to the buffer,
436 * the buffer should no longer refer to the transaction.
437 */
438 XFS_BUF_SET_FSPRIVATE2(bp, NULL);
439 }
440
418 /* 441 /*
419 * If we get called here because of an IO error, we may 442 * If we get called here because of an IO error, we may
420 * or may not have the item on the AIL. xfs_trans_ail_delete() 443 * or may not have the item on the AIL. xfs_trans_ail_delete()
@@ -436,45 +459,6 @@ xfs_buf_item_unpin(
436} 459}
437 460
438/* 461/*
439 * this is called from uncommit in the forced-shutdown path.
440 * we need to check to see if the reference count on the log item
441 * is going to drop to zero. If so, unpin will free the log item
442 * so we need to free the item's descriptor (that points to the item)
443 * in the transaction.
444 */
445STATIC void
446xfs_buf_item_unpin_remove(
447 xfs_buf_log_item_t *bip,
448 xfs_trans_t *tp)
449{
450 /* will xfs_buf_item_unpin() call xfs_buf_item_relse()? */
451 if ((atomic_read(&bip->bli_refcount) == 1) &&
452 (bip->bli_flags & XFS_BLI_STALE)) {
453 /*
454 * yes -- We can safely do some work here and then call
455 * buf_item_unpin to do the rest because we are
456 * are holding the buffer locked so no one else will be
457 * able to bump up the refcount. We have to remove the
458 * log item from the transaction as we are about to release
459 * our reference to the buffer. If we don't, the unlock that
460 * occurs later in the xfs_trans_uncommit() will try to
461 * reference the buffer which we no longer have a hold on.
462 */
463 ASSERT(XFS_BUF_VALUSEMA(bip->bli_buf) <= 0);
464 trace_xfs_buf_item_unpin_stale(bip);
465
466 xfs_trans_del_item(&bip->bli_item);
467
468 /*
469 * Since the transaction no longer refers to the buffer, the
470 * buffer should no longer refer to the transaction.
471 */
472 XFS_BUF_SET_FSPRIVATE2(bip->bli_buf, NULL);
473 }
474 xfs_buf_item_unpin(bip);
475}
476
477/*
478 * This is called to attempt to lock the buffer associated with this 462 * This is called to attempt to lock the buffer associated with this
479 * buf log item. Don't sleep on the buffer lock. If we can't get 463 * buf log item. Don't sleep on the buffer lock. If we can't get
480 * the lock right away, return 0. If we can get the lock, take a 464 * the lock right away, return 0. If we can get the lock, take a
@@ -669,9 +653,7 @@ static struct xfs_item_ops xfs_buf_item_ops = {
669 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*)) 653 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
670 xfs_buf_item_format, 654 xfs_buf_item_format,
671 .iop_pin = (void(*)(xfs_log_item_t*))xfs_buf_item_pin, 655 .iop_pin = (void(*)(xfs_log_item_t*))xfs_buf_item_pin,
672 .iop_unpin = (void(*)(xfs_log_item_t*))xfs_buf_item_unpin, 656 .iop_unpin = (void(*)(xfs_log_item_t*, int))xfs_buf_item_unpin,
673 .iop_unpin_remove = (void(*)(xfs_log_item_t*, xfs_trans_t *))
674 xfs_buf_item_unpin_remove,
675 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_buf_item_trylock, 657 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_buf_item_trylock,
676 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_buf_item_unlock, 658 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_buf_item_unlock,
677 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) 659 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t))
diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
index 8d0e543ca3c0..6ac7e596c54c 100644
--- a/fs/xfs/xfs_extfree_item.c
+++ b/fs/xfs/xfs_extfree_item.c
@@ -103,32 +103,8 @@ xfs_efi_item_pin(xfs_efi_log_item_t *efip)
103 * Here we coordinate with xfs_efi_cancel() to determine who gets to 103 * Here we coordinate with xfs_efi_cancel() to determine who gets to
104 * free the EFI. 104 * free the EFI.
105 */ 105 */
106/*ARGSUSED*/
107STATIC void
108xfs_efi_item_unpin(xfs_efi_log_item_t *efip)
109{
110 struct xfs_ail *ailp = efip->efi_item.li_ailp;
111
112 spin_lock(&ailp->xa_lock);
113 if (efip->efi_flags & XFS_EFI_CANCELED) {
114 /* xfs_trans_ail_delete() drops the AIL lock. */
115 xfs_trans_ail_delete(ailp, (xfs_log_item_t *)efip);
116 xfs_efi_item_free(efip);
117 } else {
118 efip->efi_flags |= XFS_EFI_COMMITTED;
119 spin_unlock(&ailp->xa_lock);
120 }
121}
122
123/*
124 * like unpin only we have to also clear the xaction descriptor
125 * pointing the log item if we free the item. This routine duplicates
126 * unpin because efi_flags is protected by the AIL lock. Freeing
127 * the descriptor and then calling unpin would force us to drop the AIL
128 * lock which would open up a race condition.
129 */
130STATIC void 106STATIC void
131xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp) 107xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int remove)
132{ 108{
133 struct xfs_ail *ailp = efip->efi_item.li_ailp; 109 struct xfs_ail *ailp = efip->efi_item.li_ailp;
134 110
@@ -136,10 +112,8 @@ xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp)
136 if (efip->efi_flags & XFS_EFI_CANCELED) { 112 if (efip->efi_flags & XFS_EFI_CANCELED) {
137 struct xfs_log_item *lip = &efip->efi_item; 113 struct xfs_log_item *lip = &efip->efi_item;
138 114
139 /* 115 if (remove)
140 * free the xaction descriptor pointing to this item 116 xfs_trans_del_item(lip);
141 */
142 xfs_trans_del_item(lip);
143 117
144 /* xfs_trans_ail_delete() drops the AIL lock. */ 118 /* xfs_trans_ail_delete() drops the AIL lock. */
145 xfs_trans_ail_delete(ailp, lip); 119 xfs_trans_ail_delete(ailp, lip);
@@ -223,9 +197,7 @@ static struct xfs_item_ops xfs_efi_item_ops = {
223 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*)) 197 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
224 xfs_efi_item_format, 198 xfs_efi_item_format,
225 .iop_pin = (void(*)(xfs_log_item_t*))xfs_efi_item_pin, 199 .iop_pin = (void(*)(xfs_log_item_t*))xfs_efi_item_pin,
226 .iop_unpin = (void(*)(xfs_log_item_t*))xfs_efi_item_unpin, 200 .iop_unpin = (void(*)(xfs_log_item_t*, int))xfs_efi_item_unpin,
227 .iop_unpin_remove = (void(*)(xfs_log_item_t*, xfs_trans_t *))
228 xfs_efi_item_unpin_remove,
229 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_efi_item_trylock, 201 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_efi_item_trylock,
230 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_efi_item_unlock, 202 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_efi_item_unlock,
231 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) 203 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t))
@@ -424,14 +396,7 @@ xfs_efd_item_pin(xfs_efd_log_item_t *efdp)
424 */ 396 */
425/*ARGSUSED*/ 397/*ARGSUSED*/
426STATIC void 398STATIC void
427xfs_efd_item_unpin(xfs_efd_log_item_t *efdp) 399xfs_efd_item_unpin(xfs_efd_log_item_t *efdp, int remove)
428{
429 return;
430}
431
432/*ARGSUSED*/
433STATIC void
434xfs_efd_item_unpin_remove(xfs_efd_log_item_t *efdp, xfs_trans_t *tp)
435{ 400{
436 return; 401 return;
437} 402}
@@ -514,9 +479,7 @@ static struct xfs_item_ops xfs_efd_item_ops = {
514 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*)) 479 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
515 xfs_efd_item_format, 480 xfs_efd_item_format,
516 .iop_pin = (void(*)(xfs_log_item_t*))xfs_efd_item_pin, 481 .iop_pin = (void(*)(xfs_log_item_t*))xfs_efd_item_pin,
517 .iop_unpin = (void(*)(xfs_log_item_t*))xfs_efd_item_unpin, 482 .iop_unpin = (void(*)(xfs_log_item_t*, int))xfs_efd_item_unpin,
518 .iop_unpin_remove = (void(*)(xfs_log_item_t*, xfs_trans_t*))
519 xfs_efd_item_unpin_remove,
520 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_efd_item_trylock, 483 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_efd_item_trylock,
521 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_efd_item_unlock, 484 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_efd_item_unlock,
522 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) 485 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t))
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
index 4b97d7754b83..a01990dbb945 100644
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -544,10 +544,10 @@ xfs_inode_item_pin(
544 * 544 *
545 * Also wake up anyone in xfs_iunpin_wait() if the count goes to 0. 545 * Also wake up anyone in xfs_iunpin_wait() if the count goes to 0.
546 */ 546 */
547/* ARGSUSED */
548STATIC void 547STATIC void
549xfs_inode_item_unpin( 548xfs_inode_item_unpin(
550 xfs_inode_log_item_t *iip) 549 xfs_inode_log_item_t *iip,
550 int remove)
551{ 551{
552 struct xfs_inode *ip = iip->ili_inode; 552 struct xfs_inode *ip = iip->ili_inode;
553 553
@@ -557,15 +557,6 @@ xfs_inode_item_unpin(
557 wake_up(&ip->i_ipin_wait); 557 wake_up(&ip->i_ipin_wait);
558} 558}
559 559
560/* ARGSUSED */
561STATIC void
562xfs_inode_item_unpin_remove(
563 xfs_inode_log_item_t *iip,
564 xfs_trans_t *tp)
565{
566 xfs_inode_item_unpin(iip);
567}
568
569/* 560/*
570 * This is called to attempt to lock the inode associated with this 561 * This is called to attempt to lock the inode associated with this
571 * inode log item, in preparation for the push routine which does the actual 562 * inode log item, in preparation for the push routine which does the actual
@@ -829,9 +820,7 @@ static struct xfs_item_ops xfs_inode_item_ops = {
829 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*)) 820 .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
830 xfs_inode_item_format, 821 xfs_inode_item_format,
831 .iop_pin = (void(*)(xfs_log_item_t*))xfs_inode_item_pin, 822 .iop_pin = (void(*)(xfs_log_item_t*))xfs_inode_item_pin,
832 .iop_unpin = (void(*)(xfs_log_item_t*))xfs_inode_item_unpin, 823 .iop_unpin = (void(*)(xfs_log_item_t*, int))xfs_inode_item_unpin,
833 .iop_unpin_remove = (void(*)(xfs_log_item_t*, xfs_trans_t*))
834 xfs_inode_item_unpin_remove,
835 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_inode_item_trylock, 824 .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_inode_item_trylock,
836 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_inode_item_unlock, 825 .iop_unlock = (void(*)(xfs_log_item_t*))xfs_inode_item_unlock,
837 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) 826 .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t))
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 9c41efccf728..213792e1ad02 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -1375,7 +1375,7 @@ xfs_trans_item_committed(
1375 * log item flags, if anyone else stales the buffer we do not want to 1375 * log item flags, if anyone else stales the buffer we do not want to
1376 * pay any attention to it. 1376 * pay any attention to it.
1377 */ 1377 */
1378 IOP_UNPIN(lip); 1378 IOP_UNPIN(lip, 0);
1379} 1379}
1380 1380
1381/* 1381/*
@@ -1422,7 +1422,7 @@ xfs_trans_uncommit(
1422 * Unpin all but those that aren't dirty. 1422 * Unpin all but those that aren't dirty.
1423 */ 1423 */
1424 if (lidp->lid_flags & XFS_LID_DIRTY) 1424 if (lidp->lid_flags & XFS_LID_DIRTY)
1425 IOP_UNPIN_REMOVE(lidp->lid_item, tp); 1425 IOP_UNPIN(lidp->lid_item, 1);
1426 } 1426 }
1427 1427
1428 xfs_trans_unreserve_and_mod_sb(tp); 1428 xfs_trans_unreserve_and_mod_sb(tp);
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index 0c903eb8bbe1..37c0ce1ccd48 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -347,8 +347,7 @@ typedef struct xfs_item_ops {
347 uint (*iop_size)(xfs_log_item_t *); 347 uint (*iop_size)(xfs_log_item_t *);
348 void (*iop_format)(xfs_log_item_t *, struct xfs_log_iovec *); 348 void (*iop_format)(xfs_log_item_t *, struct xfs_log_iovec *);
349 void (*iop_pin)(xfs_log_item_t *); 349 void (*iop_pin)(xfs_log_item_t *);
350 void (*iop_unpin)(xfs_log_item_t *); 350 void (*iop_unpin)(xfs_log_item_t *, int remove);
351 void (*iop_unpin_remove)(xfs_log_item_t *, struct xfs_trans *);
352 uint (*iop_trylock)(xfs_log_item_t *); 351 uint (*iop_trylock)(xfs_log_item_t *);
353 void (*iop_unlock)(xfs_log_item_t *); 352 void (*iop_unlock)(xfs_log_item_t *);
354 xfs_lsn_t (*iop_committed)(xfs_log_item_t *, xfs_lsn_t); 353 xfs_lsn_t (*iop_committed)(xfs_log_item_t *, xfs_lsn_t);
@@ -360,8 +359,7 @@ typedef struct xfs_item_ops {
360#define IOP_SIZE(ip) (*(ip)->li_ops->iop_size)(ip) 359#define IOP_SIZE(ip) (*(ip)->li_ops->iop_size)(ip)
361#define IOP_FORMAT(ip,vp) (*(ip)->li_ops->iop_format)(ip, vp) 360#define IOP_FORMAT(ip,vp) (*(ip)->li_ops->iop_format)(ip, vp)
362#define IOP_PIN(ip) (*(ip)->li_ops->iop_pin)(ip) 361#define IOP_PIN(ip) (*(ip)->li_ops->iop_pin)(ip)
363#define IOP_UNPIN(ip) (*(ip)->li_ops->iop_unpin)(ip) 362#define IOP_UNPIN(ip, remove) (*(ip)->li_ops->iop_unpin)(ip, remove)
364#define IOP_UNPIN_REMOVE(ip,tp) (*(ip)->li_ops->iop_unpin_remove)(ip, tp)
365#define IOP_TRYLOCK(ip) (*(ip)->li_ops->iop_trylock)(ip) 363#define IOP_TRYLOCK(ip) (*(ip)->li_ops->iop_trylock)(ip)
366#define IOP_UNLOCK(ip) (*(ip)->li_ops->iop_unlock)(ip) 364#define IOP_UNLOCK(ip) (*(ip)->li_ops->iop_unlock)(ip)
367#define IOP_COMMITTED(ip, lsn) (*(ip)->li_ops->iop_committed)(ip, lsn) 365#define IOP_COMMITTED(ip, lsn) (*(ip)->li_ops->iop_committed)(ip, lsn)