aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 597e0ed4d2b6..805cab7b2770 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2814,40 +2814,8 @@ xfs_iunpin(
2814{ 2814{
2815 ASSERT(atomic_read(&ip->i_pincount) > 0); 2815 ASSERT(atomic_read(&ip->i_pincount) > 0);
2816 2816
2817 if (atomic_dec_and_lock(&ip->i_pincount, &ip->i_flags_lock)) { 2817 if (atomic_dec_and_test(&ip->i_pincount))
2818
2819 /*
2820 * If the inode is currently being reclaimed, the link between
2821 * the bhv_vnode and the xfs_inode will be broken after the
2822 * XFS_IRECLAIM* flag is set. Hence, if these flags are not
2823 * set, then we can move forward and mark the linux inode dirty
2824 * knowing that it is still valid as it won't freed until after
2825 * the bhv_vnode<->xfs_inode link is broken in xfs_reclaim. The
2826 * i_flags_lock is used to synchronise the setting of the
2827 * XFS_IRECLAIM* flags and the breaking of the link, and so we
2828 * can execute atomically w.r.t to reclaim by holding this lock
2829 * here.
2830 *
2831 * However, we still need to issue the unpin wakeup call as the
2832 * inode reclaim may be blocked waiting for the inode to become
2833 * unpinned.
2834 */
2835
2836 if (!__xfs_iflags_test(ip, XFS_IRECLAIM|XFS_IRECLAIMABLE)) {
2837 bhv_vnode_t *vp = XFS_ITOV_NULL(ip);
2838 struct inode *inode = NULL;
2839
2840 BUG_ON(vp == NULL);
2841 inode = vn_to_inode(vp);
2842 BUG_ON(inode->i_state & I_CLEAR);
2843
2844 /* make sync come back and flush this inode */
2845 if (!(inode->i_state & (I_NEW|I_FREEING)))
2846 mark_inode_dirty_sync(inode);
2847 }
2848 spin_unlock(&ip->i_flags_lock);
2849 wake_up(&ip->i_ipin_wait); 2818 wake_up(&ip->i_ipin_wait);
2850 }
2851} 2819}
2852 2820
2853/* 2821/*