]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: move the di_size field to struct xfs_inode
authorChristoph Hellwig <hch@lst.de>
Wed, 30 Jun 2021 22:32:42 +0000 (18:32 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 30 Jun 2021 22:32:42 +0000 (18:32 -0400)
Source kernel commit: 13d2c10b05d8e67cb9b4c2d1d4a09a906148a72e

In preparation of removing the historic icinode struct, move the on-disk
size 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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
13 files changed:
include/xfs_inode.h
libxfs/util.c
libxfs/xfs_bmap.c
libxfs/xfs_dir2.c
libxfs/xfs_dir2_block.c
libxfs/xfs_dir2_leaf.c
libxfs/xfs_dir2_node.c
libxfs/xfs_dir2_sf.c
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h
libxfs/xfs_inode_fork.c
mkfs/proto.c
repair/phase6.c

index 5b86932c9b3f2cb6d4ffcfa8fab739707a3a65ad..477a2972c259665fb9213164045ea075d4204cdb 100644 (file)
@@ -78,6 +78,7 @@ typedef struct xfs_inode {
        struct xfs_ifork        i_df;           /* data fork */
        struct xfs_inode_log_item *i_itemp;     /* logging information */
        unsigned int            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 */
        struct xfs_icdinode     i_d;            /* most of ondisk inode */
 
@@ -128,7 +129,7 @@ static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip)
 {
        if (XFS_ISREG(ip))
                return ip->i_size;
-       return ip->i_d.di_size;
+       return ip->i_disk_size;
 }
 #define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)
 
index c3fddbb2696eb21eeb07022dd2f998bd14f998bb..03e66661ca4188c48578ba3e735e17212da5aebf 100644 (file)
@@ -276,7 +276,7 @@ libxfs_init_new_inode(
                        VFS_I(ip)->i_mode |= S_ISGID;
        }
 
-       ip->i_d.di_size = 0;
+       ip->i_disk_size = 0;
        ip->i_df.if_nextents = 0;
        ASSERT(ip->i_d.di_nblocks == 0);
        ip->i_d.di_extsize = pip ? 0 : fsx->fsx_extsize;
index 29c4be77763df9e25e04090827fcedf5017147ab..7d4b8603b62d9dbc6074cd878a1f83407a581010 100644 (file)
@@ -1433,7 +1433,7 @@ xfs_bmap_last_offset(
 
 /*
  * 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.
  */
 int                                    /* 1=>1 block, 0=>otherwise */
index 79196788379fc65262b0cd3032a40233cd00f92d..dff874398b93fc30e5c10c5b44eab0dd159271e0 100644 (file)
@@ -178,9 +178,9 @@ xfs_dir_isempty(
        xfs_dir2_sf_hdr_t       *sfp;
 
        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;
-       if (dp->i_d.di_size > XFS_IFORK_DSIZE(dp))
+       if (dp->i_disk_size > XFS_IFORK_DSIZE(dp))
                return 0;
        sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
        return !sfp->count;
@@ -583,8 +583,8 @@ xfs_dir2_grow_inode(
                xfs_fsize_t     size;           /* directory file (data) size */
 
                size = XFS_FSB_TO_B(mp, bno + count);
-               if (size > dp->i_d.di_size) {
-                       dp->i_d.di_size = size;
+               if (size > dp->i_disk_size) {
+                       dp->i_disk_size = size;
                        xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE);
                }
        }
@@ -607,7 +607,7 @@ xfs_dir2_isblock(
        rval = XFS_FSB_TO_B(args->dp->i_mount, last) == args->geo->blksize;
        if (XFS_IS_CORRUPT(args->dp->i_mount,
                           rval != 0 &&
-                          args->dp->i_d.di_size != args->geo->blksize))
+                          args->dp->i_disk_size != args->geo->blksize))
                return -EFSCORRUPTED;
        *vp = rval;
        return 0;
@@ -686,7 +686,7 @@ xfs_dir2_shrink_inode(
        /*
         * 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;
        bno = da;
        if ((error = xfs_bmap_last_before(tp, dp, &bno, XFS_DATA_FORK))) {
@@ -702,7 +702,7 @@ xfs_dir2_shrink_inode(
        /*
         * 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);
        return 0;
 }
index eaa2b47a8eb98dab44307e2731dc1710c4ec4569..c5f8dbc1c6c7707a4b69b7e558f60b04d70a4fa2 100644 (file)
@@ -958,7 +958,7 @@ xfs_dir2_leaf_to_block(
         * been left behind during no-space-reservation operations.
         * 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;
 
                hdrsz = args->geo->data_entry_offset;
@@ -1094,13 +1094,13 @@ xfs_dir2_sf_to_block(
        trace_xfs_dir2_sf_to_block(args);
 
        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;
 
-       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(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);
 
        /*
@@ -1112,7 +1112,7 @@ xfs_dir2_sf_to_block(
 
        xfs_idata_realloc(dp, -ifp->if_bytes, 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.
index 2eddb9b900a2c533e7ecafb6ea12b3f8c535a5f3..e25ee46e72a554230476a8f5ee43329a9695a7ae 100644 (file)
@@ -150,7 +150,7 @@ xfs_dir3_leaf_check_int(
        /*
         * XXX (dgc): This value is not restrictive enough.
         * 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)
                return __this_address;
index 4dc983c3744e1c2fcd48f7e00f22a314f5f3b64b..3c2653e97cd205e23669c6c9d55b77b2899ffd3b 100644 (file)
@@ -438,7 +438,7 @@ xfs_dir2_leaf_to_node(
        leaf = lbp->b_addr;
        ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
        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);
                return -EFSCORRUPTED;
        }
index e5a8e0c8cf2e4ecbb44b2f8a6a0df2ba8908ac8e..5d905ad478c707abc5b8ea1e8171af6db8f1dde7 100644 (file)
@@ -344,7 +344,7 @@ xfs_dir2_block_to_sf(
        ASSERT(dp->i_df.if_bytes == 0);
        xfs_init_local_fork(dp, XFS_DATA_FORK, sfp, size);
        dp->i_df.if_format = XFS_DINODE_FMT_LOCAL;
-       dp->i_d.di_size = size;
+       dp->i_disk_size = size;
 
        logflags |= XFS_ILOG_DDATA;
        xfs_dir2_sf_check(args);
@@ -367,7 +367,7 @@ xfs_dir2_sf_addname(
        xfs_inode_t             *dp;            /* incore directory inode */
        int                     error;          /* error return value */
        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 */
        xfs_dir2_data_aoff_t    offset = 0;     /* offset for new entry */
        int                     pick;           /* which algorithm to use */
@@ -379,11 +379,11 @@ xfs_dir2_sf_addname(
        ASSERT(xfs_dir2_sf_lookup(args) == -ENOENT);
        dp = args->dp;
        ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
-       ASSERT(dp->i_d.di_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
-       ASSERT(dp->i_df.if_bytes == dp->i_d.di_size);
+       ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
+       ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
        ASSERT(dp->i_df.if_u1.if_data != NULL);
        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.
         */
@@ -401,7 +401,7 @@ xfs_dir2_sf_addname(
                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),
         * or the pick routine says it won't (due to offset values).
@@ -492,7 +492,7 @@ xfs_dir2_sf_addname_easy(
        sfp->count++;
        if (args->inumber > XFS_DIR2_MAX_SHORT_INUM)
                sfp->i8count++;
-       dp->i_d.di_size = new_isize;
+       dp->i_disk_size = new_isize;
        xfs_dir2_sf_check(args);
 }
 
@@ -519,7 +519,7 @@ xfs_dir2_sf_addname_hard(
        int                     nbytes;         /* temp for byte copies */
        xfs_dir2_data_aoff_t    new_offset;     /* next 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_hdr_t       *oldsfp;        /* original shortform dir */
        xfs_dir2_sf_entry_t     *sfep;          /* entry in new dir */
@@ -529,7 +529,7 @@ xfs_dir2_sf_addname_hard(
         * Copy the old directory to the stack buffer.
         */
        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);
        oldsfp = (xfs_dir2_sf_hdr_t *)buf;
        memcpy(oldsfp, sfp, old_isize);
@@ -586,7 +586,7 @@ xfs_dir2_sf_addname_hard(
                memcpy(sfep, oldsfep, old_isize - nbytes);
        }
        kmem_free(buf);
-       dp->i_d.di_size = new_isize;
+       dp->i_disk_size = new_isize;
        xfs_dir2_sf_check(args);
 }
 
@@ -697,7 +697,7 @@ xfs_dir2_sf_check(
                ASSERT(xfs_dir2_sf_get_ftype(mp, sfep) < XFS_DIR3_FT_MAX);
        }
        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 +
               (sfp->count + 2) * (uint)sizeof(xfs_dir2_leaf_entry_t) +
               (uint)sizeof(xfs_dir2_block_tail_t) <= args->geo->blksize);
@@ -821,7 +821,7 @@ xfs_dir2_sf_create(
        dp = args->dp;
 
        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,
         * convert it to local format.
@@ -850,7 +850,7 @@ xfs_dir2_sf_create(
         */
        xfs_dir2_sf_put_parent_ino(sfp, pino);
        sfp->count = 0;
-       dp->i_d.di_size = size;
+       dp->i_disk_size = size;
        xfs_dir2_sf_check(args);
        xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
        return 0;
@@ -878,11 +878,11 @@ xfs_dir2_sf_lookup(
        xfs_dir2_sf_check(args);
 
        ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
-       ASSERT(dp->i_d.di_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
-       ASSERT(dp->i_df.if_bytes == dp->i_d.di_size);
+       ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
+       ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
        ASSERT(dp->i_df.if_u1.if_data != NULL);
        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 .
         */
@@ -955,7 +955,7 @@ xfs_dir2_sf_removename(
        trace_xfs_dir2_sf_removename(args);
 
        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(dp->i_df.if_bytes == oldsize);
        ASSERT(dp->i_df.if_u1.if_data != NULL);
@@ -995,7 +995,7 @@ xfs_dir2_sf_removename(
         * Fix up the header and file size.
         */
        sfp->count--;
-       dp->i_d.di_size = newsize;
+       dp->i_disk_size = newsize;
        /*
         * Reallocate, making it smaller.
         */
@@ -1054,11 +1054,11 @@ xfs_dir2_sf_replace(
        trace_xfs_dir2_sf_replace(args);
 
        ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
-       ASSERT(dp->i_d.di_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
-       ASSERT(dp->i_df.if_bytes == dp->i_d.di_size);
+       ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
+       ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
        ASSERT(dp->i_df.if_u1.if_data != NULL);
        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.
@@ -1219,7 +1219,7 @@ xfs_dir2_sf_toino4(
         * Clean up the inode.
         */
        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);
 }
 
@@ -1292,6 +1292,6 @@ xfs_dir2_sf_toino8(
         * Clean up the inode.
         */
        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);
 }
index 0ae2b61bd62602f2f209505b68ba99658ef80288..62b45e128ef207131f41e30623573a956fbd5956 100644 (file)
@@ -223,7 +223,7 @@ xfs_inode_from_disk(
        inode->i_mtime = xfs_inode_from_disk_ts(from, from->di_mtime);
        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_extsize = be32_to_cpu(from->di_extsize);
        to->di_forkoff = from->di_forkoff;
@@ -302,7 +302,7 @@ xfs_inode_to_disk(
        to->di_gen = cpu_to_be32(inode->i_generation);
        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_extsize = cpu_to_be32(from->di_extsize);
        to->di_nextents = cpu_to_be32(xfs_ifork_nextents(&ip->i_df));
index 406f667992883f7978df8c93af82141d2407015b..c93ed0bc5735e0a403f585e0dc332288a3263398 100644 (file)
@@ -17,7 +17,6 @@ struct xfs_dinode;
  */
 struct xfs_icdinode {
        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_extlen_t    di_extsize;     /* basic/minimum extent size for file */
        uint8_t         di_forkoff;     /* attr fork offs, <<3 for 64b align */
index 731c5109bae5bd64585aa82913819517dc17306e..a84fe7a19d140ff6b9c90b6b3059ce3dc4f6773b 100644 (file)
@@ -240,7 +240,7 @@ xfs_iformat_data_fork(
        case S_IFCHR:
        case S_IFBLK:
        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));
                return 0;
        case S_IFREG:
index e1cf08d1761cc952390319d3597f0f0f5cdc27b9..d9f84cb9342a8d193db2df235ea095224dbfc392 100644 (file)
@@ -281,7 +281,7 @@ newfile(
                        libxfs_buf_relse(bp);
                }
        }
-       ip->i_d.di_size = len;
+       ip->i_disk_size = len;
        return flags;
 }
 
@@ -651,7 +651,7 @@ rtinit(
         * commit the transaction in which rbmip was allocated.
         */
        mp->m_sb.sb_rbmino = rbmip->i_ino;
-       rbmip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize;
+       rbmip->i_disk_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize;
        rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM;
        *(uint64_t *)&VFS_I(rbmip)->i_atime = 0;
        libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE);
@@ -663,7 +663,7 @@ rtinit(
                fail(_("Realtime summary inode allocation failed"), error);
        }
        mp->m_sb.sb_rsumino = rsumip->i_ino;
-       rsumip->i_d.di_size = mp->m_rsumsize;
+       rsumip->i_disk_size = mp->m_rsumsize;
        libxfs_trans_log_inode(tp, rsumip, XFS_ILOG_CORE);
        libxfs_log_sb(tp);
        error = -libxfs_trans_commit(tp);
index 6526a0be88cbad495da1f59cc339aa042d9f05c1..648d3984297666865171d4eaa86dab8d2b3e9a7a 100644 (file)
@@ -442,6 +442,7 @@ reset_inode_fields(struct xfs_inode *ip)
 {
        memset(&ip->i_d, 0, sizeof(ip->i_d));
        ip->i_projid = 0;
+       ip->i_disk_size = 0;
 }
 
 static void
@@ -496,7 +497,7 @@ mk_rbmino(xfs_mount_t *mp)
        ip->i_df.if_bytes = 0;
        ip->i_df.if_u1.if_root = NULL;
 
-       ip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize;
+       ip->i_disk_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize;
 
        /*
         * commit changes
@@ -737,7 +738,7 @@ mk_rsumino(xfs_mount_t *mp)
        ip->i_df.if_bytes = 0;
        ip->i_df.if_u1.if_root = NULL;
 
-       ip->i_d.di_size = mp->m_rsumsize;
+       ip->i_disk_size = mp->m_rsumsize;
 
        /*
         * commit changes
@@ -2214,14 +2215,14 @@ longform_dir2_entry_check(
        struct xfs_da_args      args;
 
        *need_dot = 1;
-       freetab = malloc(FREETAB_SIZE(ip->i_d.di_size / mp->m_dir_geo->blksize));
+       freetab = malloc(FREETAB_SIZE(ip->i_disk_size / mp->m_dir_geo->blksize));
        if (!freetab) {
                do_error(_("malloc failed in %s (%" PRId64 " bytes)\n"),
                        __func__,
-                       FREETAB_SIZE(ip->i_d.di_size / mp->m_dir_geo->blksize));
+                       FREETAB_SIZE(ip->i_disk_size / mp->m_dir_geo->blksize));
                exit(1);
        }
-       freetab->naents = ip->i_d.di_size / mp->m_dir_geo->blksize;
+       freetab->naents = ip->i_disk_size / mp->m_dir_geo->blksize;
        freetab->nents = 0;
        for (i = 0; i < freetab->naents; i++) {
                freetab->ents[i].v = NULLDATAOFF;
@@ -2434,7 +2435,7 @@ shortform_dir2_entry_check(
        bytes_deleted = 0;
 
        max_size = ifp->if_bytes;
-       ASSERT(ip->i_d.di_size <= ifp->if_bytes);
+       ASSERT(ip->i_disk_size <= ifp->if_bytes);
 
        /*
         * if just rebuild a directory due to a "..", update and return
@@ -2498,7 +2499,7 @@ shortform_dir2_entry_check(
                        bad_sfnamelen = 1;
 
                        if (i == sfp->count - 1)  {
-                               namelen = ip->i_d.di_size -
+                               namelen = ip->i_disk_size -
                                        ((intptr_t) &sfep->name[0] -
                                         (intptr_t) sfp);
                        } else  {
@@ -2510,11 +2511,11 @@ shortform_dir2_entry_check(
                        }
                } else if (no_modify && (intptr_t) sfep - (intptr_t) sfp +
                                + libxfs_dir2_sf_entsize(mp, sfp, sfep->namelen)
-                               > ip->i_d.di_size)  {
+                               > ip->i_disk_size)  {
                        bad_sfnamelen = 1;
 
                        if (i == sfp->count - 1)  {
-                               namelen = ip->i_d.di_size -
+                               namelen = ip->i_disk_size -
                                        ((intptr_t) &sfep->name[0] -
                                         (intptr_t) sfp);
                        } else  {
@@ -2732,17 +2733,17 @@ _("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"),
        if (*ino_dirty && bytes_deleted > 0)  {
                ASSERT(!no_modify);
                libxfs_idata_realloc(ip, -bytes_deleted, XFS_DATA_FORK);
-               ip->i_d.di_size -= bytes_deleted;
+               ip->i_disk_size -= bytes_deleted;
        }
 
-       if (ip->i_d.di_size != ip->i_df.if_bytes)  {
+       if (ip->i_disk_size != ip->i_df.if_bytes)  {
                ASSERT(ip->i_df.if_bytes == (xfs_fsize_t)
                                ((intptr_t) next_sfep - (intptr_t) sfp));
-               ip->i_d.di_size = (xfs_fsize_t)
+               ip->i_disk_size = (xfs_fsize_t)
                                ((intptr_t) next_sfep - (intptr_t) sfp);
                do_warn(
        _("setting size to %" PRId64 " bytes to reflect junked entries\n"),
-                       ip->i_d.di_size);
+                       ip->i_disk_size);
                *ino_dirty = 1;
        }
 }
@@ -2816,7 +2817,7 @@ process_dir_inode(
 
        add_inode_refchecked(irec, ino_offset);
 
-       hashtab = dir_hash_init(ip->i_d.di_size);
+       hashtab = dir_hash_init(ip->i_disk_size);
 
        /*
         * look for bogus entries