mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
[XFS] stop updating inode->i_blocks
The VFS doesn't use i_blocks, it's only used by generic_fillattr and the generic quota code which XFS doesn't use. In XFS there is one use to check whether we have an inline or out of line sumlink, but we can replace that with a check of the XFS_IFINLINE inode flag. SGI-PV: 971186 SGI-Modid: xfs-linux-melb:xfs-kern:30391a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
This commit is contained in:
parent
de08dbc197
commit
222096ae7f
@ -202,9 +202,6 @@ xfs_validate_fields(
|
|||||||
loff_t size;
|
loff_t size;
|
||||||
|
|
||||||
inode->i_nlink = ip->i_d.di_nlink;
|
inode->i_nlink = ip->i_d.di_nlink;
|
||||||
inode->i_blocks =
|
|
||||||
XFS_FSB_TO_BB(ip->i_mount, ip->i_d.di_nblocks +
|
|
||||||
ip->i_delayed_blks);
|
|
||||||
/* we're under i_sem so i_size can't change under us */
|
/* we're under i_sem so i_size can't change under us */
|
||||||
size = XFS_ISIZE(ip);
|
size = XFS_ISIZE(ip);
|
||||||
if (i_size_read(inode) != size)
|
if (i_size_read(inode) != size)
|
||||||
|
@ -569,7 +569,7 @@ xfs_set_inodeops(
|
|||||||
break;
|
break;
|
||||||
case S_IFLNK:
|
case S_IFLNK:
|
||||||
inode->i_op = &xfs_symlink_inode_operations;
|
inode->i_op = &xfs_symlink_inode_operations;
|
||||||
if (inode->i_blocks)
|
if (!(XFS_I(inode)->i_df.if_flags & XFS_IFINLINE))
|
||||||
inode->i_mapping->a_ops = &xfs_address_space_operations;
|
inode->i_mapping->a_ops = &xfs_address_space_operations;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -606,8 +606,6 @@ xfs_revalidate_inode(
|
|||||||
|
|
||||||
inode->i_generation = ip->i_d.di_gen;
|
inode->i_generation = ip->i_d.di_gen;
|
||||||
i_size_write(inode, ip->i_d.di_size);
|
i_size_write(inode, ip->i_d.di_size);
|
||||||
inode->i_blocks =
|
|
||||||
XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks);
|
|
||||||
inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec;
|
inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec;
|
||||||
inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec;
|
inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec;
|
||||||
inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec;
|
inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec;
|
||||||
|
@ -106,8 +106,6 @@ vn_revalidate(
|
|||||||
inode->i_nlink = ip->i_d.di_nlink;
|
inode->i_nlink = ip->i_d.di_nlink;
|
||||||
inode->i_uid = ip->i_d.di_uid;
|
inode->i_uid = ip->i_d.di_uid;
|
||||||
inode->i_gid = ip->i_d.di_gid;
|
inode->i_gid = ip->i_d.di_gid;
|
||||||
inode->i_blocks =
|
|
||||||
XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks);
|
|
||||||
inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec;
|
inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec;
|
||||||
inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec;
|
inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec;
|
||||||
inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec;
|
inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec;
|
||||||
|
@ -1536,9 +1536,6 @@ xfs_release(
|
|||||||
error = xfs_free_eofblocks(mp, ip, XFS_FREE_EOF_LOCK);
|
error = xfs_free_eofblocks(mp, ip, XFS_FREE_EOF_LOCK);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
/* Update linux inode block count after free above */
|
|
||||||
vn_to_inode(vp)->i_blocks = XFS_FSB_TO_BB(mp,
|
|
||||||
ip->i_d.di_nblocks + ip->i_delayed_blks);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1612,9 +1609,6 @@ xfs_inactive(
|
|||||||
error = xfs_free_eofblocks(mp, ip, XFS_FREE_EOF_LOCK);
|
error = xfs_free_eofblocks(mp, ip, XFS_FREE_EOF_LOCK);
|
||||||
if (error)
|
if (error)
|
||||||
return VN_INACTIVE_CACHE;
|
return VN_INACTIVE_CACHE;
|
||||||
/* Update linux inode block count after free above */
|
|
||||||
vn_to_inode(vp)->i_blocks = XFS_FSB_TO_BB(mp,
|
|
||||||
ip->i_d.di_nblocks + ip->i_delayed_blks);
|
|
||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user