aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 077c86b6cb2..21da312dd8b 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1160,7 +1160,6 @@ int
1160xfs_release( 1160xfs_release(
1161 xfs_inode_t *ip) 1161 xfs_inode_t *ip)
1162{ 1162{
1163 bhv_vnode_t *vp = VFS_I(ip);
1164 xfs_mount_t *mp = ip->i_mount; 1163 xfs_mount_t *mp = ip->i_mount;
1165 int error; 1164 int error;
1166 1165
@@ -1195,13 +1194,13 @@ xfs_release(
1195 * be exposed to that problem. 1194 * be exposed to that problem.
1196 */ 1195 */
1197 truncated = xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED); 1196 truncated = xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED);
1198 if (truncated && VN_DIRTY(vp) && ip->i_delayed_blks > 0) 1197 if (truncated && VN_DIRTY(VFS_I(ip)) && ip->i_delayed_blks > 0)
1199 xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE); 1198 xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE);
1200 } 1199 }
1201 1200
1202 if (ip->i_d.di_nlink != 0) { 1201 if (ip->i_d.di_nlink != 0) {
1203 if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && 1202 if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) &&
1204 ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || 1203 ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 ||
1205 ip->i_delayed_blks > 0)) && 1204 ip->i_delayed_blks > 0)) &&
1206 (ip->i_df.if_flags & XFS_IFEXTENTS)) && 1205 (ip->i_df.if_flags & XFS_IFEXTENTS)) &&
1207 (!(ip->i_d.di_flags & 1206 (!(ip->i_d.di_flags &
@@ -1227,7 +1226,6 @@ int
1227xfs_inactive( 1226xfs_inactive(
1228 xfs_inode_t *ip) 1227 xfs_inode_t *ip)
1229{ 1228{
1230 bhv_vnode_t *vp = VFS_I(ip);
1231 xfs_bmap_free_t free_list; 1229 xfs_bmap_free_t free_list;
1232 xfs_fsblock_t first_block; 1230 xfs_fsblock_t first_block;
1233 int committed; 1231 int committed;
@@ -1242,7 +1240,7 @@ xfs_inactive(
1242 * If the inode is already free, then there can be nothing 1240 * If the inode is already free, then there can be nothing
1243 * to clean up here. 1241 * to clean up here.
1244 */ 1242 */
1245 if (ip->i_d.di_mode == 0 || VN_BAD(vp)) { 1243 if (ip->i_d.di_mode == 0 || VN_BAD(VFS_I(ip))) {
1246 ASSERT(ip->i_df.if_real_bytes == 0); 1244 ASSERT(ip->i_df.if_real_bytes == 0);
1247 ASSERT(ip->i_df.if_broot_bytes == 0); 1245 ASSERT(ip->i_df.if_broot_bytes == 0);
1248 return VN_INACTIVE_CACHE; 1246 return VN_INACTIVE_CACHE;
@@ -1272,7 +1270,7 @@ xfs_inactive(
1272 1270
1273 if (ip->i_d.di_nlink != 0) { 1271 if (ip->i_d.di_nlink != 0) {
1274 if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && 1272 if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) &&
1275 ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || 1273 ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 ||
1276 ip->i_delayed_blks > 0)) && 1274 ip->i_delayed_blks > 0)) &&
1277 (ip->i_df.if_flags & XFS_IFEXTENTS) && 1275 (ip->i_df.if_flags & XFS_IFEXTENTS) &&
1278 (!(ip->i_d.di_flags & 1276 (!(ip->i_d.di_flags &
@@ -2793,14 +2791,13 @@ int
2793xfs_reclaim( 2791xfs_reclaim(
2794 xfs_inode_t *ip) 2792 xfs_inode_t *ip)
2795{ 2793{
2796 bhv_vnode_t *vp = VFS_I(ip);
2797 2794
2798 xfs_itrace_entry(ip); 2795 xfs_itrace_entry(ip);
2799 2796
2800 ASSERT(!VN_MAPPED(vp)); 2797 ASSERT(!VN_MAPPED(VFS_I(ip)));
2801 2798
2802 /* bad inode, get out here ASAP */ 2799 /* bad inode, get out here ASAP */
2803 if (VN_BAD(vp)) { 2800 if (VN_BAD(VFS_I(ip))) {
2804 xfs_ireclaim(ip); 2801 xfs_ireclaim(ip);
2805 return 0; 2802 return 0;
2806 } 2803 }
@@ -2837,7 +2834,7 @@ xfs_reclaim(
2837 XFS_MOUNT_ILOCK(mp); 2834 XFS_MOUNT_ILOCK(mp);
2838 spin_lock(&ip->i_flags_lock); 2835 spin_lock(&ip->i_flags_lock);
2839 __xfs_iflags_set(ip, XFS_IRECLAIMABLE); 2836 __xfs_iflags_set(ip, XFS_IRECLAIMABLE);
2840 vp->i_private = NULL; 2837 VFS_I(ip)->i_private = NULL;
2841 ip->i_vnode = NULL; 2838 ip->i_vnode = NULL;
2842 spin_unlock(&ip->i_flags_lock); 2839 spin_unlock(&ip->i_flags_lock);
2843 list_add_tail(&ip->i_reclaim, &mp->m_del_inodes); 2840 list_add_tail(&ip->i_reclaim, &mp->m_del_inodes);
@@ -3241,7 +3238,6 @@ xfs_free_file_space(
3241 xfs_off_t len, 3238 xfs_off_t len,
3242 int attr_flags) 3239 int attr_flags)
3243{ 3240{
3244 bhv_vnode_t *vp;
3245 int committed; 3241 int committed;
3246 int done; 3242 int done;
3247 xfs_off_t end_dmi_offset; 3243 xfs_off_t end_dmi_offset;
@@ -3261,7 +3257,6 @@ xfs_free_file_space(
3261 xfs_trans_t *tp; 3257 xfs_trans_t *tp;
3262 int need_iolock = 1; 3258 int need_iolock = 1;
3263 3259
3264 vp = VFS_I(ip);
3265 mp = ip->i_mount; 3260 mp = ip->i_mount;
3266 3261
3267 xfs_itrace_entry(ip); 3262 xfs_itrace_entry(ip);
@@ -3298,7 +3293,7 @@ xfs_free_file_space(
3298 rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE); 3293 rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE);
3299 ioffset = offset & ~(rounding - 1); 3294 ioffset = offset & ~(rounding - 1);
3300 3295
3301 if (VN_CACHED(vp) != 0) { 3296 if (VN_CACHED(VFS_I(ip)) != 0) {
3302 xfs_inval_cached_trace(ip, ioffset, -1, ioffset, -1); 3297 xfs_inval_cached_trace(ip, ioffset, -1, ioffset, -1);
3303 error = xfs_flushinval_pages(ip, ioffset, -1, FI_REMAPF_LOCKED); 3298 error = xfs_flushinval_pages(ip, ioffset, -1, FI_REMAPF_LOCKED);
3304 if (error) 3299 if (error)