--- linux-2.6.16-rc1/fs/ext2/inode.c	2006-01-03 17:29:56 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/ext2/inode.c	2006-01-25 05:34:51 +0100
@@ -1081,12 +1134,17 @@ void ext2_read_inode (struct inode * ino
  		goto bad_inode;
 
 	inode->i_mode = le16_to_cpu(raw_inode->i_mode);
-	inode->i_uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
-	inode->i_gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
+	uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
+	gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
 	if (!(test_opt (inode->i_sb, NO_UID32))) {
-		inode->i_uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
-		inode->i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
+		uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
+		gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
 	}
+	inode->i_uid = INOTAG_UID(DX_TAG(inode), uid, gid);
+	inode->i_gid = INOTAG_GID(DX_TAG(inode), uid, gid);
+	inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid,
+		le16_to_cpu(raw_inode->i_raw_tag));
+
 	inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
 	inode->i_size = le32_to_cpu(raw_inode->i_size);
 	inode->i_atime.tv_sec = le32_to_cpu(raw_inode->i_atime);
--- linux-2.6.16-rc1/fs/ext3/inode.c	2006-01-03 17:29:56 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/ext3/inode.c	2006-01-25 05:34:51 +0100
@@ -2441,6 +2507,8 @@ void ext3_read_inode(struct inode * inod
 	struct ext3_inode_info *ei = EXT3_I(inode);
 	struct buffer_head *bh;
 	int block;
+	uid_t uid;
+	gid_t gid;
 
 #ifdef CONFIG_EXT3_FS_POSIX_ACL
 	ei->i_acl = EXT3_ACL_NOT_CACHED;
--- linux-2.6.16-rc1/fs/ext3/inode.c	2006-01-03 17:29:56 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/ext3/inode.c	2006-01-25 05:34:51 +0100
@@ -2453,12 +2521,17 @@ void ext3_read_inode(struct inode * inod
 	bh = iloc.bh;
 	raw_inode = ext3_raw_inode(&iloc);
 	inode->i_mode = le16_to_cpu(raw_inode->i_mode);
-	inode->i_uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
-	inode->i_gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
+	uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
+	gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
 	if(!(test_opt (inode->i_sb, NO_UID32))) {
-		inode->i_uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
-		inode->i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
+		uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
+		gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
 	}
+	inode->i_uid = INOTAG_UID(DX_TAG(inode), uid, gid);
+	inode->i_gid = INOTAG_GID(DX_TAG(inode), uid, gid);
+	inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid,
+		le16_to_cpu(raw_inode->i_raw_tag));
+
 	inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
 	inode->i_size = le32_to_cpu(raw_inode->i_size);
 	inode->i_atime.tv_sec = le32_to_cpu(raw_inode->i_atime);
--- linux-2.6.16-rc1/fs/ext3/inode.c	2006-01-03 17:29:56 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/ext3/inode.c	2006-01-25 05:34:51 +0100
@@ -2585,6 +2658,8 @@ static int ext3_do_update_inode(handle_t
 	struct ext3_inode *raw_inode = ext3_raw_inode(iloc);
 	struct ext3_inode_info *ei = EXT3_I(inode);
 	struct buffer_head *bh = iloc->bh;
+	uid_t uid = TAGINO_UID(DX_TAG(inode), inode->i_uid, inode->i_tag);
+	gid_t gid = TAGINO_GID(DX_TAG(inode), inode->i_gid, inode->i_tag);
 	int err = 0, rc, block;
 
 	/* For fields not not tracking in the in-memory inode,
--- linux-2.6.16-rc1/fs/ext3/inode.c	2006-01-03 17:29:56 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/ext3/inode.c	2006-01-25 05:34:51 +0100
@@ -2594,8 +2669,8 @@ static int ext3_do_update_inode(handle_t
 
 	raw_inode->i_mode = cpu_to_le16(inode->i_mode);
 	if(!(test_opt(inode->i_sb, NO_UID32))) {
-		raw_inode->i_uid_low = cpu_to_le16(low_16_bits(inode->i_uid));
-		raw_inode->i_gid_low = cpu_to_le16(low_16_bits(inode->i_gid));
+		raw_inode->i_uid_low = cpu_to_le16(low_16_bits(uid));
+		raw_inode->i_gid_low = cpu_to_le16(low_16_bits(gid));
 /*
  * Fix up interoperability with old kernels. Otherwise, old inodes get
  * re-used with the upper 16 bits of the uid/gid intact
--- linux-2.6.16-rc1/fs/jfs/jfs_imap.c	2006-01-26 22:35:11 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/jfs/jfs_imap.c	2006-01-25 05:34:51 +0100
@@ -3076,6 +3077,8 @@ static void duplicateIXtree(struct super
 static int copy_from_dinode(struct dinode * dip, struct inode *ip)
 {
 	struct jfs_inode_info *jfs_ip = JFS_IP(ip);
+	uid_t uid;
+	gid_t gid;
 
 	jfs_ip->fileset = le32_to_cpu(dip->di_fileset);
 	jfs_ip->mode2 = le32_to_cpu(dip->di_mode);
--- linux-2.6.16-rc1/fs/jfs/jfs_imap.c	2006-01-26 22:35:11 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/jfs/jfs_imap.c	2006-01-25 05:34:51 +0100
@@ -3082,8 +3085,13 @@ *****
 
 	ip->i_mode = le32_to_cpu(dip->di_mode) & 0xffff;
 	ip->i_nlink = le32_to_cpu(dip->di_nlink);
-	ip->i_uid = le32_to_cpu(dip->di_uid);
-	ip->i_gid = le32_to_cpu(dip->di_gid);
+
+	uid = le32_to_cpu(dip->di_uid);
+	gid = le32_to_cpu(dip->di_gid);
+	ip->i_uid = INOTAG_UID(DX_TAG(ip), uid, gid);
+	ip->i_gid = INOTAG_GID(DX_TAG(ip), uid, gid);
+	ip->i_tag = INOTAG_TAG(DX_TAG(ip), uid, gid, 0);
+
 	ip->i_size = le64_to_cpu(dip->di_size);
 	ip->i_atime.tv_sec = le32_to_cpu(dip->di_atime.tv_sec);
 	ip->i_atime.tv_nsec = le32_to_cpu(dip->di_atime.tv_nsec);
--- linux-2.6.16-rc1/fs/jfs/jfs_imap.c	2006-01-26 22:35:11 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/jfs/jfs_imap.c	2006-01-25 05:34:51 +0100
@@ -3134,6 +3142,8 @@ static int copy_from_dinode(struct dinod
 static void copy_to_dinode(struct dinode * dip, struct inode *ip)
 {
 	struct jfs_inode_info *jfs_ip = JFS_IP(ip);
+	uid_t uid;
+	gid_t gid;
 
 	dip->di_fileset = cpu_to_le32(jfs_ip->fileset);
 	dip->di_inostamp = cpu_to_le32(JFS_SBI(ip->i_sb)->inostamp);
--- linux-2.6.16-rc1/fs/jfs/jfs_imap.c	2006-01-26 22:35:11 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/jfs/jfs_imap.c	2006-01-25 05:34:51 +0100
@@ -3142,8 +3152,11 @@ static void copy_to_dinode(struct dinode
 	dip->di_size = cpu_to_le64(ip->i_size);
 	dip->di_nblocks = cpu_to_le64(PBLK2LBLK(ip->i_sb, ip->i_blocks));
 	dip->di_nlink = cpu_to_le32(ip->i_nlink);
-	dip->di_uid = cpu_to_le32(ip->i_uid);
-	dip->di_gid = cpu_to_le32(ip->i_gid);
+
+	uid = TAGINO_UID(DX_TAG(ip), ip->i_uid, ip->i_tag);
+	gid = TAGINO_GID(DX_TAG(ip), ip->i_gid, ip->i_tag);
+	dip->di_uid = cpu_to_le32(uid);
+	dip->di_gid = cpu_to_le32(gid);
 	/*
 	 * mode2 is only needed for storing the higher order bits.
 	 * Trust i_mode for the lower order ones
--- linux-2.6.16-rc1/fs/reiserfs/inode.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/reiserfs/inode.c	2006-01-25 05:34:51 +0100
@@ -1153,6 +1158,9 @@ static void init_inode(struct inode *ino
 		    (struct stat_data_v1 *)B_I_PITEM(bh, ih);
 		unsigned long blocks;
 
+		uid = sd_v1_uid(sd);
+		gid = sd_v1_gid(sd);
+
 		set_inode_item_key_version(inode, KEY_FORMAT_3_5);
 		set_inode_sd_version(inode, STAT_DATA_V1);
 		inode->i_mode = sd_v1_mode(sd);
--- linux-2.6.16-rc1/fs/reiserfs/inode.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/reiserfs/inode.c	2006-01-25 05:34:51 +0100
@@ -1157,8 +1165,6 @@ *****
 		set_inode_sd_version(inode, STAT_DATA_V1);
 		inode->i_mode = sd_v1_mode(sd);
 		inode->i_nlink = sd_v1_nlink(sd);
-		inode->i_uid = sd_v1_uid(sd);
-		inode->i_gid = sd_v1_gid(sd);
 		inode->i_size = sd_v1_size(sd);
 		inode->i_atime.tv_sec = sd_v1_atime(sd);
 		inode->i_mtime.tv_sec = sd_v1_mtime(sd);
--- linux-2.6.16-rc1/fs/reiserfs/inode.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/reiserfs/inode.c	2006-01-25 05:34:51 +0100
@@ -1200,11 +1206,12 @@ static void init_inode(struct inode *ino
 		// (directories and symlinks)
 		struct stat_data *sd = (struct stat_data *)B_I_PITEM(bh, ih);
 
+		uid    = sd_v2_uid(sd);
+		gid    = sd_v2_gid(sd);
+
 		inode->i_mode = sd_v2_mode(sd);
 		inode->i_nlink = sd_v2_nlink(sd);
-		inode->i_uid = sd_v2_uid(sd);
 		inode->i_size = sd_v2_size(sd);
-		inode->i_gid = sd_v2_gid(sd);
 		inode->i_mtime.tv_sec = sd_v2_mtime(sd);
 		inode->i_atime.tv_sec = sd_v2_atime(sd);
 		inode->i_ctime.tv_sec = sd_v2_ctime(sd);
--- linux-2.6.16-rc1/fs/reiserfs/inode.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/reiserfs/inode.c	2006-01-25 05:34:51 +0100
@@ -1234,6 +1241,10 @@ static void init_inode(struct inode *ino
 		sd_attrs_to_i_attrs(sd_v2_attrs(sd), inode);
 	}
 
+	inode->i_uid = INOTAG_UID(DX_TAG(inode), uid, gid);
+	inode->i_gid = INOTAG_GID(DX_TAG(inode), uid, gid);
+	inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid, 0);
+
 	pathrelse(path);
 	if (S_ISREG(inode->i_mode)) {
 		inode->i_op = &reiserfs_file_inode_operations;
--- linux-2.6.16-rc1/fs/reiserfs/inode.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/reiserfs/inode.c	2006-01-25 05:34:51 +0100
@@ -1256,13 +1267,15 @@ static void init_inode(struct inode *ino
 static void inode2sd(void *sd, struct inode *inode, loff_t size)
 {
 	struct stat_data *sd_v2 = (struct stat_data *)sd;
+	uid_t uid = TAGINO_UID(DX_TAG(inode), inode->i_uid, inode->i_tag);
+	gid_t gid = TAGINO_GID(DX_TAG(inode), inode->i_gid, inode->i_tag);
 	__u16 flags;
 
+	set_sd_v2_uid(sd_v2, uid);
+	set_sd_v2_gid(sd_v2, gid);
 	set_sd_v2_mode(sd_v2, inode->i_mode);
 	set_sd_v2_nlink(sd_v2, inode->i_nlink);
-	set_sd_v2_uid(sd_v2, inode->i_uid);
 	set_sd_v2_size(sd_v2, size);
-	set_sd_v2_gid(sd_v2, inode->i_gid);
 	set_sd_v2_mtime(sd_v2, inode->i_mtime.tv_sec);
 	set_sd_v2_atime(sd_v2, inode->i_atime.tv_sec);
 	set_sd_v2_ctime(sd_v2, inode->i_ctime.tv_sec);
--- linux-2.6.16-rc1/fs/xfs/linux-2.6/xfs_super.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/linux-2.6/xfs_super.c	2006-01-25 05:34:51 +0100
@@ -161,6 +161,7 @@ xfs_revalidate_inode(
 	inode->i_nlink	= ip->i_d.di_nlink;
 	inode->i_uid	= ip->i_d.di_uid;
 	inode->i_gid	= ip->i_d.di_gid;
+	inode->i_tag	= ip->i_d.di_tag;
 
 	switch (inode->i_mode & S_IFMT) {
 	case S_IFBLK:
--- linux-2.6.16-rc1/fs/xfs/linux-2.6/xfs_vnode.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/linux-2.6/xfs_vnode.c	2006-01-25 05:34:51 +0100
@@ -103,6 +103,7 @@ vn_revalidate_core(
 	inode->i_nlink	    = vap->va_nlink;
 	inode->i_uid	    = vap->va_uid;
 	inode->i_gid	    = vap->va_gid;
+	inode->i_tag	    = vap->va_tag;
 	inode->i_blocks	    = vap->va_nblocks;
 	inode->i_mtime	    = vap->va_mtime;
 	inode->i_ctime	    = vap->va_ctime;
--- linux-2.6.16-rc1/fs/xfs/linux-2.6/xfs_vnode.h	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/linux-2.6/xfs_vnode.h	2006-01-25 05:34:51 +0100
@@ -386,6 +386,7 @@ typedef struct vattr {
 	xfs_nlink_t	va_nlink;	/* number of references to file */
 	uid_t		va_uid;		/* owner user id */
 	gid_t		va_gid;		/* owner group id */
+	tag_t		va_tag;		/* owner group id */
 	xfs_ino_t	va_nodeid;	/* file id */
 	xfs_off_t	va_size;	/* file size in bytes */
 	u_long		va_blocksize;	/* blocksize preferred for i/o */
--- linux-2.6.16-rc1/fs/xfs/xfs_dinode.h	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/xfs_dinode.h	2006-01-25 05:34:51 +0100
@@ -53,7 +53,8 @@ typedef struct xfs_dinode_core
 	__uint32_t	di_gid;		/* owner's group id */
 	__uint32_t	di_nlink;	/* number of links to file */
 	__uint16_t	di_projid;	/* owner's project id */
-	__uint8_t	di_pad[8];	/* unused, zeroed space */
+	__uint16_t	di_tag;		/* context tagging */
+	__uint8_t	di_pad[6];	/* unused, zeroed space */
 	__uint16_t	di_flushiter;	/* incremented on flush */
 	xfs_timestamp_t	di_atime;	/* time last accessed */
 	xfs_timestamp_t	di_mtime;	/* time last modified */
--- linux-2.6.16-rc1/fs/xfs/xfs_fs.h	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/xfs_fs.h	2006-01-25 05:34:51 +0100
@@ -295,7 +297,8 @@ typedef struct xfs_bstat {
 	__s32		bs_extents;	/* number of extents		*/
 	__u32		bs_gen;		/* generation count		*/
 	__u16		bs_projid;	/* project id			*/
-	unsigned char	bs_pad[14];	/* pad space, unused		*/
+	__u16		bs_tag;		/* context tagging		*/
+	unsigned char	bs_pad[12];	/* pad space, unused		*/
 	__u32		bs_dmevmask;	/* DMIG event mask		*/
 	__u16		bs_dmstate;	/* DMIG state info		*/
 	__u16		bs_aextents;	/* attribute number of extents	*/
--- linux-2.6.16-rc1/fs/xfs/xfs_inode.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/xfs_inode.c	2006-01-25 05:34:51 +0100
@@ -734,6 +735,8 @@ xfs_xlate_dinode_core(
 	xfs_dinode_core_t	*buf_core = (xfs_dinode_core_t *)buf;
 	xfs_dinode_core_t	*mem_core = (xfs_dinode_core_t *)dip;
 	xfs_arch_t		arch = ARCH_CONVERT;
+	uint32_t		uid = 0, gid = 0;
+	uint16_t		tag = 0;
 
 	ASSERT(dir);
 
--- linux-2.6.16-rc1/fs/xfs/xfs_inode.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/xfs_inode.c	2006-01-25 05:34:51 +0100
@@ -737,6 +740,14 @@ *****
 
 	ASSERT(dir);
 
+	if (dir < 0) {
+		tag = mem_core->di_tag;
+		/* FIXME: supposed to use superblock flag */
+		uid = TAGINO_UID(1, mem_core->di_uid, tag);
+		gid = TAGINO_GID(1, mem_core->di_gid, tag);
+		tag = TAGINO_TAG(1, tag);
+	}
+
 	INT_XLATE(buf_core->di_magic, mem_core->di_magic, dir, arch);
 	INT_XLATE(buf_core->di_mode, mem_core->di_mode, dir, arch);
 	INT_XLATE(buf_core->di_version,	mem_core->di_version, dir, arch);
--- linux-2.6.16-rc1/fs/xfs/xfs_inode.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/xfs_inode.c	2006-01-25 05:34:51 +0100
@@ -742,8 +753,9 @@ *****
 	INT_XLATE(buf_core->di_version,	mem_core->di_version, dir, arch);
 	INT_XLATE(buf_core->di_format, mem_core->di_format, dir, arch);
 	INT_XLATE(buf_core->di_onlink, mem_core->di_onlink, dir, arch);
-	INT_XLATE(buf_core->di_uid, mem_core->di_uid, dir, arch);
-	INT_XLATE(buf_core->di_gid, mem_core->di_gid, dir, arch);
+	INT_XLATE(buf_core->di_uid, uid, dir, arch);
+	INT_XLATE(buf_core->di_gid, gid, dir, arch);
+	INT_XLATE(buf_core->di_tag, tag, dir, arch);
 	INT_XLATE(buf_core->di_nlink, mem_core->di_nlink, dir, arch);
 	INT_XLATE(buf_core->di_projid, mem_core->di_projid, dir, arch);
 
--- linux-2.6.16-rc1/fs/xfs/xfs_inode.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/xfs_inode.c	2006-01-25 05:34:51 +0100
@@ -748,6 +760,10 @@ *****
 	INT_XLATE(buf_core->di_projid, mem_core->di_projid, dir, arch);
 
 	if (dir > 0) {
+		/* FIXME: supposed to use superblock flag */
+		mem_core->di_uid = INOTAG_UID(1, uid, gid);
+		mem_core->di_gid = INOTAG_GID(1, uid, gid);
+		mem_core->di_tag = INOTAG_TAG(1, uid, gid, tag);
 		memcpy(mem_core->di_pad, buf_core->di_pad,
 			sizeof(buf_core->di_pad));
 	} else {
--- linux-2.6.16-rc1/fs/xfs/xfs_itable.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/xfs_itable.c	2006-01-25 05:34:51 +0100
@@ -85,6 +85,7 @@ xfs_bulkstat_one_iget(
 	buf->bs_mode = dic->di_mode;
 	buf->bs_uid = dic->di_uid;
 	buf->bs_gid = dic->di_gid;
+	buf->bs_tag = dic->di_tag;
 	buf->bs_size = dic->di_size;
 	vn_atime_to_bstime(vp, &buf->bs_atime);
 	buf->bs_mtime.tv_sec = dic->di_mtime.t_sec;
--- linux-2.6.16-rc1/fs/xfs/xfs_itable.c	2006-01-26 22:35:13 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/xfs_itable.c	2006-01-25 05:34:51 +0100
@@ -159,6 +160,7 @@ xfs_bulkstat_one_dinode(
 	buf->bs_mode = INT_GET(dic->di_mode, ARCH_CONVERT);
 	buf->bs_uid = INT_GET(dic->di_uid, ARCH_CONVERT);
 	buf->bs_gid = INT_GET(dic->di_gid, ARCH_CONVERT);
+	buf->bs_tag = INT_GET(dic->di_tag, ARCH_CONVERT);
 	buf->bs_size = INT_GET(dic->di_size, ARCH_CONVERT);
 	buf->bs_atime.tv_sec = INT_GET(dic->di_atime.t_sec, ARCH_CONVERT);
 	buf->bs_atime.tv_nsec = INT_GET(dic->di_atime.t_nsec, ARCH_CONVERT);
--- linux-2.6.16-rc1/fs/xfs/xfs_vnodeops.c	2006-01-26 22:35:14 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9.4/fs/xfs/xfs_vnodeops.c	2006-01-25 05:34:51 +0100
@@ -446,10 +451,12 @@ xfs_setattr(
 		 * would have changed also.
 		 */
 		iuid = ip->i_d.di_uid;
-		iprojid = ip->i_d.di_projid;
 		igid = ip->i_d.di_gid;
-		gid = (mask & XFS_AT_GID) ? vap->va_gid : igid;
+		itag = ip->i_d.di_tag;
+		iprojid = ip->i_d.di_projid;
 		uid = (mask & XFS_AT_UID) ? vap->va_uid : iuid;
+		gid = (mask & XFS_AT_GID) ? vap->va_gid : igid;
+		tag = (mask & XFS_AT_TAG) ? vap->va_tag : itag;
 		projid = (mask & XFS_AT_PROJID) ? (xfs_prid_t)vap->va_projid :
 			 iprojid;
 
--- linux-2.6.16-rc1/include/linux/ext2_fs.h	2005-10-28 20:49:54 +0200
+++ linux-2.6.16-rc1-vs2.1.0.9.4/include/linux/ext2_fs.h	2006-01-25 05:34:51 +0100
@@ -240,7 +247,7 @@ struct ext2_inode {
 		struct {
 			__u8	l_i_frag;	/* Fragment number */
 			__u8	l_i_fsize;	/* Fragment size */
-			__u16	i_pad1;
+			__u16	l_i_tag;	/* Context Tag */
 			__le16	l_i_uid_high;	/* these 2 fields    */
 			__le16	l_i_gid_high;	/* were reserved2[0] */
 			__u32	l_i_reserved2;
--- linux-2.6.16-rc1/include/linux/ext2_fs.h	2005-10-28 20:49:54 +0200
+++ linux-2.6.16-rc1-vs2.1.0.9.4/include/linux/ext2_fs.h	2006-01-25 05:34:51 +0100
@@ -272,6 +279,7 @@ struct ext2_inode {
 #define i_gid_low	i_gid
 #define i_uid_high	osd2.linux2.l_i_uid_high
 #define i_gid_high	osd2.linux2.l_i_gid_high
+#define i_raw_tag	osd2.linux2.l_i_tag
 #define i_reserved2	osd2.linux2.l_i_reserved2
 #endif
 
--- linux-2.6.16-rc1/include/linux/ext3_fs.h	2005-10-28 20:49:54 +0200
+++ linux-2.6.16-rc1-vs2.1.0.9.4/include/linux/ext3_fs.h	2006-01-25 05:34:51 +0100
@@ -287,7 +297,7 @@ struct ext3_inode {
 		struct {
 			__u8	l_i_frag;	/* Fragment number */
 			__u8	l_i_fsize;	/* Fragment size */
-			__u16	i_pad1;
+			__u16	l_i_tag;	/* Context Tag */
 			__le16	l_i_uid_high;	/* these 2 fields    */
 			__le16	l_i_gid_high;	/* were reserved2[0] */
 			__u32	l_i_reserved2;
--- linux-2.6.16-rc1/include/linux/ext3_fs.h	2005-10-28 20:49:54 +0200
+++ linux-2.6.16-rc1-vs2.1.0.9.4/include/linux/ext3_fs.h	2006-01-25 05:34:51 +0100
@@ -321,6 +331,7 @@ struct ext3_inode {
 #define i_gid_low	i_gid
 #define i_uid_high	osd2.linux2.l_i_uid_high
 #define i_gid_high	osd2.linux2.l_i_gid_high
+#define i_raw_tag	osd2.linux2.l_i_tag
 #define i_reserved2	osd2.linux2.l_i_reserved2
 
 #elif defined(__GNU__)
