]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove the icdinode di_uid/di_gid members
authorChristoph Hellwig <hch@lst.de>
Wed, 29 Apr 2020 20:08:30 +0000 (16:08 -0400)
committerEric Sandeen <sandeen@redhat.com>
Wed, 29 Apr 2020 20:08:30 +0000 (16:08 -0400)
Source kernel commit: 542951592c99ff7b15c050954c051dd6dd6c0f97

Use the Linux inode i_uid/i_gid members everywhere and just convert
from/to the scalar value when reading or writing the on-disk inode.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/check.c
libxfs/libxfs_priv.h
libxfs/util.c
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h

index 3b713bdc5a305cbfab716b53b7932c2929f87fc2..125c5c7880ea9b1e321cd7fba2cb2aba3c20a454 100644 (file)
@@ -2898,8 +2898,8 @@ process_inode(
                        break;
                }
                if (ic) {
-                       quota_add(&xino.i_d.di_projid, &xino.i_d.di_gid,
-                                 &xino.i_d.di_uid, 0, bc, ic, rc);
+                       quota_add(&xino.i_d.di_projid, &VFS_I(&xino)->i_gid,
+                                 &VFS_I(&xino)->i_uid, 0, bc, ic, rc);
                }
        }
        totblocks = totdblocks + totiblocks + atotdblocks + atotiblocks;
index 9ef5027010edddec2d3e478045ec1305a344c06f..76a3874b2813ce6dddcb7a40eda071c089e5ea2f 100644 (file)
@@ -460,6 +460,8 @@ static inline struct xfs_buf *xfs_buf_incore(struct xfs_buftarg *target,
 
 #define xfs_uid_to_kuid(uid)   (uid)
 #define xfs_gid_to_kgid(gid)   (gid)
+#define xfs_kuid_to_uid(kuid)  (kuid)
+#define xfs_kgid_to_gid(kgid)  (kgid)
 
 /*
  * Prototypes for kernel static functions that are aren't in their
index 2e2ade24c4442e888294030e20fb4270c201073b..0c76c8cd87e957bddc73d14fa806ee05a9519a64 100644 (file)
@@ -255,8 +255,8 @@ libxfs_ialloc(
 
        VFS_I(ip)->i_mode = mode;
        set_nlink(VFS_I(ip), nlink);
-       ip->i_d.di_uid = cr->cr_uid;
-       ip->i_d.di_gid = cr->cr_gid;
+       i_uid_write(VFS_I(ip), cr->cr_uid);
+       i_gid_write(VFS_I(ip), cr->cr_gid);
        ip->i_d.di_projid = pip ? 0 : fsx->fsx_projid;
        xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD);
 
@@ -275,7 +275,7 @@ libxfs_ialloc(
        }
 
        if (pip && (VFS_I(pip)->i_mode & S_ISGID)) {
-               ip->i_d.di_gid = pip->i_d.di_gid;
+               VFS_I(ip)->i_gid = VFS_I(pip)->i_gid;
                if ((VFS_I(pip)->i_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR)
                        VFS_I(ip)->i_mode |= S_ISGID;
        }
index a7d39f24592a2349989cf0a3f5d555b1fab543a1..9d47208e90f3704ccd9cfa07f335b65daaeeb082 100644 (file)
@@ -219,10 +219,8 @@ xfs_inode_from_disk(
        }
 
        to->di_format = from->di_format;
-       to->di_uid = be32_to_cpu(from->di_uid);
-       inode->i_uid = xfs_uid_to_kuid(to->di_uid);
-       to->di_gid = be32_to_cpu(from->di_gid);
-       inode->i_gid = xfs_gid_to_kgid(to->di_gid);
+       inode->i_uid = xfs_uid_to_kuid(be32_to_cpu(from->di_uid));
+       inode->i_gid = xfs_gid_to_kgid(be32_to_cpu(from->di_gid));
        to->di_flushiter = be16_to_cpu(from->di_flushiter);
 
        /*
@@ -275,8 +273,8 @@ xfs_inode_to_disk(
 
        to->di_version = from->di_version;
        to->di_format = from->di_format;
-       to->di_uid = cpu_to_be32(from->di_uid);
-       to->di_gid = cpu_to_be32(from->di_gid);
+       to->di_uid = cpu_to_be32(xfs_kuid_to_uid(inode->i_uid));
+       to->di_gid = cpu_to_be32(xfs_kgid_to_gid(inode->i_gid));
        to->di_projid_lo = cpu_to_be16(from->di_projid & 0xffff);
        to->di_projid_hi = cpu_to_be16(from->di_projid >> 16);
 
index fd94b107872290f1166f1d3fb9bd50707f39126f..2683e1e2c4a69f94921bed12c0625f67c31031f1 100644 (file)
@@ -19,8 +19,6 @@ struct xfs_icdinode {
        int8_t          di_version;     /* inode version */
        int8_t          di_format;      /* format of di_c data */
        uint16_t        di_flushiter;   /* incremented on flush */
-       uint32_t        di_uid;         /* owner's user id */
-       uint32_t        di_gid;         /* owner's group id */
        uint32_t        di_projid;      /* owner's project id */
        xfs_fsize_t     di_size;        /* number of bytes in file */
        xfs_rfsblock_t  di_nblocks;     /* # of direct & btree blocks used */