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
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D11354
This commit is contained in:
Pedro F. Giffuni 2017-06-27 15:07:19 +00:00
parent 654d0a3794
commit 26f36b55b6

View File

@ -124,6 +124,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 < EXT2_NDADDR; i++)
ip->i_db[i] = ei->e2di_blocks[i];
@ -170,8 +172,10 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei)
ei->e2di_facl = ip->i_facl & 0xffffffff;
ei->e2di_facl_high = ip->i_facl >> 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 < EXT2_NDADDR; i++)
ei->e2di_blocks[i] = ip->i_db[i];