]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: move di_changecount to VFS inode
authorDave Chinner <dchinner@redhat.com>
Thu, 18 Feb 2016 01:03:59 +0000 (12:03 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 18 Feb 2016 01:03:59 +0000 (12:03 +1100)
Source kernel commit 83e06f21b439b7b308eda06332a4feef35739e94

We can store the di_changecount in the i_version field of the VFS
inode and remove another 8 bytes from the xfs_icdinode.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/xfs_inode.h
libxfs/util.c
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h
repair/phase6.c

index 08e0484eecd71af08f51a0bde26ff023f874c4a9..fbc96cf6e2dceff03981b130541f4132230ba408 100644 (file)
@@ -36,6 +36,7 @@ struct xfs_dir_ops;
 struct inode {
        uint32_t        i_nlink;
        uint32_t        i_generation;
+       uint64_t        i_version;
        struct timespec i_atime;
        struct timespec i_mtime;
        struct timespec i_ctime;
index 3263ae746e91a8c4caab2b6a416988328a06b274..9c2f1d2b007653b74e15f766a75700f810e4de0a 100644 (file)
@@ -255,7 +255,7 @@ libxfs_ialloc(
        if (ip->i_d.di_version == 3) {
                ASSERT(ip->i_d.di_ino == ino);
                ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid));
-               ip->i_d.di_changecount = 1;
+               VFS_I(ip)->i_version = 1;
                ip->i_d.di_flags2 = 0;
                ip->i_d.di_crtime.t_sec = (__int32_t)VFS_I(ip)->i_mtime.tv_sec;
                ip->i_d.di_crtime.t_nsec = (__int32_t)VFS_I(ip)->i_mtime.tv_nsec;
@@ -431,7 +431,7 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp)
 
        /* bump the change count on v3 inodes */
        if (ip->i_d.di_version == 3)
-               ip->i_d.di_changecount++;
+               VFS_I(ip)->i_version++;
 
        /*
         * Copy the dirty parts of the inode into the on-disk
index 224edd301f2e97633630b7a0ba0be4ce3dc5a26d..da9edcda83786f41745b51598de4358ffb972cff 100644 (file)
@@ -260,7 +260,7 @@ xfs_inode_from_disk(
        to->di_flags    = be16_to_cpu(from->di_flags);
 
        if (to->di_version == 3) {
-               to->di_changecount = be64_to_cpu(from->di_changecount);
+               inode->i_version = be64_to_cpu(from->di_changecount);
                to->di_crtime.t_sec = be32_to_cpu(from->di_crtime.t_sec);
                to->di_crtime.t_nsec = be32_to_cpu(from->di_crtime.t_nsec);
                to->di_flags2 = be64_to_cpu(from->di_flags2);
@@ -309,7 +309,7 @@ xfs_inode_to_disk(
        to->di_flags = cpu_to_be16(from->di_flags);
 
        if (from->di_version == 3) {
-               to->di_changecount = cpu_to_be64(from->di_changecount);
+               to->di_changecount = cpu_to_be64(inode->i_version);
                to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec);
                to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec);
                to->di_flags2 = cpu_to_be64(from->di_flags2);
index 83ae8edb67a4d98f68742e70ac588963c5b8e551..ad98fdd65862b547ea6041ef6402a2ed5ca5078c 100644 (file)
@@ -47,7 +47,6 @@ struct xfs_icdinode {
        __uint16_t      di_dmstate;     /* DMIG state info */
        __uint16_t      di_flags;       /* random flags, XFS_DIFLAG_... */
 
-       __uint64_t      di_changecount; /* number of attribute changes */
        __uint64_t      di_flags2;      /* more random flags */
 
        xfs_ictimestamp_t di_crtime;    /* time created */
index 7e14346bf9a9d8072fd77bc6fee36c34969cf717..74151994805883cfa31800e3e7f536b8db13274b 100644 (file)
@@ -519,7 +519,7 @@ mk_rbmino(xfs_mount_t *mp)
 
        times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD;
        if (ip->i_d.di_version == 3) {
-               ip->i_d.di_changecount = 1;
+               VFS_I(ip)->i_version = 1;
                ip->i_d.di_flags2 = 0;
                times |= XFS_ICHGTIME_CREATE;
        }
@@ -772,7 +772,7 @@ mk_rsumino(xfs_mount_t *mp)
 
        times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD;
        if (ip->i_d.di_version == 3) {
-               ip->i_d.di_changecount = 1;
+               VFS_I(ip)->i_version = 1;
                ip->i_d.di_flags2 = 0;
                times |= XFS_ICHGTIME_CREATE;
        }
@@ -881,7 +881,7 @@ mk_root_dir(xfs_mount_t *mp)
 
        times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD;
        if (ip->i_d.di_version == 3) {
-               ip->i_d.di_changecount = 1;
+               VFS_I(ip)->i_version = 1;
                ip->i_d.di_flags2 = 0;
                times |= XFS_ICHGTIME_CREATE;
        }