Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ef81874 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Greg Kroah-Hartman
Browse files

xfs: remove the icdinode di_uid/di_gid members



commit 542951592c99ff7b15c050954c051dd6dd6c0f97 upstream.

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarChandan Babu R <chandan.babu@oracle.com>
Acked-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cc508a41
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -222,10 +222,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);

	/*
@@ -278,8 +276,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);

+0 −2
Original line number Diff line number Diff line
@@ -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 */
+2 −2
Original line number Diff line number Diff line
@@ -859,9 +859,9 @@ xfs_qm_id_for_quotatype(
{
	switch (type) {
	case XFS_DQ_USER:
		return ip->i_d.di_uid;
		return xfs_kuid_to_uid(VFS_I(ip)->i_uid);
	case XFS_DQ_GROUP:
		return ip->i_d.di_gid;
		return xfs_kgid_to_gid(VFS_I(ip)->i_gid);
	case XFS_DQ_PROJ:
		return ip->i_d.di_projid;
	}
+4 −10
Original line number Diff line number Diff line
@@ -807,18 +807,15 @@ xfs_ialloc(
	inode->i_mode = mode;
	set_nlink(inode, nlink);
	inode->i_uid = current_fsuid();
	ip->i_d.di_uid = xfs_kuid_to_uid(inode->i_uid);
	inode->i_rdev = rdev;
	ip->i_d.di_projid = prid;

	if (pip && XFS_INHERIT_GID(pip)) {
		inode->i_gid = VFS_I(pip)->i_gid;
		ip->i_d.di_gid = pip->i_d.di_gid;
		if ((VFS_I(pip)->i_mode & S_ISGID) && S_ISDIR(mode))
			inode->i_mode |= S_ISGID;
	} else {
		inode->i_gid = current_fsgid();
		ip->i_d.di_gid = xfs_kgid_to_gid(inode->i_gid);
	}

	/*
@@ -826,9 +823,8 @@ xfs_ialloc(
	 * ID or one of the supplementary group IDs, the S_ISGID bit is cleared
	 * (and only if the irix_sgid_inherit compatibility variable is set).
	 */
	if ((irix_sgid_inherit) &&
	    (inode->i_mode & S_ISGID) &&
	    (!in_group_p(xfs_gid_to_kgid(ip->i_d.di_gid))))
	if (irix_sgid_inherit &&
	    (inode->i_mode & S_ISGID) && !in_group_p(inode->i_gid))
		inode->i_mode &= ~S_ISGID;

	ip->i_d.di_size = 0;
@@ -1157,8 +1153,7 @@ xfs_create(
	/*
	 * Make sure that we have allocated dquot(s) on disk.
	 */
	error = xfs_qm_vop_dqalloc(dp, xfs_kuid_to_uid(current_fsuid()),
					xfs_kgid_to_gid(current_fsgid()), prid,
	error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid,
					XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,
					&udqp, &gdqp, &pdqp);
	if (error)
@@ -1308,8 +1303,7 @@ xfs_create_tmpfile(
	/*
	 * Make sure that we have allocated dquot(s) on disk.
	 */
	error = xfs_qm_vop_dqalloc(dp, xfs_kuid_to_uid(current_fsuid()),
				xfs_kgid_to_gid(current_fsgid()), prid,
	error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid,
				XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,
				&udqp, &gdqp, &pdqp);
	if (error)
+2 −2
Original line number Diff line number Diff line
@@ -308,8 +308,8 @@ xfs_inode_to_log_dinode(

	to->di_version = from->di_version;
	to->di_format = from->di_format;
	to->di_uid = from->di_uid;
	to->di_gid = from->di_gid;
	to->di_uid = xfs_kuid_to_uid(inode->i_uid);
	to->di_gid = xfs_kgid_to_gid(inode->i_gid);
	to->di_projid_lo = from->di_projid & 0xffff;
	to->di_projid_hi = from->di_projid >> 16;

Loading