Commit 13d2c10b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: move the di_size field to struct xfs_inode

In preparation of removing the historic icinode struct, move the on-disk
size field into the containing xfs_inode structure.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
parent ceaf603c
...@@ -1440,7 +1440,7 @@ xfs_bmap_last_offset( ...@@ -1440,7 +1440,7 @@ xfs_bmap_last_offset(
/* /*
* Returns whether the selected fork of the inode has exactly one * Returns whether the selected fork of the inode has exactly one
* block or not. For the data fork we check this matches di_size, * block or not. For the data fork we check this matches i_disk_size,
* implying the file's range is 0..bsize-1. * implying the file's range is 0..bsize-1.
*/ */
int /* 1=>1 block, 0=>otherwise */ int /* 1=>1 block, 0=>otherwise */
......
...@@ -179,9 +179,9 @@ xfs_dir_isempty( ...@@ -179,9 +179,9 @@ xfs_dir_isempty(
xfs_dir2_sf_hdr_t *sfp; xfs_dir2_sf_hdr_t *sfp;
ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); ASSERT(S_ISDIR(VFS_I(dp)->i_mode));
if (dp->i_d.di_size == 0) /* might happen during shutdown. */ if (dp->i_disk_size == 0) /* might happen during shutdown. */
return 1; return 1;
if (dp->i_d.di_size > XFS_IFORK_DSIZE(dp)) if (dp->i_disk_size > XFS_IFORK_DSIZE(dp))
return 0; return 0;
sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
return !sfp->count; return !sfp->count;
...@@ -584,8 +584,8 @@ xfs_dir2_grow_inode( ...@@ -584,8 +584,8 @@ xfs_dir2_grow_inode(
xfs_fsize_t size; /* directory file (data) size */ xfs_fsize_t size; /* directory file (data) size */
size = XFS_FSB_TO_B(mp, bno + count); size = XFS_FSB_TO_B(mp, bno + count);
if (size > dp->i_d.di_size) { if (size > dp->i_disk_size) {
dp->i_d.di_size = size; dp->i_disk_size = size;
xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE); xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE);
} }
} }
...@@ -608,7 +608,7 @@ xfs_dir2_isblock( ...@@ -608,7 +608,7 @@ xfs_dir2_isblock(
rval = XFS_FSB_TO_B(args->dp->i_mount, last) == args->geo->blksize; rval = XFS_FSB_TO_B(args->dp->i_mount, last) == args->geo->blksize;
if (XFS_IS_CORRUPT(args->dp->i_mount, if (XFS_IS_CORRUPT(args->dp->i_mount,
rval != 0 && rval != 0 &&
args->dp->i_d.di_size != args->geo->blksize)) args->dp->i_disk_size != args->geo->blksize))
return -EFSCORRUPTED; return -EFSCORRUPTED;
*vp = rval; *vp = rval;
return 0; return 0;
...@@ -687,7 +687,7 @@ xfs_dir2_shrink_inode( ...@@ -687,7 +687,7 @@ xfs_dir2_shrink_inode(
/* /*
* If the block isn't the last one in the directory, we're done. * If the block isn't the last one in the directory, we're done.
*/ */
if (dp->i_d.di_size > xfs_dir2_db_off_to_byte(args->geo, db + 1, 0)) if (dp->i_disk_size > xfs_dir2_db_off_to_byte(args->geo, db + 1, 0))
return 0; return 0;
bno = da; bno = da;
if ((error = xfs_bmap_last_before(tp, dp, &bno, XFS_DATA_FORK))) { if ((error = xfs_bmap_last_before(tp, dp, &bno, XFS_DATA_FORK))) {
...@@ -703,7 +703,7 @@ xfs_dir2_shrink_inode( ...@@ -703,7 +703,7 @@ xfs_dir2_shrink_inode(
/* /*
* Set the size to the new last block. * Set the size to the new last block.
*/ */
dp->i_d.di_size = XFS_FSB_TO_B(mp, bno); dp->i_disk_size = XFS_FSB_TO_B(mp, bno);
xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
return 0; return 0;
} }
......
...@@ -961,7 +961,7 @@ xfs_dir2_leaf_to_block( ...@@ -961,7 +961,7 @@ xfs_dir2_leaf_to_block(
* been left behind during no-space-reservation operations. * been left behind during no-space-reservation operations.
* These will show up in the leaf bests table. * These will show up in the leaf bests table.
*/ */
while (dp->i_d.di_size > args->geo->blksize) { while (dp->i_disk_size > args->geo->blksize) {
int hdrsz; int hdrsz;
hdrsz = args->geo->data_entry_offset; hdrsz = args->geo->data_entry_offset;
...@@ -1097,13 +1097,13 @@ xfs_dir2_sf_to_block( ...@@ -1097,13 +1097,13 @@ xfs_dir2_sf_to_block(
trace_xfs_dir2_sf_to_block(args); trace_xfs_dir2_sf_to_block(args);
ASSERT(ifp->if_flags & XFS_IFINLINE); ASSERT(ifp->if_flags & XFS_IFINLINE);
ASSERT(dp->i_d.di_size >= offsetof(struct xfs_dir2_sf_hdr, parent)); ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
oldsfp = (xfs_dir2_sf_hdr_t *)ifp->if_u1.if_data; oldsfp = (xfs_dir2_sf_hdr_t *)ifp->if_u1.if_data;
ASSERT(ifp->if_bytes == dp->i_d.di_size); ASSERT(ifp->if_bytes == dp->i_disk_size);
ASSERT(ifp->if_u1.if_data != NULL); ASSERT(ifp->if_u1.if_data != NULL);
ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(oldsfp->i8count)); ASSERT(dp->i_disk_size >= xfs_dir2_sf_hdr_size(oldsfp->i8count));
ASSERT(dp->i_df.if_nextents == 0); ASSERT(dp->i_df.if_nextents == 0);
/* /*
...@@ -1115,7 +1115,7 @@ xfs_dir2_sf_to_block( ...@@ -1115,7 +1115,7 @@ xfs_dir2_sf_to_block(
xfs_idata_realloc(dp, -ifp->if_bytes, XFS_DATA_FORK); xfs_idata_realloc(dp, -ifp->if_bytes, XFS_DATA_FORK);
xfs_bmap_local_to_extents_empty(tp, dp, XFS_DATA_FORK); xfs_bmap_local_to_extents_empty(tp, dp, XFS_DATA_FORK);
dp->i_d.di_size = 0; dp->i_disk_size = 0;
/* /*
* Add block 0 to the inode. * Add block 0 to the inode.
......
...@@ -152,7 +152,7 @@ xfs_dir3_leaf_check_int( ...@@ -152,7 +152,7 @@ xfs_dir3_leaf_check_int(
/* /*
* XXX (dgc): This value is not restrictive enough. * XXX (dgc): This value is not restrictive enough.
* Should factor in the size of the bests table as well. * Should factor in the size of the bests table as well.
* We can deduce a value for that from di_size. * We can deduce a value for that from i_disk_size.
*/ */
if (hdr->count > geo->leaf_max_ents) if (hdr->count > geo->leaf_max_ents)
return __this_address; return __this_address;
......
...@@ -441,7 +441,7 @@ xfs_dir2_leaf_to_node( ...@@ -441,7 +441,7 @@ xfs_dir2_leaf_to_node(
leaf = lbp->b_addr; leaf = lbp->b_addr;
ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
if (be32_to_cpu(ltp->bestcount) > if (be32_to_cpu(ltp->bestcount) >
(uint)dp->i_d.di_size / args->geo->blksize) { (uint)dp->i_disk_size / args->geo->blksize) {
xfs_buf_mark_corrupt(lbp); xfs_buf_mark_corrupt(lbp);
return -EFSCORRUPTED; return -EFSCORRUPTED;
} }
......
...@@ -344,7 +344,7 @@ xfs_dir2_block_to_sf( ...@@ -344,7 +344,7 @@ xfs_dir2_block_to_sf(
ASSERT(dp->i_df.if_bytes == 0); ASSERT(dp->i_df.if_bytes == 0);
xfs_init_local_fork(dp, XFS_DATA_FORK, sfp, size); xfs_init_local_fork(dp, XFS_DATA_FORK, sfp, size);
dp->i_df.if_format = XFS_DINODE_FMT_LOCAL; dp->i_df.if_format = XFS_DINODE_FMT_LOCAL;
dp->i_d.di_size = size; dp->i_disk_size = size;
logflags |= XFS_ILOG_DDATA; logflags |= XFS_ILOG_DDATA;
xfs_dir2_sf_check(args); xfs_dir2_sf_check(args);
...@@ -367,7 +367,7 @@ xfs_dir2_sf_addname( ...@@ -367,7 +367,7 @@ xfs_dir2_sf_addname(
xfs_inode_t *dp; /* incore directory inode */ xfs_inode_t *dp; /* incore directory inode */
int error; /* error return value */ int error; /* error return value */
int incr_isize; /* total change in size */ int incr_isize; /* total change in size */
int new_isize; /* di_size after adding name */ int new_isize; /* size after adding name */
int objchange; /* changing to 8-byte inodes */ int objchange; /* changing to 8-byte inodes */
xfs_dir2_data_aoff_t offset = 0; /* offset for new entry */ xfs_dir2_data_aoff_t offset = 0; /* offset for new entry */
int pick; /* which algorithm to use */ int pick; /* which algorithm to use */
...@@ -379,11 +379,11 @@ xfs_dir2_sf_addname( ...@@ -379,11 +379,11 @@ xfs_dir2_sf_addname(
ASSERT(xfs_dir2_sf_lookup(args) == -ENOENT); ASSERT(xfs_dir2_sf_lookup(args) == -ENOENT);
dp = args->dp; dp = args->dp;
ASSERT(dp->i_df.if_flags & XFS_IFINLINE); ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
ASSERT(dp->i_d.di_size >= offsetof(struct xfs_dir2_sf_hdr, parent)); ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
ASSERT(dp->i_df.if_u1.if_data != NULL); ASSERT(dp->i_df.if_u1.if_data != NULL);
sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->i8count)); ASSERT(dp->i_disk_size >= xfs_dir2_sf_hdr_size(sfp->i8count));
/* /*
* Compute entry (and change in) size. * Compute entry (and change in) size.
*/ */
...@@ -401,7 +401,7 @@ xfs_dir2_sf_addname( ...@@ -401,7 +401,7 @@ xfs_dir2_sf_addname(
objchange = 1; objchange = 1;
} }
new_isize = (int)dp->i_d.di_size + incr_isize; new_isize = (int)dp->i_disk_size + incr_isize;
/* /*
* Won't fit as shortform any more (due to size), * Won't fit as shortform any more (due to size),
* or the pick routine says it won't (due to offset values). * or the pick routine says it won't (due to offset values).
...@@ -492,7 +492,7 @@ xfs_dir2_sf_addname_easy( ...@@ -492,7 +492,7 @@ xfs_dir2_sf_addname_easy(
sfp->count++; sfp->count++;
if (args->inumber > XFS_DIR2_MAX_SHORT_INUM) if (args->inumber > XFS_DIR2_MAX_SHORT_INUM)
sfp->i8count++; sfp->i8count++;
dp->i_d.di_size = new_isize; dp->i_disk_size = new_isize;
xfs_dir2_sf_check(args); xfs_dir2_sf_check(args);
} }
...@@ -519,7 +519,7 @@ xfs_dir2_sf_addname_hard( ...@@ -519,7 +519,7 @@ xfs_dir2_sf_addname_hard(
int nbytes; /* temp for byte copies */ int nbytes; /* temp for byte copies */
xfs_dir2_data_aoff_t new_offset; /* next offset value */ xfs_dir2_data_aoff_t new_offset; /* next offset value */
xfs_dir2_data_aoff_t offset; /* current offset value */ xfs_dir2_data_aoff_t offset; /* current offset value */
int old_isize; /* previous di_size */ int old_isize; /* previous size */
xfs_dir2_sf_entry_t *oldsfep; /* entry in original dir */ xfs_dir2_sf_entry_t *oldsfep; /* entry in original dir */
xfs_dir2_sf_hdr_t *oldsfp; /* original shortform dir */ xfs_dir2_sf_hdr_t *oldsfp; /* original shortform dir */
xfs_dir2_sf_entry_t *sfep; /* entry in new dir */ xfs_dir2_sf_entry_t *sfep; /* entry in new dir */
...@@ -529,7 +529,7 @@ xfs_dir2_sf_addname_hard( ...@@ -529,7 +529,7 @@ xfs_dir2_sf_addname_hard(
* Copy the old directory to the stack buffer. * Copy the old directory to the stack buffer.
*/ */
sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
old_isize = (int)dp->i_d.di_size; old_isize = (int)dp->i_disk_size;
buf = kmem_alloc(old_isize, 0); buf = kmem_alloc(old_isize, 0);
oldsfp = (xfs_dir2_sf_hdr_t *)buf; oldsfp = (xfs_dir2_sf_hdr_t *)buf;
memcpy(oldsfp, sfp, old_isize); memcpy(oldsfp, sfp, old_isize);
...@@ -586,7 +586,7 @@ xfs_dir2_sf_addname_hard( ...@@ -586,7 +586,7 @@ xfs_dir2_sf_addname_hard(
memcpy(sfep, oldsfep, old_isize - nbytes); memcpy(sfep, oldsfep, old_isize - nbytes);
} }
kmem_free(buf); kmem_free(buf);
dp->i_d.di_size = new_isize; dp->i_disk_size = new_isize;
xfs_dir2_sf_check(args); xfs_dir2_sf_check(args);
} }
...@@ -697,7 +697,7 @@ xfs_dir2_sf_check( ...@@ -697,7 +697,7 @@ xfs_dir2_sf_check(
ASSERT(xfs_dir2_sf_get_ftype(mp, sfep) < XFS_DIR3_FT_MAX); ASSERT(xfs_dir2_sf_get_ftype(mp, sfep) < XFS_DIR3_FT_MAX);
} }
ASSERT(i8count == sfp->i8count); ASSERT(i8count == sfp->i8count);
ASSERT((char *)sfep - (char *)sfp == dp->i_d.di_size); ASSERT((char *)sfep - (char *)sfp == dp->i_disk_size);
ASSERT(offset + ASSERT(offset +
(sfp->count + 2) * (uint)sizeof(xfs_dir2_leaf_entry_t) + (sfp->count + 2) * (uint)sizeof(xfs_dir2_leaf_entry_t) +
(uint)sizeof(xfs_dir2_block_tail_t) <= args->geo->blksize); (uint)sizeof(xfs_dir2_block_tail_t) <= args->geo->blksize);
...@@ -821,7 +821,7 @@ xfs_dir2_sf_create( ...@@ -821,7 +821,7 @@ xfs_dir2_sf_create(
dp = args->dp; dp = args->dp;
ASSERT(dp != NULL); ASSERT(dp != NULL);
ASSERT(dp->i_d.di_size == 0); ASSERT(dp->i_disk_size == 0);
/* /*
* If it's currently a zero-length extent file, * If it's currently a zero-length extent file,
* convert it to local format. * convert it to local format.
...@@ -850,7 +850,7 @@ xfs_dir2_sf_create( ...@@ -850,7 +850,7 @@ xfs_dir2_sf_create(
*/ */
xfs_dir2_sf_put_parent_ino(sfp, pino); xfs_dir2_sf_put_parent_ino(sfp, pino);
sfp->count = 0; sfp->count = 0;
dp->i_d.di_size = size; dp->i_disk_size = size;
xfs_dir2_sf_check(args); xfs_dir2_sf_check(args);
xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
return 0; return 0;
...@@ -878,11 +878,11 @@ xfs_dir2_sf_lookup( ...@@ -878,11 +878,11 @@ xfs_dir2_sf_lookup(
xfs_dir2_sf_check(args); xfs_dir2_sf_check(args);
ASSERT(dp->i_df.if_flags & XFS_IFINLINE); ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
ASSERT(dp->i_d.di_size >= offsetof(struct xfs_dir2_sf_hdr, parent)); ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
ASSERT(dp->i_df.if_u1.if_data != NULL); ASSERT(dp->i_df.if_u1.if_data != NULL);
sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->i8count)); ASSERT(dp->i_disk_size >= xfs_dir2_sf_hdr_size(sfp->i8count));
/* /*
* Special case for . * Special case for .
*/ */
...@@ -955,7 +955,7 @@ xfs_dir2_sf_removename( ...@@ -955,7 +955,7 @@ xfs_dir2_sf_removename(
trace_xfs_dir2_sf_removename(args); trace_xfs_dir2_sf_removename(args);
ASSERT(dp->i_df.if_flags & XFS_IFINLINE); ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
oldsize = (int)dp->i_d.di_size; oldsize = (int)dp->i_disk_size;
ASSERT(oldsize >= offsetof(struct xfs_dir2_sf_hdr, parent)); ASSERT(oldsize >= offsetof(struct xfs_dir2_sf_hdr, parent));
ASSERT(dp->i_df.if_bytes == oldsize); ASSERT(dp->i_df.if_bytes == oldsize);
ASSERT(dp->i_df.if_u1.if_data != NULL); ASSERT(dp->i_df.if_u1.if_data != NULL);
...@@ -995,7 +995,7 @@ xfs_dir2_sf_removename( ...@@ -995,7 +995,7 @@ xfs_dir2_sf_removename(
* Fix up the header and file size. * Fix up the header and file size.
*/ */
sfp->count--; sfp->count--;
dp->i_d.di_size = newsize; dp->i_disk_size = newsize;
/* /*
* Reallocate, making it smaller. * Reallocate, making it smaller.
*/ */
...@@ -1054,11 +1054,11 @@ xfs_dir2_sf_replace( ...@@ -1054,11 +1054,11 @@ xfs_dir2_sf_replace(
trace_xfs_dir2_sf_replace(args); trace_xfs_dir2_sf_replace(args);
ASSERT(dp->i_df.if_flags & XFS_IFINLINE); ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
ASSERT(dp->i_d.di_size >= offsetof(struct xfs_dir2_sf_hdr, parent)); ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
ASSERT(dp->i_df.if_u1.if_data != NULL); ASSERT(dp->i_df.if_u1.if_data != NULL);
sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->i8count)); ASSERT(dp->i_disk_size >= xfs_dir2_sf_hdr_size(sfp->i8count));
/* /*
* New inode number is large, and need to convert to 8-byte inodes. * New inode number is large, and need to convert to 8-byte inodes.
...@@ -1219,7 +1219,7 @@ xfs_dir2_sf_toino4( ...@@ -1219,7 +1219,7 @@ xfs_dir2_sf_toino4(
* Clean up the inode. * Clean up the inode.
*/ */
kmem_free(buf); kmem_free(buf);
dp->i_d.di_size = newsize; dp->i_disk_size = newsize;
xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
} }
...@@ -1292,6 +1292,6 @@ xfs_dir2_sf_toino8( ...@@ -1292,6 +1292,6 @@ xfs_dir2_sf_toino8(
* Clean up the inode. * Clean up the inode.
*/ */
kmem_free(buf); kmem_free(buf);
dp->i_d.di_size = newsize; dp->i_disk_size = newsize;
xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
} }
...@@ -226,7 +226,7 @@ xfs_inode_from_disk( ...@@ -226,7 +226,7 @@ xfs_inode_from_disk(
inode->i_mtime = xfs_inode_from_disk_ts(from, from->di_mtime); inode->i_mtime = xfs_inode_from_disk_ts(from, from->di_mtime);
inode->i_ctime = xfs_inode_from_disk_ts(from, from->di_ctime); inode->i_ctime = xfs_inode_from_disk_ts(from, from->di_ctime);
to->di_size = be64_to_cpu(from->di_size); ip->i_disk_size = be64_to_cpu(from->di_size);
to->di_nblocks = be64_to_cpu(from->di_nblocks); to->di_nblocks = be64_to_cpu(from->di_nblocks);
to->di_extsize = be32_to_cpu(from->di_extsize); to->di_extsize = be32_to_cpu(from->di_extsize);
to->di_forkoff = from->di_forkoff; to->di_forkoff = from->di_forkoff;
...@@ -305,7 +305,7 @@ xfs_inode_to_disk( ...@@ -305,7 +305,7 @@ xfs_inode_to_disk(
to->di_gen = cpu_to_be32(inode->i_generation); to->di_gen = cpu_to_be32(inode->i_generation);
to->di_mode = cpu_to_be16(inode->i_mode); to->di_mode = cpu_to_be16(inode->i_mode);
to->di_size = cpu_to_be64(from->di_size); to->di_size = cpu_to_be64(ip->i_disk_size);
to->di_nblocks = cpu_to_be64(from->di_nblocks); to->di_nblocks = cpu_to_be64(from->di_nblocks);
to->di_extsize = cpu_to_be32(from->di_extsize); to->di_extsize = cpu_to_be32(from->di_extsize);
to->di_nextents = cpu_to_be32(xfs_ifork_nextents(&ip->i_df)); to->di_nextents = cpu_to_be32(xfs_ifork_nextents(&ip->i_df));
......
...@@ -17,7 +17,6 @@ struct xfs_dinode; ...@@ -17,7 +17,6 @@ struct xfs_dinode;
*/ */
struct xfs_icdinode { struct xfs_icdinode {
uint16_t di_flushiter; /* incremented on flush */ uint16_t di_flushiter; /* incremented on flush */
xfs_fsize_t di_size; /* number of bytes in file */
xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */
xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ xfs_extlen_t di_extsize; /* basic/minimum extent size for file */
uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */ uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */
......
...@@ -242,7 +242,7 @@ xfs_iformat_data_fork( ...@@ -242,7 +242,7 @@ xfs_iformat_data_fork(
case S_IFCHR: case S_IFCHR:
case S_IFBLK: case S_IFBLK:
case S_IFSOCK: case S_IFSOCK:
ip->i_d.di_size = 0; ip->i_disk_size = 0;
inode->i_rdev = xfs_to_linux_dev_t(xfs_dinode_get_rdev(dip)); inode->i_rdev = xfs_to_linux_dev_t(xfs_dinode_get_rdev(dip));
return 0; return 0;
case S_IFREG: case S_IFREG:
......
...@@ -538,7 +538,7 @@ xchk_directory_leaf1_bestfree( ...@@ -538,7 +538,7 @@ xchk_directory_leaf1_bestfree(
* There should be as many bestfree slots as there are dir data * There should be as many bestfree slots as there are dir data
* blocks that can fit under i_size. * blocks that can fit under i_size.
*/ */
if (bestcount != xfs_dir2_byte_to_db(geo, sc->ip->i_d.di_size)) { if (bestcount != xfs_dir2_byte_to_db(geo, sc->ip->i_disk_size)) {
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out; goto out;
} }
...@@ -808,7 +808,7 @@ xchk_directory( ...@@ -808,7 +808,7 @@ xchk_directory(
return -ENOENT; return -ENOENT;
/* Plausible size? */ /* Plausible size? */
if (sc->ip->i_d.di_size < xfs_dir2_sf_hdr_size(0)) { if (sc->ip->i_disk_size < xfs_dir2_sf_hdr_size(0)) {
xchk_ino_set_corrupt(sc, sc->ip->i_ino); xchk_ino_set_corrupt(sc, sc->ip->i_ino);
goto out; goto out;
} }
...@@ -834,7 +834,7 @@ xchk_directory( ...@@ -834,7 +834,7 @@ xchk_directory(
* Userspace usually asks for a 32k buffer, so we will too. * Userspace usually asks for a 32k buffer, so we will too.
*/ */
bufsize = (size_t)min_t(loff_t, XFS_READDIR_BUFSIZE, bufsize = (size_t)min_t(loff_t, XFS_READDIR_BUFSIZE,
sc->ip->i_d.di_size); sc->ip->i_disk_size);
/* /*
* Look up every name in this directory by hash. * Look up every name in this directory by hash.
......
...@@ -102,7 +102,7 @@ xchk_parent_count_parent_dentries( ...@@ -102,7 +102,7 @@ xchk_parent_count_parent_dentries(
* scanned. * scanned.
*/ */
bufsize = (size_t)min_t(loff_t, XFS_READDIR_BUFSIZE, bufsize = (size_t)min_t(loff_t, XFS_READDIR_BUFSIZE,
parent->i_d.di_size); parent->i_disk_size);
oldpos = 0; oldpos = 0;
while (true) { while (true) {
error = xfs_readdir(sc->tp, parent, &spc.dc, bufsize); error = xfs_readdir(sc->tp, parent, &spc.dc, bufsize);
......
...@@ -100,7 +100,7 @@ xchk_rtbitmap( ...@@ -100,7 +100,7 @@ xchk_rtbitmap(
int error; int error;
/* Is the size of the rtbitmap correct? */ /* Is the size of the rtbitmap correct? */
if (sc->mp->m_rbmip->i_d.di_size != if (sc->mp->m_rbmip->i_disk_size !=
XFS_FSB_TO_B(sc->mp, sc->mp->m_sb.sb_rbmblocks)) { XFS_FSB_TO_B(sc->mp, sc->mp->m_sb.sb_rbmblocks)) {
xchk_ino_set_corrupt(sc, sc->mp->m_rbmip->i_ino); xchk_ino_set_corrupt(sc, sc->mp->m_rbmip->i_ino);
return 0; return 0;
......
...@@ -43,7 +43,7 @@ xchk_symlink( ...@@ -43,7 +43,7 @@ xchk_symlink(
if (!S_ISLNK(VFS_I(ip)->i_mode)) if (!S_ISLNK(VFS_I(ip)->i_mode))
return -ENOENT; return -ENOENT;
ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
len = ip->i_d.di_size; len = ip->i_disk_size;
/* Plausible size? */ /* Plausible size? */
if (len > XFS_SYMLINK_MAXLEN || len <= 0) { if (len > XFS_SYMLINK_MAXLEN || len <= 0) {
......
...@@ -36,7 +36,7 @@ XFS_WPC(struct iomap_writepage_ctx *ctx) ...@@ -36,7 +36,7 @@ XFS_WPC(struct iomap_writepage_ctx *ctx)
static inline bool xfs_ioend_is_append(struct iomap_ioend *ioend) static inline bool xfs_ioend_is_append(struct iomap_ioend *ioend)
{ {
return ioend->io_offset + ioend->io_size > return ioend->io_offset + ioend->io_size >
XFS_I(ioend->io_inode)->i_d.di_size; XFS_I(ioend->io_inode)->i_disk_size;
} }
STATIC int STATIC int
...@@ -88,7 +88,7 @@ __xfs_setfilesize( ...@@ -88,7 +88,7 @@ __xfs_setfilesize(
trace_xfs_setfilesize(ip, offset, size); trace_xfs_setfilesize(ip, offset, size);
ip->i_d.di_size = isize; ip->i_disk_size = isize;
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
......
...@@ -423,7 +423,7 @@ xfs_getbmap( ...@@ -423,7 +423,7 @@ xfs_getbmap(
break; break;
case XFS_DATA_FORK: case XFS_DATA_FORK:
if (!(iflags & BMV_IF_DELALLOC) && if (!(iflags & BMV_IF_DELALLOC) &&
(ip->i_delayed_blks || XFS_ISIZE(ip) > ip->i_d.di_size)) { (ip->i_delayed_blks || XFS_ISIZE(ip) > ip->i_disk_size)) {
error = filemap_write_and_wait(VFS_I(ip)->i_mapping); error = filemap_write_and_wait(VFS_I(ip)->i_mapping);
if (error) if (error)
goto out_unlock_iolock; goto out_unlock_iolock;
...@@ -1663,8 +1663,8 @@ xfs_swap_extents( ...@@ -1663,8 +1663,8 @@ xfs_swap_extents(
/* Verify all data are being swapped */ /* Verify all data are being swapped */
if (sxp->sx_offset != 0 || if (sxp->sx_offset != 0 ||
sxp->sx_length != ip->i_d.di_size || sxp->sx_length != ip->i_disk_size ||
sxp->sx_length != tip->i_d.di_size) { sxp->sx_length != tip->i_disk_size) {
error = -EFAULT; error = -EFAULT;
goto out_trans_cancel; goto out_trans_cancel;
} }
......
...@@ -58,7 +58,7 @@ xfs_dir2_sf_getdents( ...@@ -58,7 +58,7 @@ xfs_dir2_sf_getdents(
struct xfs_da_geometry *geo = args->geo; struct xfs_da_geometry *geo = args->geo;
ASSERT(dp->i_df.if_flags & XFS_IFINLINE); ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
ASSERT(dp->i_df.if_u1.if_data != NULL); ASSERT(dp->i_df.if_u1.if_data != NULL);
sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
......
...@@ -1244,7 +1244,7 @@ xfs_file_readdir( ...@@ -1244,7 +1244,7 @@ xfs_file_readdir(
* point we can change the ->readdir prototype to include the * point we can change the ->readdir prototype to include the
* buffer size. For now we use the current glibc buffer size. * buffer size. For now we use the current glibc buffer size.
*/ */
bufsize = (size_t)min_t(loff_t, XFS_READDIR_BUFSIZE, ip->i_d.di_size); bufsize = (size_t)min_t(loff_t, XFS_READDIR_BUFSIZE, ip->i_disk_size);
return xfs_readdir(NULL, ip, ctx, bufsize); return xfs_readdir(NULL, ip, ctx, bufsize);
} }
......
...@@ -830,7 +830,7 @@ xfs_init_new_inode( ...@@ -830,7 +830,7 @@ xfs_init_new_inode(
!in_group_p(i_gid_into_mnt(mnt_userns, inode))) !in_group_p(i_gid_into_mnt(mnt_userns, inode)))
inode->i_mode &= ~S_ISGID; inode->i_mode &= ~S_ISGID;
ip->i_d.di_size = 0; ip->i_disk_size = 0;
ip->i_df.if_nextents = 0; ip->i_df.if_nextents = 0;
ASSERT(ip->i_d.di_nblocks == 0); ASSERT(ip->i_d.di_nblocks == 0);
...@@ -1558,7 +1558,7 @@ xfs_inactive_truncate( ...@@ -1558,7 +1558,7 @@ xfs_inactive_truncate(
* of a system crash before the truncate completes. See the related * of a system crash before the truncate completes. See the related
* comment in xfs_vn_setattr_size() for details. * comment in xfs_vn_setattr_size() for details.
*/ */
ip->i_d.di_size = 0; ip->i_disk_size = 0;
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, 0); error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, 0);
...@@ -1737,7 +1737,7 @@ xfs_inactive( ...@@ -1737,7 +1737,7 @@ xfs_inactive(
} }
if (S_ISREG(VFS_I(ip)->i_mode) && if (S_ISREG(VFS_I(ip)->i_mode) &&
(ip->i_d.di_size != 0 || XFS_ISIZE(ip) != 0 || (ip->i_disk_size != 0 || XFS_ISIZE(ip) != 0 ||
ip->i_df.if_nextents > 0 || ip->i_delayed_blks > 0)) ip->i_df.if_nextents > 0 || ip->i_delayed_blks > 0))
truncate = 1; truncate = 1;
...@@ -2585,7 +2585,7 @@ xfs_ifree( ...@@ -2585,7 +2585,7 @@ xfs_ifree(
ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
ASSERT(VFS_I(ip)->i_nlink == 0); ASSERT(VFS_I(ip)->i_nlink == 0);
ASSERT(ip->i_df.if_nextents == 0); ASSERT(ip->i_df.if_nextents == 0);
ASSERT(ip->i_d.di_size == 0 || !S_ISREG(VFS_I(ip)->i_mode)); ASSERT(ip->i_disk_size == 0 || !S_ISREG(VFS_I(ip)->i_mode));
ASSERT(ip->i_d.di_nblocks == 0); ASSERT(ip->i_d.di_nblocks == 0);
/* /*
......
...@@ -54,6 +54,7 @@ typedef struct xfs_inode { ...@@ -54,6 +54,7 @@ typedef struct xfs_inode {
/* Miscellaneous state. */ /* Miscellaneous state. */
unsigned long i_flags; /* see defined flags below */ unsigned long i_flags; /* see defined flags below */
uint64_t i_delayed_blks; /* count of delay alloc blks */ uint64_t i_delayed_blks; /* count of delay alloc blks */
xfs_fsize_t i_disk_size; /* number of bytes in file */
prid_t i_projid; /* owner's project id */ prid_t i_projid; /* owner's project id */
struct xfs_icdinode i_d; /* most of ondisk inode */ struct xfs_icdinode i_d; /* most of ondisk inode */
...@@ -88,7 +89,7 @@ static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip) ...@@ -88,7 +89,7 @@ static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip)
{ {
if (S_ISREG(VFS_I(ip)->i_mode)) if (S_ISREG(VFS_I(ip)->i_mode))
return i_size_read(VFS_I(ip)); return i_size_read(VFS_I(ip));
return ip->i_d.di_size; return ip->i_disk_size;
} }
/* /*
...@@ -102,7 +103,7 @@ xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size) ...@@ -102,7 +103,7 @@ xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size)
if (new_size > i_size || new_size < 0) if (new_size > i_size || new_size < 0)
new_size = i_size; new_size = i_size;
return new_size > ip->i_d.di_size ? new_size : 0; return new_size > ip->i_disk_size ? new_size : 0;
} }
/* /*
......
...@@ -196,7 +196,7 @@ xfs_inode_item_format_data_fork( ...@@ -196,7 +196,7 @@ xfs_inode_item_format_data_fork(
*/ */
data_bytes = roundup(ip->i_df.if_bytes, 4); data_bytes = roundup(ip->i_df.if_bytes, 4);
ASSERT(ip->i_df.if_u1.if_data != NULL); ASSERT(ip->i_df.if_u1.if_data != NULL);
ASSERT(ip->i_d.di_size > 0); ASSERT(ip->i_disk_size > 0);
xlog_copy_iovec(lv, vecp, XLOG_REG_TYPE_ILOCAL, xlog_copy_iovec(lv, vecp, XLOG_REG_TYPE_ILOCAL,
ip->i_df.if_u1.if_data, data_bytes); ip->i_df.if_u1.if_data, data_bytes);
ilf->ilf_dsize = (unsigned)data_bytes; ilf->ilf_dsize = (unsigned)data_bytes;
...@@ -369,7 +369,7 @@ xfs_inode_to_log_dinode( ...@@ -369,7 +369,7 @@ xfs_inode_to_log_dinode(
to->di_gen = inode->i_generation; to->di_gen = inode->i_generation;
to->di_mode = inode->i_mode; to->di_mode = inode->i_mode;
to->di_size = from->di_size; to->di_size = ip->i_disk_size;
to->di_nblocks = from->di_nblocks; to->di_nblocks = from->di_nblocks;
to->di_extsize = from->di_extsize; to->di_extsize = from->di_extsize;
to->di_nextents = xfs_ifork_nextents(&ip->i_df); to->di_nextents = xfs_ifork_nextents(&ip->i_df);
......
...@@ -573,7 +573,7 @@ xfs_iomap_write_unwritten( ...@@ -573,7 +573,7 @@ xfs_iomap_write_unwritten(
i_size_write(inode, i_size); i_size_write(inode, i_size);
i_size = xfs_new_eof(ip, i_size); i_size = xfs_new_eof(ip, i_size);
if (i_size) { if (i_size) {
ip->i_d.di_size = i_size; ip->i_disk_size = i_size;
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
} }
......
...@@ -949,8 +949,8 @@ xfs_setattr_size( ...@@ -949,8 +949,8 @@ xfs_setattr_size(
* operation. * operation.
* *
* And we update in-core i_size and truncate page cache beyond newsize * And we update in-core i_size and truncate page cache beyond newsize
* before writeback the [di_size, newsize] range, so we're guaranteed * before writeback the [i_disk_size, newsize] range, so we're
* not to write stale data past the new EOF on truncate down. * guaranteed not to write stale data past the new EOF on truncate down.
*/ */
truncate_setsize(inode, newsize); truncate_setsize(inode, newsize);
...@@ -963,9 +963,9 @@ xfs_setattr_size( ...@@ -963,9 +963,9 @@ xfs_setattr_size(
* otherwise those blocks may not be zeroed after a crash. * otherwise those blocks may not be zeroed after a crash.
*/ */
if (did_zeroing || if (did_zeroing ||
(newsize > ip->i_d.di_size && oldsize != ip->i_d.di_size)) { (newsize > ip->i_disk_size && oldsize != ip->i_disk_size)) {
error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping,
ip->i_d.di_size, newsize - 1); ip->i_disk_size, newsize - 1);
if (error) if (error)
return error; return error;
} }
...@@ -1007,7 +1007,7 @@ xfs_setattr_size( ...@@ -1007,7 +1007,7 @@ xfs_setattr_size(
* permanent before actually freeing any blocks it doesn't matter if * permanent before actually freeing any blocks it doesn't matter if
* they get written to. * they get written to.
*/ */
ip->i_d.di_size = newsize; ip->i_disk_size = newsize;
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
if (newsize <= oldsize) { if (newsize <= oldsize) {
...@@ -1344,7 +1344,7 @@ xfs_setup_inode( ...@@ -1344,7 +1344,7 @@ xfs_setup_inode(
/* make the inode look hashed for the writeback code */ /* make the inode look hashed for the writeback code */
inode_fake_hash(inode); inode_fake_hash(inode);
i_size_write(inode, ip->i_d.di_size); i_size_write(inode, ip->i_disk_size);
xfs_diflags_to_iflags(ip, true); xfs_diflags_to_iflags(ip, true);
if (S_ISDIR(inode->i_mode)) { if (S_ISDIR(inode->i_mode)) {
......
...@@ -90,7 +90,7 @@ xfs_bulkstat_one_int( ...@@ -90,7 +90,7 @@ xfs_bulkstat_one_int(
buf->bs_ino = ino; buf->bs_ino = ino;
buf->bs_uid = from_kuid(sb_userns, i_uid_into_mnt(mnt_userns, inode)); buf->bs_uid = from_kuid(sb_userns, i_uid_into_mnt(mnt_userns, inode));
buf->bs_gid = from_kgid(sb_userns, i_gid_into_mnt(mnt_userns, inode)); buf->bs_gid = from_kgid(sb_userns, i_gid_into_mnt(mnt_userns, inode));
buf->bs_size = dic->di_size; buf->bs_size = ip->i_disk_size;
buf->bs_nlink = inode->i_nlink; buf->bs_nlink = inode->i_nlink;
buf->bs_atime = inode->i_atime.tv_sec; buf->bs_atime = inode->i_atime.tv_sec;
......
...@@ -286,7 +286,7 @@ xfs_fs_commit_blocks( ...@@ -286,7 +286,7 @@ xfs_fs_commit_blocks(
xfs_setattr_time(ip, iattr); xfs_setattr_time(ip, iattr);
if (update_isize) { if (update_isize) {
i_size_write(inode, iattr->ia_size); i_size_write(inode, iattr->ia_size);
ip->i_d.di_size = iattr->ia_size; ip->i_disk_size = iattr->ia_size;
} }
xfs_trans_set_sync(tp); xfs_trans_set_sync(tp);
......
...@@ -293,7 +293,7 @@ xfs_qm_scall_trunc_qfile( ...@@ -293,7 +293,7 @@ xfs_qm_scall_trunc_qfile(
xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_ilock(ip, XFS_ILOCK_EXCL);
xfs_trans_ijoin(tp, ip, 0); xfs_trans_ijoin(tp, ip, 0);
ip->i_d.di_size = 0; ip->i_disk_size = 0;
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, 0); error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, 0);
......
...@@ -930,7 +930,7 @@ xfs_reflink_update_dest( ...@@ -930,7 +930,7 @@ xfs_reflink_update_dest(
if (newlen > i_size_read(VFS_I(dest))) { if (newlen > i_size_read(VFS_I(dest))) {
trace_xfs_reflink_update_inode_size(dest, newlen); trace_xfs_reflink_update_inode_size(dest, newlen);
i_size_write(VFS_I(dest), newlen); i_size_write(VFS_I(dest), newlen);
dest->i_d.di_size = newlen; dest->i_disk_size = newlen;
} }
if (cowextsize) { if (cowextsize) {
...@@ -1156,7 +1156,7 @@ xfs_reflink_remap_extent( ...@@ -1156,7 +1156,7 @@ xfs_reflink_remap_extent(
if (newlen > i_size_read(VFS_I(ip))) { if (newlen > i_size_read(VFS_I(ip))) {
trace_xfs_reflink_update_inode_size(ip, newlen); trace_xfs_reflink_update_inode_size(ip, newlen);
i_size_write(VFS_I(ip), newlen); i_size_write(VFS_I(ip), newlen);
ip->i_d.di_size = newlen; ip->i_disk_size = newlen;
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
} }
......
...@@ -966,8 +966,8 @@ xfs_growfs_rt( ...@@ -966,8 +966,8 @@ xfs_growfs_rt(
* Get the old block counts for bitmap and summary inodes. * Get the old block counts for bitmap and summary inodes.
* These can't change since other growfs callers are locked out. * These can't change since other growfs callers are locked out.
*/ */
rbmblocks = XFS_B_TO_FSB(mp, mp->m_rbmip->i_d.di_size); rbmblocks = XFS_B_TO_FSB(mp, mp->m_rbmip->i_disk_size);
rsumblocks = XFS_B_TO_FSB(mp, mp->m_rsumip->i_d.di_size); rsumblocks = XFS_B_TO_FSB(mp, mp->m_rsumip->i_disk_size);
/* /*
* Allocate space to the bitmap and summary files, as necessary. * Allocate space to the bitmap and summary files, as necessary.
*/ */
...@@ -1036,9 +1036,9 @@ xfs_growfs_rt( ...@@ -1036,9 +1036,9 @@ xfs_growfs_rt(
* to update the incore size so that inode inactivation won't * to update the incore size so that inode inactivation won't
* punch what it thinks are "posteof" blocks. * punch what it thinks are "posteof" blocks.
*/ */
mp->m_rbmip->i_d.di_size = mp->m_rbmip->i_disk_size =
nsbp->sb_rbmblocks * nsbp->sb_blocksize; nsbp->sb_rbmblocks * nsbp->sb_blocksize;
i_size_write(VFS_I(mp->m_rbmip), mp->m_rbmip->i_d.di_size); i_size_write(VFS_I(mp->m_rbmip), mp->m_rbmip->i_disk_size);
xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE);
/* /*
* Get the summary inode into the transaction. * Get the summary inode into the transaction.
...@@ -1050,8 +1050,8 @@ xfs_growfs_rt( ...@@ -1050,8 +1050,8 @@ xfs_growfs_rt(
* incore size so that inode inactivation won't punch what it * incore size so that inode inactivation won't punch what it
* thinks are "posteof" blocks. * thinks are "posteof" blocks.
*/ */
mp->m_rsumip->i_d.di_size = nmp->m_rsumsize; mp->m_rsumip->i_disk_size = nmp->m_rsumsize;
i_size_write(VFS_I(mp->m_rsumip), mp->m_rsumip->i_d.di_size); i_size_write(VFS_I(mp->m_rsumip), mp->m_rsumip->i_disk_size);
xfs_trans_log_inode(tp, mp->m_rsumip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, mp->m_rsumip, XFS_ILOG_CORE);
/* /*
* Copy summary data from old to new sizes. * Copy summary data from old to new sizes.
......
...@@ -33,7 +33,7 @@ xfs_readlink_bmap_ilocked( ...@@ -33,7 +33,7 @@ xfs_readlink_bmap_ilocked(
struct xfs_buf *bp; struct xfs_buf *bp;
xfs_daddr_t d; xfs_daddr_t d;
char *cur_chunk; char *cur_chunk;
int pathlen = ip->i_d.di_size; int pathlen = ip->i_disk_size;
int nmaps = XFS_SYMLINK_MAPS; int nmaps = XFS_SYMLINK_MAPS;
int byte_cnt; int byte_cnt;
int n; int n;
...@@ -86,7 +86,7 @@ xfs_readlink_bmap_ilocked( ...@@ -86,7 +86,7 @@ xfs_readlink_bmap_ilocked(
} }
ASSERT(pathlen == 0); ASSERT(pathlen == 0);
link[ip->i_d.di_size] = '\0'; link[ip->i_disk_size] = '\0';
error = 0; error = 0;
out: out:
...@@ -111,7 +111,7 @@ xfs_readlink( ...@@ -111,7 +111,7 @@ xfs_readlink(
xfs_ilock(ip, XFS_ILOCK_SHARED); xfs_ilock(ip, XFS_ILOCK_SHARED);
pathlen = ip->i_d.di_size; pathlen = ip->i_disk_size;
if (!pathlen) if (!pathlen)
goto out; goto out;
...@@ -250,7 +250,7 @@ xfs_symlink( ...@@ -250,7 +250,7 @@ xfs_symlink(
if (pathlen <= XFS_IFORK_DSIZE(ip)) { if (pathlen <= XFS_IFORK_DSIZE(ip)) {
xfs_init_local_fork(ip, XFS_DATA_FORK, target_path, pathlen); xfs_init_local_fork(ip, XFS_DATA_FORK, target_path, pathlen);
ip->i_d.di_size = pathlen; ip->i_disk_size = pathlen;
ip->i_df.if_format = XFS_DINODE_FMT_LOCAL; ip->i_df.if_format = XFS_DINODE_FMT_LOCAL;
xfs_trans_log_inode(tp, ip, XFS_ILOG_DDATA | XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_DDATA | XFS_ILOG_CORE);
} else { } else {
...@@ -265,7 +265,7 @@ xfs_symlink( ...@@ -265,7 +265,7 @@ xfs_symlink(
goto out_trans_cancel; goto out_trans_cancel;
resblks -= fs_blocks; resblks -= fs_blocks;
ip->i_d.di_size = pathlen; ip->i_disk_size = pathlen;
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
cur_chunk = target_path; cur_chunk = target_path;
...@@ -300,7 +300,7 @@ xfs_symlink( ...@@ -300,7 +300,7 @@ xfs_symlink(
} }
ASSERT(pathlen == 0); ASSERT(pathlen == 0);
} }
i_size_write(VFS_I(ip), ip->i_d.di_size); i_size_write(VFS_I(ip), ip->i_disk_size);
/* /*
* Create the directory entry for the symlink. * Create the directory entry for the symlink.
...@@ -400,8 +400,8 @@ xfs_inactive_symlink_rmt( ...@@ -400,8 +400,8 @@ xfs_inactive_symlink_rmt(
* locked for the second transaction. In the error paths we need it * locked for the second transaction. In the error paths we need it
* held so the cancel won't rele it, see below. * held so the cancel won't rele it, see below.
*/ */
size = (int)ip->i_d.di_size; size = (int)ip->i_disk_size;
ip->i_d.di_size = 0; ip->i_disk_size = 0;
VFS_I(ip)->i_mode = (VFS_I(ip)->i_mode & ~S_IFMT) | S_IFREG; VFS_I(ip)->i_mode = (VFS_I(ip)->i_mode & ~S_IFMT) | S_IFREG;
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
/* /*
...@@ -477,7 +477,7 @@ xfs_inactive_symlink( ...@@ -477,7 +477,7 @@ xfs_inactive_symlink(
return -EIO; return -EIO;
xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_ilock(ip, XFS_ILOCK_EXCL);
pathlen = (int)ip->i_d.di_size; pathlen = (int)ip->i_disk_size;
ASSERT(pathlen); ASSERT(pathlen);
if (pathlen <= 0 || pathlen > XFS_SYMLINK_MAXLEN) { if (pathlen <= 0 || pathlen > XFS_SYMLINK_MAXLEN) {
......
...@@ -1298,7 +1298,7 @@ DECLARE_EVENT_CLASS(xfs_file_class, ...@@ -1298,7 +1298,7 @@ DECLARE_EVENT_CLASS(xfs_file_class,
TP_fast_assign( TP_fast_assign(
__entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev; __entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
__entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino; __entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino;
__entry->size = XFS_I(file_inode(iocb->ki_filp))->i_d.di_size; __entry->size = XFS_I(file_inode(iocb->ki_filp))->i_disk_size;
__entry->offset = iocb->ki_pos; __entry->offset = iocb->ki_pos;
__entry->count = iov_iter_count(iter); __entry->count = iov_iter_count(iter);
), ),
...@@ -1341,7 +1341,7 @@ DECLARE_EVENT_CLASS(xfs_imap_class, ...@@ -1341,7 +1341,7 @@ DECLARE_EVENT_CLASS(xfs_imap_class,
TP_fast_assign( TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev; __entry->dev = VFS_I(ip)->i_sb->s_dev;
__entry->ino = ip->i_ino; __entry->ino = ip->i_ino;
__entry->size = ip->i_d.di_size; __entry->size = ip->i_disk_size;
__entry->offset = offset; __entry->offset = offset;
__entry->count = count; __entry->count = count;
__entry->whichfork = whichfork; __entry->whichfork = whichfork;
...@@ -1387,7 +1387,7 @@ DECLARE_EVENT_CLASS(xfs_simple_io_class, ...@@ -1387,7 +1387,7 @@ DECLARE_EVENT_CLASS(xfs_simple_io_class,
__entry->dev = VFS_I(ip)->i_sb->s_dev; __entry->dev = VFS_I(ip)->i_sb->s_dev;
__entry->ino = ip->i_ino; __entry->ino = ip->i_ino;
__entry->isize = VFS_I(ip)->i_size; __entry->isize = VFS_I(ip)->i_size;
__entry->disize = ip->i_d.di_size; __entry->disize = ip->i_disk_size;
__entry->offset = offset; __entry->offset = offset;
__entry->count = count; __entry->count = count;
), ),
...@@ -1425,7 +1425,7 @@ DECLARE_EVENT_CLASS(xfs_itrunc_class, ...@@ -1425,7 +1425,7 @@ DECLARE_EVENT_CLASS(xfs_itrunc_class,
TP_fast_assign( TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev; __entry->dev = VFS_I(ip)->i_sb->s_dev;
__entry->ino = ip->i_ino; __entry->ino = ip->i_ino;
__entry->size = ip->i_d.di_size; __entry->size = ip->i_disk_size;
__entry->new_size = new_size; __entry->new_size = new_size;
), ),
TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx", TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
...@@ -1455,7 +1455,7 @@ TRACE_EVENT(xfs_pagecache_inval, ...@@ -1455,7 +1455,7 @@ TRACE_EVENT(xfs_pagecache_inval,
TP_fast_assign( TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev; __entry->dev = VFS_I(ip)->i_sb->s_dev;
__entry->ino = ip->i_ino; __entry->ino = ip->i_ino;
__entry->size = ip->i_d.di_size; __entry->size = ip->i_disk_size;
__entry->start = start; __entry->start = start;
__entry->finish = finish; __entry->finish = finish;
), ),
...@@ -1483,7 +1483,7 @@ TRACE_EVENT(xfs_bunmap, ...@@ -1483,7 +1483,7 @@ TRACE_EVENT(xfs_bunmap,
TP_fast_assign( TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev; __entry->dev = VFS_I(ip)->i_sb->s_dev;
__entry->ino = ip->i_ino; __entry->ino = ip->i_ino;
__entry->size = ip->i_d.di_size; __entry->size = ip->i_disk_size;
__entry->bno = bno; __entry->bno = bno;
__entry->len = len; __entry->len = len;
__entry->caller_ip = caller_ip; __entry->caller_ip = caller_ip;
...@@ -3145,12 +3145,12 @@ DECLARE_EVENT_CLASS(xfs_double_io_class, ...@@ -3145,12 +3145,12 @@ DECLARE_EVENT_CLASS(xfs_double_io_class,
__entry->dev = VFS_I(src)->i_sb->s_dev; __entry->dev = VFS_I(src)->i_sb->s_dev;
__entry->src_ino = src->i_ino; __entry->src_ino = src->i_ino;
__entry->src_isize = VFS_I(src)->i_size; __entry->src_isize = VFS_I(src)->i_size;
__entry->src_disize = src->i_d.di_size; __entry->src_disize = src->i_disk_size;
__entry->src_offset = soffset; __entry->src_offset = soffset;
__entry->len = len; __entry->len = len;
__entry->dest_ino = dest->i_ino; __entry->dest_ino = dest->i_ino;
__entry->dest_isize = VFS_I(dest)->i_size; __entry->dest_isize = VFS_I(dest)->i_size;
__entry->dest_disize = dest->i_d.di_size; __entry->dest_disize = dest->i_disk_size;
__entry->dest_offset = doffset; __entry->dest_offset = doffset;
), ),
TP_printk("dev %d:%d count %zd " TP_printk("dev %d:%d count %zd "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment