aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode_item.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_inode_item.c')
-rw-r--r--fs/xfs/xfs_inode_item.c42
1 files changed, 4 insertions, 38 deletions
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
index c7e70d70834..ad050c618e6 100644
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -628,19 +628,10 @@ xfs_inode_item_unlock(
628{ 628{
629 struct xfs_inode_log_item *iip = INODE_ITEM(lip); 629 struct xfs_inode_log_item *iip = INODE_ITEM(lip);
630 struct xfs_inode *ip = iip->ili_inode; 630 struct xfs_inode *ip = iip->ili_inode;
631 uint hold; 631 unsigned short lock_flags;
632 uint iolocked;
633 uint lock_flags;
634 632
635 ASSERT(iip != NULL);
636 ASSERT(iip->ili_inode->i_itemp != NULL); 633 ASSERT(iip->ili_inode->i_itemp != NULL);
637 ASSERT(xfs_isilocked(iip->ili_inode, XFS_ILOCK_EXCL)); 634 ASSERT(xfs_isilocked(iip->ili_inode, XFS_ILOCK_EXCL));
638 ASSERT((!(iip->ili_inode->i_itemp->ili_flags &
639 XFS_ILI_IOLOCKED_EXCL)) ||
640 xfs_isilocked(iip->ili_inode, XFS_IOLOCK_EXCL));
641 ASSERT((!(iip->ili_inode->i_itemp->ili_flags &
642 XFS_ILI_IOLOCKED_SHARED)) ||
643 xfs_isilocked(iip->ili_inode, XFS_IOLOCK_SHARED));
644 635
645 /* 636 /*
646 * Clear the transaction pointer in the inode. 637 * Clear the transaction pointer in the inode.
@@ -668,35 +659,10 @@ xfs_inode_item_unlock(
668 iip->ili_aextents_buf = NULL; 659 iip->ili_aextents_buf = NULL;
669 } 660 }
670 661
671 /* 662 lock_flags = iip->ili_lock_flags;
672 * Figure out if we should unlock the inode or not. 663 iip->ili_lock_flags = 0;
673 */ 664 if (lock_flags)
674 hold = iip->ili_flags & XFS_ILI_HOLD;
675
676 /*
677 * Before clearing out the flags, remember whether we
678 * are holding the inode's IO lock.
679 */
680 iolocked = iip->ili_flags & XFS_ILI_IOLOCKED_ANY;
681
682 /*
683 * Clear out the fields of the inode log item particular
684 * to the current transaction.
685 */
686 iip->ili_flags = 0;
687
688 /*
689 * Unlock the inode if XFS_ILI_HOLD was not set.
690 */
691 if (!hold) {
692 lock_flags = XFS_ILOCK_EXCL;
693 if (iolocked & XFS_ILI_IOLOCKED_EXCL) {
694 lock_flags |= XFS_IOLOCK_EXCL;
695 } else if (iolocked & XFS_ILI_IOLOCKED_SHARED) {
696 lock_flags |= XFS_IOLOCK_SHARED;
697 }
698 xfs_iput(iip->ili_inode, lock_flags); 665 xfs_iput(iip->ili_inode, lock_flags);
699 }
700} 666}
701 667
702/* 668/*