diff options
Diffstat (limited to 'fs/xfs/xfs_inode_item.c')
-rw-r--r-- | fs/xfs/xfs_inode_item.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index d4dc063111f8..7bfea8540159 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -535,23 +535,23 @@ xfs_inode_item_format( | |||
535 | 535 | ||
536 | /* | 536 | /* |
537 | * This is called to pin the inode associated with the inode log | 537 | * This is called to pin the inode associated with the inode log |
538 | * item in memory so it cannot be written out. Do this by calling | 538 | * item in memory so it cannot be written out. |
539 | * xfs_ipin() to bump the pin count in the inode while holding the | ||
540 | * inode pin lock. | ||
541 | */ | 539 | */ |
542 | STATIC void | 540 | STATIC void |
543 | xfs_inode_item_pin( | 541 | xfs_inode_item_pin( |
544 | xfs_inode_log_item_t *iip) | 542 | xfs_inode_log_item_t *iip) |
545 | { | 543 | { |
546 | ASSERT(xfs_isilocked(iip->ili_inode, XFS_ILOCK_EXCL)); | 544 | ASSERT(xfs_isilocked(iip->ili_inode, XFS_ILOCK_EXCL)); |
547 | xfs_ipin(iip->ili_inode); | 545 | |
546 | atomic_inc(&iip->ili_inode->i_pincount); | ||
548 | } | 547 | } |
549 | 548 | ||
550 | 549 | ||
551 | /* | 550 | /* |
552 | * This is called to unpin the inode associated with the inode log | 551 | * This is called to unpin the inode associated with the inode log |
553 | * item which was previously pinned with a call to xfs_inode_item_pin(). | 552 | * item which was previously pinned with a call to xfs_inode_item_pin(). |
554 | * Just call xfs_iunpin() on the inode to do this. | 553 | * |
554 | * Also wake up anyone in xfs_iunpin_wait() if the count goes to 0. | ||
555 | */ | 555 | */ |
556 | /* ARGSUSED */ | 556 | /* ARGSUSED */ |
557 | STATIC void | 557 | STATIC void |
@@ -559,7 +559,11 @@ xfs_inode_item_unpin( | |||
559 | xfs_inode_log_item_t *iip, | 559 | xfs_inode_log_item_t *iip, |
560 | int stale) | 560 | int stale) |
561 | { | 561 | { |
562 | xfs_iunpin(iip->ili_inode); | 562 | struct xfs_inode *ip = iip->ili_inode; |
563 | |||
564 | ASSERT(atomic_read(&ip->i_pincount) > 0); | ||
565 | if (atomic_dec_and_test(&ip->i_pincount)) | ||
566 | wake_up(&ip->i_ipin_wait); | ||
563 | } | 567 | } |
564 | 568 | ||
565 | /* ARGSUSED */ | 569 | /* ARGSUSED */ |
@@ -568,7 +572,7 @@ xfs_inode_item_unpin_remove( | |||
568 | xfs_inode_log_item_t *iip, | 572 | xfs_inode_log_item_t *iip, |
569 | xfs_trans_t *tp) | 573 | xfs_trans_t *tp) |
570 | { | 574 | { |
571 | xfs_iunpin(iip->ili_inode); | 575 | xfs_inode_item_unpin(iip, 0); |
572 | } | 576 | } |
573 | 577 | ||
574 | /* | 578 | /* |