xfs: move the di_nblocks field to struct xfs_inode

In preparation of removing the historic icinode struct, move the nblocks
field into the containing xfs_inode structure.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
Christoph Hellwig 2021-03-29 11:11:40 -07:00 committed by Darrick J. Wong
parent 13d2c10b05
commit 6e73a545f9
16 changed files with 33 additions and 34 deletions

View file

@ -832,7 +832,7 @@ xfs_init_new_inode(
ip->i_disk_size = 0;
ip->i_df.if_nextents = 0;
ASSERT(ip->i_d.di_nblocks == 0);
ASSERT(ip->i_nblocks == 0);
tv = current_time(inode);
inode->i_mtime = tv;
@ -2586,7 +2586,7 @@ xfs_ifree(
ASSERT(VFS_I(ip)->i_nlink == 0);
ASSERT(ip->i_df.if_nextents == 0);
ASSERT(ip->i_disk_size == 0 || !S_ISREG(VFS_I(ip)->i_mode));
ASSERT(ip->i_d.di_nblocks == 0);
ASSERT(ip->i_nblocks == 0);
/*
* Pull the on-disk inode from the AGI unlinked list.
@ -3436,13 +3436,13 @@ xfs_iflush(
}
}
if (XFS_TEST_ERROR(ip->i_df.if_nextents + xfs_ifork_nextents(ip->i_afp) >
ip->i_d.di_nblocks, mp, XFS_ERRTAG_IFLUSH_5)) {
ip->i_nblocks, mp, XFS_ERRTAG_IFLUSH_5)) {
xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
"%s: detected corrupt incore inode %Lu, "
"total extents = %d, nblocks = %Ld, ptr "PTR_FMT,
__func__, ip->i_ino,
ip->i_df.if_nextents + xfs_ifork_nextents(ip->i_afp),
ip->i_d.di_nblocks, ip);
ip->i_nblocks, ip);
goto flush_out;
}
if (XFS_TEST_ERROR(ip->i_d.di_forkoff > mp->m_sb.sb_inodesize,