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

Move the crtime field from struct xfs_icdinode into stuct xfs_inode and
remove the now entirely unused struct xfs_icdinode.

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>
include/xfs_inode.h
libxfs/util.c
libxfs/xfs_format.h
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h
libxfs/xfs_trans_inode.c
repair/phase6.c

index 8e75ad9116c88e647d713bc2c416b7dd225b4806..0551fe457d0ca0258a2f073bf4ea63d77fcf8aac 100644 (file)
@@ -90,7 +90,7 @@ typedef struct xfs_inode {
        uint8_t                 i_forkoff;      /* attr fork offset >> 3 */
        uint16_t                i_diflags;      /* XFS_DIFLAG_... */
        uint64_t                i_diflags2;     /* XFS_DIFLAG2_... */
-       struct xfs_icdinode     i_d;            /* most of ondisk inode */
+       struct timespec64       i_crtime;       /* time created */
 
        xfs_extnum_t            i_cnextents;    /* # of extents in cow fork */
        unsigned int            i_cformat;      /* format of cow fork */
index cc2e6f28a840400c8f17e2b979f1786846cf67cf..d227a29089b6a32ccd0739421f09a55764f654fc 100644 (file)
@@ -283,12 +283,10 @@ libxfs_init_new_inode(
        ip->i_diflags = pip ? 0 : xfs_flags2diflags(ip, fsx->fsx_xflags);
 
        if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
-               ASSERT(ip->i_d.di_ino == ino);
-               ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid));
                VFS_I(ip)->i_version = 1;
                ip->i_diflags2 = pip ? ip->i_mount->m_ino_geo.new_diflags2 :
                                xfs_flags2diflags2(ip, fsx->fsx_xflags);
-               ip->i_d.di_crtime = VFS_I(ip)->i_mtime; /* struct copy */
+               ip->i_crtime = VFS_I(ip)->i_mtime; /* struct copy */
                ip->i_cowextsize = pip ? 0 : fsx->fsx_cowextsize;
        }
 
@@ -351,7 +349,6 @@ libxfs_iflush_int(
        /* set *dip = inode's place in the buffer */
        dip = xfs_buf_offset(bp, ip->i_imap.im_boffset);
 
-       ASSERT(ip->i_d.di_magic == XFS_DINODE_MAGIC);
        if (XFS_ISREG(ip)) {
                ASSERT( (ip->i_df.if_format == XFS_DINODE_FMT_EXTENTS) ||
                        (ip->i_df.if_format == XFS_DINODE_FMT_BTREE) );
index 9f7f1300a03818245b13cd7afd5318c7ff92cf5e..37570cf0537e6301ea5dd344a3ad7f63fda4af77 100644 (file)
@@ -955,9 +955,8 @@ static inline time64_t xfs_bigtime_to_unix(uint64_t ondisk_seconds)
  * attribute use the XFS_DFORK_DPTR, XFS_DFORK_APTR, and XFS_DFORK_PTR macros
  * below.
  *
- * There is a very similar struct icdinode in xfs_inode which matches the
- * layout of the first 96 bytes of this structure, but is kept in native
- * format instead of big endian.
+ * There is a very similar struct xfs_log_dinode which matches the layout of
+ * this structure, but is kept in native format instead of big endian.
  *
  * Note: di_flushiter is only used by v1/2 inodes - it's effectively a zeroed
  * padding field for v3 inodes.
index d41e2f3260c540b33ad13ad25fd908d17b54798d..02997a8ddb0d136d2aa0aa154b56170165579b78 100644 (file)
@@ -170,7 +170,6 @@ xfs_inode_from_disk(
        struct xfs_inode        *ip,
        struct xfs_dinode       *from)
 {
-       struct xfs_icdinode     *to = &ip->i_d;
        struct inode            *inode = VFS_I(ip);
        int                     error;
        xfs_failaddr_t          fa;
@@ -236,7 +235,7 @@ xfs_inode_from_disk(
        if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
                inode_set_iversion_queried(inode,
                                           be64_to_cpu(from->di_changecount));
-               to->di_crtime = xfs_inode_from_disk_ts(from, from->di_crtime);
+               ip->i_crtime = xfs_inode_from_disk_ts(from, from->di_crtime);
                ip->i_diflags2 = be64_to_cpu(from->di_flags2);
                ip->i_cowextsize = be32_to_cpu(from->di_cowextsize);
        }
@@ -283,7 +282,6 @@ xfs_inode_to_disk(
        struct xfs_dinode       *to,
        xfs_lsn_t               lsn)
 {
-       struct xfs_icdinode     *from = &ip->i_d;
        struct inode            *inode = VFS_I(ip);
 
        to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC);
@@ -315,7 +313,7 @@ xfs_inode_to_disk(
        if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
                to->di_version = 3;
                to->di_changecount = cpu_to_be64(inode_peek_iversion(inode));
-               to->di_crtime = xfs_inode_to_disk_ts(ip, from->di_crtime);
+               to->di_crtime = xfs_inode_to_disk_ts(ip, ip->i_crtime);
                to->di_flags2 = cpu_to_be64(ip->i_diflags2);
                to->di_cowextsize = cpu_to_be32(ip->i_cowextsize);
                to->di_ino = cpu_to_be64(ip->i_ino);
index 2f6015acfda81b5233c8ecd01af4e88cc586c79f..7f865bb4df840b181d28ed487c9698b7cd4ea235 100644 (file)
@@ -9,16 +9,6 @@
 struct xfs_inode;
 struct xfs_dinode;
 
-/*
- * In memory representation of the XFS inode. This is held in the in-core struct
- * xfs_inode and represents the current on disk values but the structure is not
- * in on-disk format.  That is, this structure is always translated to on-disk
- * format specific structures at the appropriate time.
- */
-struct xfs_icdinode {
-       struct timespec64 di_crtime;    /* time created */
-};
-
 /*
  * Inode location information.  Stored in the inode and passed to
  * xfs_imap_to_bp() to get a buffer and dinode for a given inode.
index c0a1098403b32bdd96cc369cd441f3687ff16a95..854446a890f3999585e937731a6569ab682e2b46 100644 (file)
@@ -67,7 +67,7 @@ xfs_trans_ichgtime(
        if (flags & XFS_ICHGTIME_CHG)
                inode->i_ctime = tv;
        if (flags & XFS_ICHGTIME_CREATE)
-               ip->i_d.di_crtime = tv;
+               ip->i_crtime = tv;
 }
 
 /*
index 6d8f6d9bbabde343bf041771a6cc5631d110842e..9ada8f2bc3bcc5155779d711323293be897fcbe2 100644 (file)
@@ -440,7 +440,6 @@ res_failed(
 static inline void
 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;
        ip->i_nblocks = 0;
@@ -450,6 +449,8 @@ reset_inode_fields(struct xfs_inode *ip)
        ip->i_forkoff = 0;
        ip->i_diflags = 0;
        ip->i_diflags2 = 0;
+       ip->i_crtime.tv_sec = 0;
+       ip->i_crtime.tv_nsec = 0;
 }
 
 static void