diff options
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 061e2ffdd1de..bda774a04b8f 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -1013,7 +1013,7 @@ xfs_readlink( | |||
1013 | pathlen = (int)ip->i_d.di_size; | 1013 | pathlen = (int)ip->i_d.di_size; |
1014 | 1014 | ||
1015 | if (ip->i_df.if_flags & XFS_IFINLINE) { | 1015 | if (ip->i_df.if_flags & XFS_IFINLINE) { |
1016 | error = uio_read(ip->i_df.if_u1.if_data, pathlen, uiop); | 1016 | error = xfs_uio_read(ip->i_df.if_u1.if_data, pathlen, uiop); |
1017 | } | 1017 | } |
1018 | else { | 1018 | else { |
1019 | /* | 1019 | /* |
@@ -1044,7 +1044,7 @@ xfs_readlink( | |||
1044 | byte_cnt = pathlen; | 1044 | byte_cnt = pathlen; |
1045 | pathlen -= byte_cnt; | 1045 | pathlen -= byte_cnt; |
1046 | 1046 | ||
1047 | error = uio_read(XFS_BUF_PTR(bp), byte_cnt, uiop); | 1047 | error = xfs_uio_read(XFS_BUF_PTR(bp), byte_cnt, uiop); |
1048 | xfs_buf_relse (bp); | 1048 | xfs_buf_relse (bp); |
1049 | } | 1049 | } |
1050 | 1050 | ||
@@ -3827,11 +3827,16 @@ xfs_reclaim( | |||
3827 | */ | 3827 | */ |
3828 | xfs_synchronize_atime(ip); | 3828 | xfs_synchronize_atime(ip); |
3829 | 3829 | ||
3830 | /* If we have nothing to flush with this inode then complete the | 3830 | /* |
3831 | * teardown now, otherwise break the link between the xfs inode | 3831 | * If we have nothing to flush with this inode then complete the |
3832 | * and the linux inode and clean up the xfs inode later. This | 3832 | * teardown now, otherwise break the link between the xfs inode and the |
3833 | * avoids flushing the inode to disk during the delete operation | 3833 | * linux inode and clean up the xfs inode later. This avoids flushing |
3834 | * itself. | 3834 | * the inode to disk during the delete operation itself. |
3835 | * | ||
3836 | * When breaking the link, we need to set the XFS_IRECLAIMABLE flag | ||
3837 | * first to ensure that xfs_iunpin() will never see an xfs inode | ||
3838 | * that has a linux inode being reclaimed. Synchronisation is provided | ||
3839 | * by the i_flags_lock. | ||
3835 | */ | 3840 | */ |
3836 | if (!ip->i_update_core && (ip->i_itemp == NULL)) { | 3841 | if (!ip->i_update_core && (ip->i_itemp == NULL)) { |
3837 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 3842 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
@@ -3840,13 +3845,13 @@ xfs_reclaim( | |||
3840 | } else { | 3845 | } else { |
3841 | xfs_mount_t *mp = ip->i_mount; | 3846 | xfs_mount_t *mp = ip->i_mount; |
3842 | 3847 | ||
3843 | /* Protect sync from us */ | 3848 | /* Protect sync and unpin from us */ |
3844 | XFS_MOUNT_ILOCK(mp); | 3849 | XFS_MOUNT_ILOCK(mp); |
3845 | vn_bhv_remove(VN_BHV_HEAD(vp), XFS_ITOBHV(ip)); | ||
3846 | list_add_tail(&ip->i_reclaim, &mp->m_del_inodes); | ||
3847 | spin_lock(&ip->i_flags_lock); | 3850 | spin_lock(&ip->i_flags_lock); |
3848 | ip->i_flags |= XFS_IRECLAIMABLE; | 3851 | __xfs_iflags_set(ip, XFS_IRECLAIMABLE); |
3852 | vn_bhv_remove(VN_BHV_HEAD(vp), XFS_ITOBHV(ip)); | ||
3849 | spin_unlock(&ip->i_flags_lock); | 3853 | spin_unlock(&ip->i_flags_lock); |
3854 | list_add_tail(&ip->i_reclaim, &mp->m_del_inodes); | ||
3850 | XFS_MOUNT_IUNLOCK(mp); | 3855 | XFS_MOUNT_IUNLOCK(mp); |
3851 | } | 3856 | } |
3852 | return 0; | 3857 | return 0; |
@@ -3872,8 +3877,8 @@ xfs_finish_reclaim( | |||
3872 | */ | 3877 | */ |
3873 | write_lock(&ih->ih_lock); | 3878 | write_lock(&ih->ih_lock); |
3874 | spin_lock(&ip->i_flags_lock); | 3879 | spin_lock(&ip->i_flags_lock); |
3875 | if ((ip->i_flags & XFS_IRECLAIM) || | 3880 | if (__xfs_iflags_test(ip, XFS_IRECLAIM) || |
3876 | (!(ip->i_flags & XFS_IRECLAIMABLE) && vp == NULL)) { | 3881 | (!__xfs_iflags_test(ip, XFS_IRECLAIMABLE) && vp == NULL)) { |
3877 | spin_unlock(&ip->i_flags_lock); | 3882 | spin_unlock(&ip->i_flags_lock); |
3878 | write_unlock(&ih->ih_lock); | 3883 | write_unlock(&ih->ih_lock); |
3879 | if (locked) { | 3884 | if (locked) { |
@@ -3882,7 +3887,7 @@ xfs_finish_reclaim( | |||
3882 | } | 3887 | } |
3883 | return 1; | 3888 | return 1; |
3884 | } | 3889 | } |
3885 | ip->i_flags |= XFS_IRECLAIM; | 3890 | __xfs_iflags_set(ip, XFS_IRECLAIM); |
3886 | spin_unlock(&ip->i_flags_lock); | 3891 | spin_unlock(&ip->i_flags_lock); |
3887 | write_unlock(&ih->ih_lock); | 3892 | write_unlock(&ih->ih_lock); |
3888 | 3893 | ||