Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jul 2017 15:14:22 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r320841 - stable/10/sys/fs/ext2fs
Message-ID:  <201707091514.v69FEMIR055611@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sun Jul  9 15:14:22 2017
New Revision: 320841
URL: https://svnweb.freebsd.org/changeset/base/320841

Log:
  MFC r320408:
  ext2fs: Support e2di_uid_high and e2di_gid_high.
  
  The fields exist on all versions of the filesystem and using them is a mount
  option on linux. For FreeBSD, the corresponding i_uid and i_gid are always
  long enough so use them by default.
  
  Reviewed by:	Fedor Uporov

Modified:
  stable/10/sys/fs/ext2fs/ext2_inode_cnv.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/ext2fs/ext2_inode_cnv.c
==============================================================================
--- stable/10/sys/fs/ext2fs/ext2_inode_cnv.c	Sun Jul  9 15:13:40 2017	(r320840)
+++ stable/10/sys/fs/ext2fs/ext2_inode_cnv.c	Sun Jul  9 15:14:22 2017	(r320841)
@@ -122,6 +122,8 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip)
 	ip->i_gen = ei->e2di_gen;
 	ip->i_uid = ei->e2di_uid;
 	ip->i_gid = ei->e2di_gid;
+	ip->i_uid |= (uint32_t)ei->e2di_uid_high << 16;
+	ip->i_gid |= (uint32_t)ei->e2di_gid_high << 16;
 	/* XXX use memcpy */
 	for (i = 0; i < NDADDR; i++)
 		ip->i_db[i] = ei->e2di_blocks[i];
@@ -166,8 +168,10 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei)
 	ei->e2di_nblock = ip->i_blocks & 0xffffffff;
 	ei->e2di_nblock_high = ip->i_blocks >> 32 & 0xffff;
 	ei->e2di_gen = ip->i_gen;
-	ei->e2di_uid = ip->i_uid;
-	ei->e2di_gid = ip->i_gid;
+	ei->e2di_uid = ip->i_uid & 0xffff;
+	ei->e2di_uid_high = ip->i_uid >> 16 & 0xffff;
+	ei->e2di_gid = ip->i_gid & 0xffff;
+	ei->e2di_gid_high = ip->i_gid >> 16 & 0xffff;
 	/* XXX use memcpy */
 	for (i = 0; i < NDADDR; i++)
 		ei->e2di_blocks[i] = ip->i_db[i];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707091514.v69FEMIR055611>