diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/attr.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/attr.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/attr.c 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/attr.c 2006-01-25 05:34:51 +0100 @@ -71,11 +71,13 @@ int inode_change_ok(struct inode *inode, } switch (inode->i_sb->s_magic) { case PROC_SUPER_MAGIC: + /* maybe allow that in the future? */ vxwprintk(1, "xid=%d messing with the procfs.", vx_current_xid()); goto error; case DEVPTS_SUPER_MAGIC: - if (vx_check(inode->i_xid, VX_IDENT)) + /* devpts is xid tagged */ + if (vx_check((xid_t)inode->i_tag, VX_IDENT)) goto fine; vxwprintk(1, "xid=%d messing with the devpts.", vx_current_xid()); @@ -104,8 +106,8 @@ int inode_setattr(struct inode * inode, inode->i_uid = attr->ia_uid; if (ia_valid & ATTR_GID) inode->i_gid = attr->ia_gid; - if ((ia_valid & ATTR_XID) && IS_TAGXID(inode)) - inode->i_xid = attr->ia_xid; + if ((ia_valid & ATTR_TAG) && IS_TAGGED(inode)) + inode->i_tag = attr->ia_tag; if (ia_valid & ATTR_ATIME) inode->i_atime = timespec_trunc(attr->ia_atime, inode->i_sb->s_time_gran); @@ -181,7 +183,7 @@ int notify_change(struct dentry * dentry if (!error) { if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid) || - (ia_valid & ATTR_XID && attr->ia_xid != inode->i_xid)) + (ia_valid & ATTR_TAG && attr->ia_tag != inode->i_tag)) error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0; if (!error) error = inode_setattr(inode, attr); diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/devpts/inode.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/devpts/inode.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/devpts/inode.c 2006-01-21 18:28:11 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/devpts/inode.c 2006-01-25 05:34:51 +0100 @@ -24,7 +24,8 @@ static int devpts_permission(struct inod { int ret = -EACCES; - if (vx_check(inode->i_xid, VX_IDENT)) + /* devpts is xid tagged */ + if (vx_check((xid_t)inode->i_tag, VX_IDENT)) ret = generic_permission(inode, mask, NULL); return ret; } @@ -83,7 +84,8 @@ static int devpts_remount(struct super_b static int devpts_filter(struct dentry *de) { - return vx_check(de->d_inode->i_xid, VX_IDENT); + /* devpts is xid tagged */ + return vx_check((xid_t)de->d_inode->i_tag, VX_IDENT); } static int devpts_readdir(struct file * filp, void * dirent, filldir_t filldir) @@ -127,7 +129,8 @@ devpts_fill_super(struct super_block *s, inode->i_op = &simple_dir_inode_operations; inode->i_fop = &devpts_dir_operations; inode->i_nlink = 2; - inode->i_xid = vx_current_xid(); + /* devpts is xid tagged */ + inode->i_tag = (tag_t)vx_current_xid(); devpts_root = s->s_root = d_alloc_root(inode); if (s->s_root) @@ -186,7 +189,8 @@ int devpts_pty_new(struct tty_struct *tt inode->i_gid = config.setgid ? config.gid : current->fsgid; inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; init_special_inode(inode, S_IFCHR|config.mode, device); - inode->i_xid = vx_current_xid(); + /* devpts is xid tagged */ + inode->i_tag = (tag_t)vx_current_xid(); inode->i_op = &devpts_file_inode_operations; inode->u.generic_ip = tty; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext2/balloc.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext2/balloc.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext2/balloc.c 2006-01-21 18:28:14 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext2/balloc.c 2006-01-25 05:34:51 +0100 @@ -18,6 +18,7 @@ #include #include #include +#include /* * balloc.c contains the blocks allocation and deallocation routines @@ -110,7 +111,7 @@ static int reserve_blocks(struct super_b free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter); root_blocks = le32_to_cpu(es->s_r_blocks_count); - DLIMIT_ADJUST_BLOCK(sb, vx_current_xid(), &free_blocks, &root_blocks); + DLIMIT_ADJUST_BLOCK(sb, dx_current_tag(), &free_blocks, &root_blocks); if (free_blocks < count) count = free_blocks; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext2/ialloc.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext2/ialloc.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext2/ialloc.c 2006-01-21 18:28:16 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext2/ialloc.c 2006-01-25 05:34:51 +0100 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "ext2.h" #include "xattr.h" #include "acl.h" @@ -468,7 +468,7 @@ struct inode *ext2_new_inode(struct inod if (!inode) return ERR_PTR(-ENOMEM); - inode->i_xid = vx_current_fsxid(sb); + inode->i_tag = dx_current_fstag(sb); if (DLIMIT_ALLOC_INODE(inode)) { err = -ENOSPC; goto fail_dlim; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext2/inode.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext2/inode.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext2/inode.c 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext2/inode.c 2006-01-25 05:34:51 +0100 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "ext2.h" #include "acl.h" #include "xip.h" @@ -1140,10 +1140,10 @@ void ext2_read_inode (struct inode * ino uid |= le16_to_cpu(raw_inode->i_uid_high) << 16; gid |= le16_to_cpu(raw_inode->i_gid_high) << 16; } - inode->i_uid = INOXID_UID(XID_TAG(inode), uid, gid); - inode->i_gid = INOXID_GID(XID_TAG(inode), uid, gid); - inode->i_xid = INOXID_XID(XID_TAG(inode), uid, gid, - le16_to_cpu(raw_inode->i_raw_xid)); + 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); @@ -1242,8 +1242,8 @@ static int ext2_update_inode(struct inod struct ext2_inode_info *ei = EXT2_I(inode); struct super_block *sb = inode->i_sb; ino_t ino = inode->i_ino; - uid_t uid = XIDINO_UID(XID_TAG(inode), inode->i_uid, inode->i_xid); - gid_t gid = XIDINO_GID(XID_TAG(inode), inode->i_gid, inode->i_xid); + 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); struct buffer_head * bh; struct ext2_inode * raw_inode = ext2_get_inode(sb, ino, &bh); int n; @@ -1278,8 +1278,8 @@ static int ext2_update_inode(struct inod raw_inode->i_uid_high = 0; raw_inode->i_gid_high = 0; } -#ifdef CONFIG_INOXID_INTERN - raw_inode->i_raw_xid = cpu_to_le16(inode->i_xid); +#ifdef CONFIG_TAGGING_INTERN + raw_inode->i_raw_tag = cpu_to_le16(inode->i_tag); #endif raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); raw_inode->i_size = cpu_to_le32(inode->i_size); @@ -1368,7 +1368,7 @@ int ext2_setattr(struct dentry *dentry, return error; if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) || (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid) || - (iattr->ia_valid & ATTR_XID && iattr->ia_xid != inode->i_xid)) { + (iattr->ia_valid & ATTR_TAG && iattr->ia_tag != inode->i_tag)) { error = DQUOT_TRANSFER(inode, iattr) ? -EDQUOT : 0; if (error) return error; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext2/namei.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext2/namei.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext2/namei.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext2/namei.c 2006-01-25 05:34:51 +0100 @@ -31,7 +31,7 @@ */ #include -#include +#include #include "ext2.h" #include "xattr.h" #include "acl.h" @@ -83,7 +83,7 @@ static struct dentry *ext2_lookup(struct inode = iget(dir->i_sb, ino); if (!inode) return ERR_PTR(-EACCES); - vx_propagate_xid(nd, inode); + dx_propagate_tag(nd, inode); } return d_splice_alias(inode, dentry); } diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext2/super.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext2/super.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext2/super.c 2006-01-21 18:28:18 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext2/super.c 2006-01-25 08:05:49 +0100 @@ -284,7 +284,7 @@ enum { Opt_err_ro, Opt_nouid32, Opt_nocheck, Opt_debug, Opt_oldalloc, Opt_orlov, Opt_nobh, Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, Opt_xip, Opt_ignore, Opt_err, Opt_quota, - Opt_usrquota, Opt_grpquota, Opt_tagxid + Opt_usrquota, Opt_grpquota, Opt_tag, Opt_notag, Opt_tagid }; static match_table_t tokens = { @@ -312,7 +312,10 @@ static match_table_t tokens = { {Opt_acl, "acl"}, {Opt_noacl, "noacl"}, {Opt_xip, "xip"}, - {Opt_tagxid, "tagxid"}, + {Opt_tag, "tag"}, + {Opt_notag, "notag"}, + {Opt_tagid, "tagid=%u"}, + {Opt_tag, "tagxid"}, {Opt_grpquota, "grpquota"}, {Opt_ignore, "noquota"}, {Opt_quota, "quota"}, @@ -376,9 +379,18 @@ static int parse_options (char * options case Opt_nouid32: set_opt (sbi->s_mount_opt, NO_UID32); break; -#ifndef CONFIG_INOXID_NONE - case Opt_tagxid: - set_opt (sbi->s_mount_opt, TAGXID); +#ifndef CONFIG_TAGGING_NONE + case Opt_tag: + set_opt (sbi->s_mount_opt, TAGGED); + break; + case Opt_notag: + clear_opt (sbi->s_mount_opt, TAGGED); + break; +#endif +#ifdef CONFIG_PROPAGATE + case Opt_tagid: + /* use args[0] */ + set_opt (sbi->s_mount_opt, TAGGED); break; #endif case Opt_nocheck: @@ -682,8 +694,8 @@ static int ext2_fill_super(struct super_ if (!parse_options ((char *) data, sbi)) goto failed_mount; - if (EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_TAGXID) - sb->s_flags |= MS_TAGXID; + if (EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_TAGGED) + sb->s_flags |= MS_TAGGED; sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | ((EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); @@ -993,9 +1005,9 @@ static int ext2_remount (struct super_bl goto restore_opts; } - if ((sbi->s_mount_opt & EXT2_MOUNT_TAGXID) && - !(sb->s_flags & MS_TAGXID)) { - printk("EXT2-fs: %s: tagxid not permitted on remount.\n", + if ((sbi->s_mount_opt & EXT2_MOUNT_TAGGED) && + !(sb->s_flags & MS_TAGGED)) { + printk("EXT2-fs: %s: tagging not permitted on remount.\n", sb->s_id); return -EINVAL; } diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/balloc.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/balloc.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/balloc.c 2006-01-21 18:28:14 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/balloc.c 2006-01-25 05:34:51 +0100 @@ -21,6 +21,7 @@ #include #include #include +#include /* * balloc.c contains the blocks allocation and deallocation routines @@ -1131,7 +1132,7 @@ static int ext3_has_free_blocks(struct s "ext3_has_free_blocks(%p): free=%u, root=%u", sb, free_blocks, root_blocks); - DLIMIT_ADJUST_BLOCK(sb, vx_current_xid(), &free_blocks, &root_blocks); + DLIMIT_ADJUST_BLOCK(sb, dx_current_tag(), &free_blocks, &root_blocks); cond = (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) && diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/ialloc.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/ialloc.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/ialloc.c 2006-01-21 18:28:14 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/ialloc.c 2006-01-25 05:34:51 +0100 @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include @@ -447,7 +447,7 @@ struct inode *ext3_new_inode(handle_t *h if (!inode) return ERR_PTR(-ENOMEM); - inode->i_xid = vx_current_fsxid(sb); + inode->i_tag = dx_current_fstag(sb); if (DLIMIT_ALLOC_INODE(inode)) { err = -ENOSPC; goto out_dlimit; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/inode.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/inode.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/inode.c 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/inode.c 2006-01-25 05:34:51 +0100 @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include "xattr.h" #include "acl.h" @@ -2527,10 +2527,10 @@ void ext3_read_inode(struct inode * inod uid |= le16_to_cpu(raw_inode->i_uid_high) << 16; gid |= le16_to_cpu(raw_inode->i_gid_high) << 16; } - inode->i_uid = INOXID_UID(XID_TAG(inode), uid, gid); - inode->i_gid = INOXID_GID(XID_TAG(inode), uid, gid); - inode->i_xid = INOXID_XID(XID_TAG(inode), uid, gid, - le16_to_cpu(raw_inode->i_raw_xid)); + 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); @@ -2658,8 +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 = XIDINO_UID(XID_TAG(inode), inode->i_uid, inode->i_xid); - gid_t gid = XIDINO_GID(XID_TAG(inode), inode->i_gid, inode->i_xid); + 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, @@ -2692,8 +2692,8 @@ static int ext3_do_update_inode(handle_t raw_inode->i_uid_high = 0; raw_inode->i_gid_high = 0; } -#ifdef CONFIG_INOXID_INTERN - raw_inode->i_raw_xid = cpu_to_le16(inode->i_xid); +#ifdef CONFIG_TAGGING_INTERN + raw_inode->i_raw_tag = cpu_to_le16(inode->i_tag); #endif raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); raw_inode->i_size = cpu_to_le32(ei->i_disksize); @@ -2848,7 +2848,7 @@ int ext3_setattr(struct dentry *dentry, if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid) || - (ia_valid & ATTR_XID && attr->ia_xid != inode->i_xid)) { + (ia_valid & ATTR_TAG && attr->ia_tag != inode->i_tag)) { handle_t *handle; /* (user+group)*(old+new) structure, inode write (sb, @@ -2870,8 +2870,8 @@ int ext3_setattr(struct dentry *dentry, inode->i_uid = attr->ia_uid; if (attr->ia_valid & ATTR_GID) inode->i_gid = attr->ia_gid; - if ((attr->ia_valid & ATTR_XID) && IS_TAGXID(inode)) - inode->i_xid = attr->ia_xid; + if ((attr->ia_valid & ATTR_TAG) && IS_TAGGED(inode)) + inode->i_tag = attr->ia_tag; error = ext3_mark_inode_dirty(handle, inode); ext3_journal_stop(handle); } diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/ioctl.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/ioctl.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/ioctl.c 2006-01-21 18:28:16 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/ioctl.c 2006-01-25 05:34:51 +0100 @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include @@ -246,11 +246,11 @@ flags_err: return err; } -#if defined(CONFIG_VSERVER_LEGACY) && !defined(CONFIG_INOXID_NONE) - case EXT3_IOC_SETXID: { +#if defined(CONFIG_VSERVER_LEGACY) && !defined(CONFIG_TAGGING_NONE) + case EXT3_IOC_SETTAG: { handle_t *handle; struct ext3_iloc iloc; - int xid; + int tag; int err; /* fixme: if stealth, return -ENOTTY */ @@ -258,9 +258,9 @@ flags_err: return -EPERM; if (IS_RDONLY(inode)) return -EROFS; - if (!(inode->i_sb->s_flags & MS_TAGXID)) + if (!(inode->i_sb->s_flags & MS_TAGGED)) return -ENOSYS; - if (get_user(xid, (int *) arg)) + if (get_user(tag, (int *) arg)) return -EFAULT; handle = ext3_journal_start(inode, 1); @@ -270,7 +270,7 @@ flags_err: if (err) return err; - inode->i_xid = (xid & 0xFFFF); + inode->i_tag = (tag & 0xFFFF); inode->i_ctime = CURRENT_TIME; err = ext3_mark_iloc_dirty(handle, inode, &iloc); diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/namei.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/namei.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/namei.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/namei.c 2006-01-25 05:34:51 +0100 @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include "namei.h" #include "xattr.h" @@ -1005,7 +1005,7 @@ static struct dentry *ext3_lookup(struct if (!inode) return ERR_PTR(-EACCES); - vx_propagate_xid(nd, inode); + dx_propagate_tag(nd, inode); } return d_splice_alias(inode, dentry); } diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/super.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/super.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ext3/super.c 2006-01-21 18:28:18 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ext3/super.c 2006-01-25 08:05:58 +0100 @@ -634,7 +634,7 @@ enum { Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota, - Opt_grpquota, Opt_tagxid + Opt_grpquota, Opt_tag, Opt_notag, Opt_tagid }; static match_table_t tokens = { @@ -683,7 +683,10 @@ static match_table_t tokens = { {Opt_quota, "quota"}, {Opt_usrquota, "usrquota"}, {Opt_barrier, "barrier=%u"}, - {Opt_tagxid, "tagxid"}, + {Opt_tag, "tag"}, + {Opt_notag, "notag"}, + {Opt_tagid, "tagid=%u"}, + {Opt_tag, "tagxid"}, {Opt_err, NULL}, {Opt_resize, "resize"}, }; @@ -776,9 +779,18 @@ static int parse_options (char *options, case Opt_nouid32: set_opt (sbi->s_mount_opt, NO_UID32); break; -#ifndef CONFIG_INOXID_NONE - case Opt_tagxid: - set_opt (sbi->s_mount_opt, TAGXID); +#ifndef CONFIG_TAGGING_NONE + case Opt_tag: + set_opt (sbi->s_mount_opt, TAGGED); + break; + case Opt_notag: + clear_opt (sbi->s_mount_opt, TAGGED); + break; +#endif +#ifdef CONFIG_PROPAGATE + case Opt_tagid: + /* use args[0] */ + set_opt (sbi->s_mount_opt, TAGGED); break; #endif case Opt_nocheck: @@ -1435,8 +1447,8 @@ static int ext3_fill_super (struct super NULL, 0)) goto failed_mount; - if (EXT3_SB(sb)->s_mount_opt & EXT3_MOUNT_TAGXID) - sb->s_flags |= MS_TAGXID; + if (EXT3_SB(sb)->s_mount_opt & EXT3_MOUNT_TAGGED) + sb->s_flags |= MS_TAGGED; sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | ((sbi->s_mount_opt & EXT3_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); @@ -2247,9 +2259,9 @@ static int ext3_remount (struct super_bl if (sbi->s_mount_opt & EXT3_MOUNT_ABORT) ext3_abort(sb, __FUNCTION__, "Abort forced by user"); - if ((sbi->s_mount_opt & EXT3_MOUNT_TAGXID) && - !(sb->s_flags & MS_TAGXID)) { - printk("EXT3-fs: %s: tagxid not permitted on remount.\n", + if ((sbi->s_mount_opt & EXT3_MOUNT_TAGGED) && + !(sb->s_flags & MS_TAGGED)) { + printk("EXT3-fs: %s: tagging not permitted on remount.\n", sb->s_id); return -EINVAL; } diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/inode.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/inode.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/inode.c 2006-01-21 18:28:18 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/inode.c 2006-01-25 05:34:51 +0100 @@ -118,7 +118,7 @@ static struct inode *alloc_inode(struct inode->i_sb = sb; /* essential because of inode slab reuse */ - inode->i_xid = 0; + inode->i_tag = 0; inode->i_blkbits = sb->s_blocksize_bits; inode->i_flags = 0; atomic_set(&inode->i_count, 1); diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/ioctl.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ioctl.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/ioctl.c 2006-01-21 18:28:14 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/ioctl.c 2006-01-25 05:34:51 +0100 @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include @@ -157,19 +157,19 @@ int vfs_ioctl(struct file *filp, unsigne error = -ENOTTY; break; #ifdef CONFIG_VSERVER_LEGACY -#ifndef CONFIG_INOXID_NONE - case FIOC_GETXID: { +#ifndef CONFIG_TAGGING_NONE + case FIOC_GETTAG: { struct inode *inode = filp->f_dentry->d_inode; /* fixme: if stealth, return -ENOTTY */ error = -EPERM; if (capable(CAP_CONTEXT)) - error = put_user(inode->i_xid, (int *) arg); + error = put_user(inode->i_tag, (int *) arg); break; } - case FIOC_SETXID: { + case FIOC_SETTAG: { struct inode *inode = filp->f_dentry->d_inode; - int xid; + int tag; /* fixme: if stealth, return -ENOTTY */ error = -EPERM; @@ -179,13 +179,13 @@ int vfs_ioctl(struct file *filp, unsigne if (IS_RDONLY(inode)) break; error = -ENOSYS; - if (!(inode->i_sb->s_flags & MS_TAGXID)) + if (!(inode->i_sb->s_flags & MS_TAGGED)) break; error = -EFAULT; - if (get_user(xid, (int *) arg)) + if (get_user(tag, (int *) arg)) break; error = 0; - inode->i_xid = (xid & 0xFFFF); + inode->i_tag = (tag & 0xFFFF); inode->i_ctime = CURRENT_TIME; mark_inode_dirty(inode); break; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/acl.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/acl.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/acl.c 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/acl.c 2006-01-25 05:34:51 +0100 @@ -230,7 +230,7 @@ int jfs_setattr(struct dentry *dentry, s if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) || (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid) || - (iattr->ia_valid & ATTR_XID && iattr->ia_xid != inode->i_xid)) { + (iattr->ia_valid & ATTR_TAG && iattr->ia_tag != inode->i_tag)) { if (DQUOT_TRANSFER(inode, iattr)) return -EDQUOT; } diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/jfs_filsys.h linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/jfs_filsys.h --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/jfs_filsys.h 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/jfs_filsys.h 2006-01-25 05:34:51 +0100 @@ -84,7 +84,7 @@ #define JFS_DIR_INDEX 0x00200000 /* Persistant index for */ /* directory entries */ -#define JFS_TAGXID 0x00800000 /* xid tagging */ +#define JFS_TAGGED 0x00800000 /* Context Tagging */ /* * buffer cache configuration diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/jfs_imap.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/jfs_imap.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/jfs_imap.c 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/jfs_imap.c 2006-01-25 05:34:51 +0100 @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include "jfs_incore.h" #include "jfs_inode.h" @@ -3088,9 +3088,9 @@ static int copy_from_dinode(struct dinod uid = le32_to_cpu(dip->di_uid); gid = le32_to_cpu(dip->di_gid); - ip->i_uid = INOXID_UID(XID_TAG(ip), uid, gid); - ip->i_gid = INOXID_GID(XID_TAG(ip), uid, gid); - ip->i_xid = INOXID_XID(XID_TAG(ip), uid, gid, 0); + 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); @@ -3153,8 +3153,8 @@ static void copy_to_dinode(struct dinode dip->di_nblocks = cpu_to_le64(PBLK2LBLK(ip->i_sb, ip->i_blocks)); dip->di_nlink = cpu_to_le32(ip->i_nlink); - uid = XIDINO_UID(XID_TAG(ip), ip->i_uid, ip->i_xid); - gid = XIDINO_GID(XID_TAG(ip), ip->i_gid, ip->i_xid); + 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); /* diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/jfs_inode.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/jfs_inode.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/jfs_inode.c 2006-01-21 18:28:14 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/jfs_inode.c 2006-01-25 05:34:51 +0100 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "jfs_incore.h" #include "jfs_inode.h" #include "jfs_filsys.h" @@ -64,7 +64,7 @@ struct inode *ialloc(struct inode *paren } else inode->i_gid = current->fsgid; - inode->i_xid = vx_current_fsxid(sb); + inode->i_tag = dx_current_fstag(sb); if (DLIMIT_ALLOC_INODE(inode)) { iput(inode); return NULL; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/namei.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/namei.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/namei.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/namei.c 2006-01-25 05:34:51 +0100 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "jfs_incore.h" #include "jfs_superblock.h" #include "jfs_inode.h" @@ -1466,7 +1466,7 @@ static struct dentry *jfs_lookup(struct return ERR_PTR(-EACCES); } - vx_propagate_xid(nd, ip); + dx_propagate_tag(nd, ip); dentry = d_splice_alias(ip, dentry); if (dentry && (JFS_SBI(dip->i_sb)->mntflag & JFS_OS2)) diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/super.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/super.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/jfs/super.c 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/jfs/super.c 2006-01-25 08:06:05 +0100 @@ -195,7 +195,7 @@ static void jfs_put_super(struct super_b enum { Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize, Opt_resize_nosize, Opt_errors, Opt_ignore, Opt_err, Opt_quota, - Opt_usrquota, Opt_grpquota, Opt_tagxid + Opt_usrquota, Opt_grpquota, Opt_tag, Opt_notag, Opt_tagid }; static match_table_t tokens = { @@ -205,7 +205,10 @@ static match_table_t tokens = { {Opt_resize, "resize=%u"}, {Opt_resize_nosize, "resize"}, {Opt_errors, "errors=%s"}, - {Opt_tagxid, "tagxid"}, + {Opt_tag, "tag"}, + {Opt_notag, "notag"}, + {Opt_tagid, "tagid=%u"}, + {Opt_tag, "tagxid"}, {Opt_ignore, "noquota"}, {Opt_ignore, "quota"}, {Opt_usrquota, "usrquota"}, @@ -314,11 +317,21 @@ static int parse_options(char *options, "JFS: quota operations not supported\n"); break; #endif -#ifndef CONFIG_INOXID_NONE - case Opt_tagxid: - *flag |= JFS_TAGXID; +#ifndef CONFIG_TAGGING_NONE + case Opt_tag: + *flag |= JFS_TAGGED; + break; + case Opt_notag: + *flag &= JFS_TAGGED; + break; +#endif +#ifdef CONFIG_PROPAGATE + case Opt_tagid: + /* use args[0] */ + *flag |= JFS_TAGGED; break; #endif + default: printk("jfs: Unrecognized mount option \"%s\" " " or missing value\n", p); @@ -350,8 +363,8 @@ static int jfs_remount(struct super_bloc return -EINVAL; } - if ((flag & JFS_TAGXID) && !(sb->s_flags & MS_TAGXID)) { - printk(KERN_ERR "JFS: %s: tagxid not permitted on remount.\n", + if ((flag & JFS_TAGGED) && !(sb->s_flags & MS_TAGGED)) { + printk(KERN_ERR "JFS: %s: tagging not permitted on remount.\n", sb->s_id); return -EINVAL; } @@ -428,8 +441,8 @@ static int jfs_fill_super(struct super_b sb->s_flags |= MS_POSIXACL; #endif /* map mount option tagxid */ - if (sbi->flag & JFS_TAGXID) - sb->s_flags |= MS_TAGXID; + if (sbi->flag & JFS_TAGGED) + sb->s_flags |= MS_TAGGED; if (newLVSize) { printk(KERN_ERR "resize option for remount only\n"); diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/namei.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/namei.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/namei.c 2006-01-21 19:15:18 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/namei.c 2006-01-25 05:34:51 +0100 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -226,20 +227,20 @@ int generic_permission(struct inode *ino return -EACCES; } -static inline int xid_permission(struct inode *inode, int mask, struct nameidata *nd) +static inline int dx_permission(struct inode *inode, int mask, struct nameidata *nd) { if (IS_BARRIER(inode) && !vx_check(0, VX_ADMIN)) { vxwprintk(1, "xid=%d did hit the barrier.", vx_current_xid()); return -EACCES; } - if (inode->i_xid == 0) + if (inode->i_tag == 0) return 0; - if (vx_check(inode->i_xid, VX_ADMIN|VX_WATCH|VX_IDENT)) + if (dx_check(inode->i_tag, DX_ADMIN|DX_WATCH|DX_IDENT)) return 0; vxwprintk(1, "xid=%d denied access to %p[#%d,%lu] »%s«.", - vx_current_xid(), inode, inode->i_xid, inode->i_ino, + vx_current_xid(), inode, inode->i_tag, inode->i_ino, vxd_path(nd->dentry, nd->mnt)); return -EACCES; } @@ -268,7 +269,7 @@ int permission(struct inode *inode, int /* Ordinary permission routines do not understand MAY_APPEND. */ submask = mask & ~MAY_APPEND; - if ((retval = xid_permission(inode, mask, nd))) + if ((retval = dx_permission(inode, mask, nd))) return retval; if (inode->i_op && inode->i_op->permission) retval = inode->i_op->permission(inode, submask, nd); @@ -770,14 +771,14 @@ static int do_lookup(struct nameidata *n inode = dentry->d_inode; if (!inode) goto done; - if (!vx_check(inode->i_xid, VX_WATCH|VX_ADMIN|VX_HOSTID|VX_IDENT)) - goto hidden; if (inode->i_sb->s_magic == PROC_SUPER_MAGIC) { struct proc_dir_entry *de = PDE(inode); if (de && !vx_hide_check(0, de->vx_flags)) goto hidden; } + if (!dx_check(inode->i_tag, DX_WATCH|DX_ADMIN|DX_HOSTID|DX_IDENT)) + goto hidden; done: path->mnt = mnt; path->dentry = dentry; @@ -785,7 +786,7 @@ done: return 0; hidden: vxwprintk(1, "xid=%d did lookup hidden %p[#%d,%lu] »%s«.", - vx_current_xid(), inode, inode->i_xid, inode->i_ino, + vx_current_xid(), inode, inode->i_tag, inode->i_ino, vxd_path(dentry, mnt)); dput(dentry); return -ENOENT; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/namespace.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/namespace.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/namespace.c 2006-01-21 18:28:16 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/namespace.c 2006-01-25 05:34:51 +0100 @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include "pnode.h" @@ -243,7 +243,7 @@ static struct vfsmount *clone_mnt(struct mnt->mnt_root = dget(root); mnt->mnt_mountpoint = mnt->mnt_root; mnt->mnt_parent = mnt; - mnt->mnt_xid = old->mnt_xid; + mnt->mnt_tag = old->mnt_tag; if (flag & CL_SLAVE) { list_add(&mnt->mnt_slave, &old->mnt_slave_list); @@ -392,7 +392,7 @@ static int show_vfsmnt(struct seq_file * { MS_SYNCHRONOUS, 0, ",sync", NULL }, { MS_DIRSYNC, 0, ",dirsync", NULL }, { MS_MANDLOCK, 0, ",mand", NULL }, - { MS_TAGXID, 0, ",tagxid", NULL }, + { MS_TAGGED, 0, ",tag", NULL }, { MS_NOATIME, MNT_NOATIME, ",noatime", NULL }, { MS_NODIRATIME, MNT_NODIRATIME, ",nodiratime", NULL }, { 0, MNT_NOSUID, ",nosuid", NULL }, @@ -429,8 +429,8 @@ static int show_vfsmnt(struct seq_file * seq_puts(m, p->unset_str); } } - if (mnt->mnt_flags & MNT_XID) - seq_printf(m, ",xid=%d", mnt->mnt_xid); + if (mnt->mnt_flags & MNT_TAGID) + seq_printf(m, ",tag=%d", mnt->mnt_tag); if (mnt->mnt_sb->s_op->show_options) err = mnt->mnt_sb->s_op->show_options(m, mnt); seq_puts(m, " 0 0\n"); @@ -931,7 +931,7 @@ static int do_change_type(struct nameida /* * do loopback mount. */ -static int do_loopback(struct nameidata *nd, char *old_name, xid_t xid, +static int do_loopback(struct nameidata *nd, char *old_name, tag_t tag, unsigned long flags, int mnt_flags) { struct nameidata old_nd; @@ -964,9 +964,9 @@ static int do_loopback(struct nameidata goto out; mnt->mnt_flags = mnt_flags; - if (flags & MS_XID) { - mnt->mnt_xid = xid; - mnt->mnt_flags |= MNT_XID; + if (flags & MS_TAGID) { + mnt->mnt_tag = tag; + mnt->mnt_flags |= MNT_TAGID; } err = graft_tree(mnt, nd); @@ -1348,7 +1348,7 @@ long do_mount(char *dev_name, char *dir_ struct nameidata nd; int retval = 0; int mnt_flags = 0; - xid_t xid = 0; + tag_t tag = 0; /* Discard magic */ if ((flags & MS_MGC_MSK) == MS_MGC_VAL) @@ -1364,13 +1364,13 @@ long do_mount(char *dev_name, char *dir_ if (data_page) ((char *)data_page)[PAGE_SIZE - 1] = 0; -#ifdef CONFIG_XID_PROPAGATE - retval = vx_parse_xid(data_page, &xid, 1); +#ifdef CONFIG_PROPAGATE + retval = dx_parse_tag(data_page, &tag, 1); if (retval) { - mnt_flags |= MNT_XID; - /* bind and re-mounts get xid flag */ + mnt_flags |= MNT_TAGID; + /* bind and re-mounts get the tag flag */ if (flags & (MS_BIND|MS_REMOUNT)) - flags |= MS_XID; + flags |= MS_TAGID; } #endif @@ -1402,9 +1402,9 @@ long do_mount(char *dev_name, char *dir_ if (flags & MS_REMOUNT) retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags, - data_page, xid); + data_page, tag); else if (flags & MS_BIND) - retval = do_loopback(&nd, dev_name, xid, flags, mnt_flags); + retval = do_loopback(&nd, dev_name, tag, flags, mnt_flags); else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)) retval = do_change_type(&nd, flags); else if (flags & MS_MOVE) diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfs/dir.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfs/dir.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfs/dir.c 2006-01-21 18:28:16 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfs/dir.c 2006-01-25 05:34:51 +0100 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "nfs4_fs.h" #include "delegation.h" @@ -870,7 +870,7 @@ static struct dentry *nfs_lookup(struct inode = nfs_fhget(dentry->d_sb, &fhandle, &fattr); if (!inode) goto out_unlock; - vx_propagate_xid(nd, inode); + dx_propagate_tag(nd, inode); no_entry: res = d_add_unique(dentry, inode); if (res != NULL) diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfs/inode.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfs/inode.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfs/inode.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfs/inode.c 2006-01-25 05:34:51 +0100 @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include @@ -337,8 +337,8 @@ nfs_sb_init(struct super_block *sb, rpc_ } server->backing_dev_info.ra_pages = server->rpages * NFS_MAX_READAHEAD; - if (server->flags & NFS_MOUNT_TAGXID) - sb->s_flags |= MS_TAGXID; + if (server->flags & NFS_MOUNT_TAGGED) + sb->s_flags |= MS_TAGGED; sb->s_maxbytes = fsinfo.maxfilesize; if (sb->s_maxbytes > MAX_LFS_FILESIZE) @@ -346,7 +346,7 @@ nfs_sb_init(struct super_block *sb, rpc_ server->client->cl_intr = (server->flags & NFS_MOUNT_INTR) ? 1 : 0; server->client->cl_softrtry = (server->flags & NFS_MOUNT_SOFT) ? 1 : 0; - server->client->cl_tagxid = (server->flags & NFS_MOUNT_TAGXID) ? 1 : 0; + server->client->cl_tag = (server->flags & NFS_MOUNT_TAGGED) ? 1 : 0; /* We're airborne Set socket buffersize */ rpc_setbufsize(server->client, server->wsize + 100, server->rsize + 100); @@ -418,7 +418,7 @@ nfs_create_client(struct nfs_server *ser clnt->cl_intr = 1; clnt->cl_softrtry = 1; - clnt->cl_tagxid = 1; + clnt->cl_tag = 1; return clnt; @@ -599,7 +599,7 @@ static int nfs_show_options(struct seq_f { NFS_MOUNT_NOAC, ",noac", "" }, { NFS_MOUNT_NONLM, ",nolock", ",lock" }, { NFS_MOUNT_NOACL, ",noacl", "" }, - { NFS_MOUNT_TAGXID, ",tagxid", "" }, + { NFS_MOUNT_TAGGED, ",tag", "" }, { 0, NULL, NULL } }; struct proc_nfs_info *nfs_infop; @@ -812,9 +812,9 @@ nfs_fhget(struct super_block *sb, struct nfsi->change_attr = fattr->change_attr; inode->i_size = nfs_size_to_loff_t(fattr->size); inode->i_nlink = fattr->nlink; - inode->i_uid = INOXID_UID(XID_TAG(inode), fattr->uid, fattr->gid); - inode->i_gid = INOXID_GID(XID_TAG(inode), fattr->uid, fattr->gid); - inode->i_xid = INOXID_XID(XID_TAG(inode), fattr->uid, fattr->gid, 0); + inode->i_uid = INOTAG_UID(DX_TAG(inode), fattr->uid, fattr->gid); + inode->i_gid = INOTAG_GID(DX_TAG(inode), fattr->uid, fattr->gid); + inode->i_tag = INOTAG_XID(DX_TAG(inode), fattr->uid, fattr->gid, 0); /* maybe fattr->xid someday */ if (fattr->valid & (NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4)) { /* @@ -906,8 +906,8 @@ void nfs_setattr_update_inode(struct ino inode->i_uid = attr->ia_uid; if ((attr->ia_valid & ATTR_GID) != 0) inode->i_gid = attr->ia_gid; - if ((attr->ia_valid & ATTR_XID) && IS_TAGXID(inode)) - inode->i_xid = attr->ia_xid; + if ((attr->ia_valid & ATTR_TAG) && IS_TAGGED(inode)) + inode->i_tag = attr->ia_tag; spin_lock(&inode->i_lock); NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; spin_unlock(&inode->i_lock); @@ -1355,7 +1355,7 @@ static int nfs_check_inode_attributes(st if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO) || inode->i_uid != uid || inode->i_gid != gid - || inode->i_xid != xid) + || inode->i_tag != tag) nfsi->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL; /* Has the link count changed? */ @@ -1520,21 +1520,21 @@ static int nfs_update_inode(struct inode } memcpy(&inode->i_atime, &fattr->atime, sizeof(inode->i_atime)); - uid = INOXID_UID(XID_TAG(inode), fattr->uid, fattr->gid); - gid = INOXID_GID(XID_TAG(inode), fattr->uid, fattr->gid); - xid = INOXID_XID(XID_TAG(inode), fattr->uid, fattr->gid, 0); + uid = INOTAG_UID(DX_TAG(inode), fattr->uid, fattr->gid); + gid = INOTAG_GID(DX_TAG(inode), fattr->uid, fattr->gid); + tag = INOTAG_TAG(DX_TAG(inode), fattr->uid, fattr->gid, 0); if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO) || inode->i_uid != uid || inode->i_gid != gid || - inode->i_xid != xid) + inode->i_tag != tag) invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; inode->i_mode = fattr->mode; inode->i_nlink = fattr->nlink; inode->i_uid = uid; inode->i_gid = gid; - inode->i_xid = xid; + inode->i_tag = tag; if (fattr->valid & (NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4)) { /* diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfs/nfs3xdr.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfs/nfs3xdr.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfs/nfs3xdr.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfs/nfs3xdr.c 2006-01-25 05:34:51 +0100 @@ -22,7 +22,7 @@ #include #include #include -#include +#include #define NFSDBG_FACILITY NFSDBG_XDR @@ -179,7 +179,7 @@ xdr_decode_fattr(u32 *p, struct nfs_fatt } static inline u32 * -xdr_encode_sattr(u32 *p, struct iattr *attr, int tagxid) +xdr_encode_sattr(u32 *p, struct iattr *attr, int tag) { if (attr->ia_valid & ATTR_MODE) { *p++ = xdr_one; @@ -188,16 +188,16 @@ xdr_encode_sattr(u32 *p, struct iattr *a *p++ = xdr_zero; } if (attr->ia_valid & ATTR_UID || - (tagxid && (attr->ia_valid & ATTR_XID))) { + (tag && (attr->ia_valid & ATTR_TAG))) { *p++ = xdr_one; - *p++ = htonl(XIDINO_UID(tagxid, attr->ia_uid, attr->ia_xid)); + *p++ = htonl(TAGINO_UID(tag, attr->ia_uid, attr->ia_tag)); } else { *p++ = xdr_zero; } if (attr->ia_valid & ATTR_GID || - (tagxid && (attr->ia_valid & ATTR_XID))) { + (tag && (attr->ia_valid & ATTR_TAG))) { *p++ = xdr_one; - *p++ = htonl(XIDINO_GID(tagxid, attr->ia_gid, attr->ia_xid)); + *p++ = htonl(TAGINO_GID(tag, attr->ia_gid, attr->ia_tag)); } else { *p++ = xdr_zero; } @@ -283,7 +283,7 @@ nfs3_xdr_sattrargs(struct rpc_rqst *req, { p = xdr_encode_fhandle(p, args->fh); p = xdr_encode_sattr(p, args->sattr, - req->rq_task->tk_client->cl_tagxid); + req->rq_task->tk_client->cl_tag); *p++ = htonl(args->guard); if (args->guard) p = xdr_encode_time3(p, &args->guardtime); @@ -375,7 +375,7 @@ nfs3_xdr_createargs(struct rpc_rqst *req *p++ = args->verifier[1]; } else p = xdr_encode_sattr(p, args->sattr, - req->rq_task->tk_client->cl_tagxid); + req->rq_task->tk_client->cl_tag); req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); return 0; @@ -390,7 +390,7 @@ nfs3_xdr_mkdirargs(struct rpc_rqst *req, p = xdr_encode_fhandle(p, args->fh); p = xdr_encode_array(p, args->name, args->len); p = xdr_encode_sattr(p, args->sattr, - req->rq_task->tk_client->cl_tagxid); + req->rq_task->tk_client->cl_tag); req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); return 0; } @@ -404,7 +404,7 @@ nfs3_xdr_symlinkargs(struct rpc_rqst *re p = xdr_encode_fhandle(p, args->fromfh); p = xdr_encode_array(p, args->fromname, args->fromlen); p = xdr_encode_sattr(p, args->sattr, - req->rq_task->tk_client->cl_tagxid); + req->rq_task->tk_client->cl_tag); p = xdr_encode_array(p, args->topath, args->tolen); req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); return 0; @@ -420,7 +420,7 @@ nfs3_xdr_mknodargs(struct rpc_rqst *req, p = xdr_encode_array(p, args->name, args->len); *p++ = htonl(args->type); p = xdr_encode_sattr(p, args->sattr, - req->rq_task->tk_client->cl_tagxid); + req->rq_task->tk_client->cl_tag); if (args->type == NF3CHR || args->type == NF3BLK) { *p++ = htonl(MAJOR(args->rdev)); *p++ = htonl(MINOR(args->rdev)); diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfs/nfsroot.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfs/nfsroot.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfs/nfsroot.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfs/nfsroot.c 2006-01-25 08:06:16 +0100 @@ -120,12 +120,12 @@ static int mount_port __initdata = 0; / enum { /* Options that take integer arguments */ Opt_port, Opt_rsize, Opt_wsize, Opt_timeo, Opt_retrans, Opt_acregmin, - Opt_acregmax, Opt_acdirmin, Opt_acdirmax, + Opt_acregmax, Opt_acdirmin, Opt_acdirmax, Opt_tagid, /* Options that take no arguments */ Opt_soft, Opt_hard, Opt_intr, Opt_nointr, Opt_posix, Opt_noposix, Opt_cto, Opt_nocto, Opt_ac, Opt_noac, Opt_lock, Opt_nolock, Opt_v2, Opt_v3, Opt_udp, Opt_tcp, - Opt_acl, Opt_noacl, Opt_tagxid, + Opt_acl, Opt_noacl, Opt_tag, Opt_notag, /* Error token */ Opt_err }; @@ -162,7 +162,10 @@ static match_table_t __initdata tokens = {Opt_tcp, "tcp"}, {Opt_acl, "acl"}, {Opt_noacl, "noacl"}, - {Opt_tagxid, "tagxid"}, + {Opt_tag, "tag"}, + {Opt_notag, "notag"}, + {Opt_tagid, "tagid=%u"}, + {Opt_tag, "tagxid"}, {Opt_err, NULL} }; @@ -277,9 +280,18 @@ static int __init root_nfs_parse(char *n case Opt_noacl: nfs_data.flags |= NFS_MOUNT_NOACL; break; -#ifndef CONFIG_INOXID_NONE - case Opt_tagxid: - nfs_data.flags |= NFS_MOUNT_TAGXID; +#ifndef CONFIG_TAGGING_NONE + case Opt_tag: + nfs_data.flags |= NFS_MOUNT_TAGGED; + break; + case Opt_notag: + nfs_data.flags &= ~NFS_MOUNT_TAGGED; + break; +#endif +#ifdef CONFIG_PROPAGATE + case Opt_tagid: + /* use args[0] */ + nfs_data.flags |= NFS_MOUNT_TAGGED; break; #endif default: diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfsd/auth.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfsd/auth.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfsd/auth.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfsd/auth.c 2006-01-25 05:34:51 +0100 @@ -9,7 +9,7 @@ #include #include #include -#include +#include #define CAP_NFSD_MASK (CAP_FS_MASK|CAP_TO_MASK(CAP_SYS_RESOURCE)) diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfsd/nfs3xdr.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfsd/nfs3xdr.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfsd/nfs3xdr.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfsd/nfs3xdr.c 2006-01-25 05:34:51 +0100 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #define NFSDDBG_FACILITY NFSDDBG_XDR @@ -129,9 +129,9 @@ decode_sattr3(u32 *p, struct iattr *iap) iap->ia_valid |= ATTR_GID; gid = ntohl(*p++); } - iap->ia_uid = INOXID_UID(XID_TAG_NFSD, uid, gid); - iap->ia_gid = INOXID_GID(XID_TAG_NFSD, uid, gid); - iap->ia_xid = INOXID_XID(XID_TAG_NFSD, uid, gid, 0); + iap->ia_uid = INOTAG_UID(DX_TAG_NFSD, uid, gid); + iap->ia_gid = INOTAG_GID(DX_TAG_NFSD, uid, gid); + iap->ia_tag = INOTAG_TAG(DX_TAG_NFSD, uid, gid, 0); if (*p++) { u64 newsize; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfsd/nfs4xdr.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfsd/nfs4xdr.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfsd/nfs4xdr.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfsd/nfs4xdr.c 2006-01-25 05:34:51 +0100 @@ -57,7 +57,7 @@ #include #include #include -#include +#include #define NFSDDBG_FACILITY NFSDDBG_XDR diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfsd/nfsxdr.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfsd/nfsxdr.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/nfsd/nfsxdr.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/nfsd/nfsxdr.c 2006-01-25 05:34:51 +0100 @@ -15,7 +15,7 @@ #include #include #include -#include +#include #define NFSDDBG_FACILITY NFSDDBG_XDR @@ -124,9 +124,9 @@ decode_sattr(u32 *p, struct iattr *iap) iap->ia_valid |= ATTR_GID; gid = tmp; } - iap->ia_uid = INOXID_UID(XID_TAG_NFSD, uid, gid); - iap->ia_gid = INOXID_GID(XID_TAG_NFSD, uid, gid); - iap->ia_xid = INOXID_XID(XID_TAG_NFSD, uid, gid, 0); + iap->ia_uid = INOTAG_UID(DX_TAG_NFSD, uid, gid); + iap->ia_gid = INOTAG_GID(DX_TAG_NFSD, uid, gid); + iap->ia_tag = INOTAG_TAG(DX_TAG_NFSD, uid, gid, 0); if ((tmp = ntohl(*p++)) != (u32)-1) { iap->ia_valid |= ATTR_SIZE; iap->ia_size = tmp; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/open.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/open.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/open.c 2006-01-21 18:28:17 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/open.c 2006-01-25 05:34:51 +0100 @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include @@ -696,11 +696,11 @@ static int chown_common(struct dentry *d newattrs.ia_valid = ATTR_CTIME; if (user != (uid_t) -1) { newattrs.ia_valid |= ATTR_UID; - newattrs.ia_uid = vx_map_uid(user); + newattrs.ia_uid = dx_map_uid(user); } if (group != (gid_t) -1) { newattrs.ia_valid |= ATTR_GID; - newattrs.ia_gid = vx_map_gid(group); + newattrs.ia_gid = dx_map_gid(group); } if (!S_ISDIR(inode->i_mode)) newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/proc/base.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/proc/base.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/proc/base.c 2006-01-21 18:28:04 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/proc/base.c 2006-01-25 05:34:51 +0100 @@ -1353,7 +1353,8 @@ static struct inode *proc_pid_make_inode inode->i_uid = task->euid; inode->i_gid = task->egid; } - inode->i_xid = vx_task_xid(task); + /* procfs is xid tagged */ + inode->i_tag = (tag_t)vx_task_xid(task); security_task_to_inode(task, inode); out: diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/proc/generic.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/proc/generic.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/proc/generic.c 2006-01-21 18:28:00 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/proc/generic.c 2006-01-25 05:34:51 +0100 @@ -394,7 +394,7 @@ struct dentry *proc_lookup(struct inode error = -EINVAL; inode = proc_get_inode(dir->i_sb, ino, de); /* generic proc entries belong to the host */ - inode->i_xid = 0; + inode->i_tag = 0; break; } } diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/reiserfs/inode.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/reiserfs/inode.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/reiserfs/inode.c 2006-01-21 18:28:14 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/reiserfs/inode.c 2006-01-25 05:34:51 +0100 @@ -18,7 +18,7 @@ #include #include #include -#include +#include extern int reiserfs_default_io_size; /* default io size devuned in super.c */ @@ -1241,9 +1241,9 @@ static void init_inode(struct inode *ino sd_attrs_to_i_attrs(sd_v2_attrs(sd), inode); } - inode->i_uid = INOXID_UID(XID_TAG(inode), uid, gid); - inode->i_gid = INOXID_GID(XID_TAG(inode), uid, gid); - inode->i_xid = INOXID_XID(XID_TAG(inode), uid, gid, 0); + 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)) { @@ -1267,8 +1267,8 @@ 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 = XIDINO_UID(XID_TAG(inode), inode->i_uid, inode->i_xid); - gid_t gid = XIDINO_GID(XID_TAG(inode), inode->i_gid, inode->i_xid); + 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); @@ -2995,7 +2995,7 @@ int reiserfs_setattr(struct dentry *dent if (!error) { if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid) || - (ia_valid & ATTR_XID && attr->ia_xid != inode->i_xid)) { + (ia_valid & ATTR_TAG && attr->ia_tag != inode->i_tag)) { error = reiserfs_chown_xattrs(inode, attr); if (!error) { @@ -3025,9 +3025,9 @@ int reiserfs_setattr(struct dentry *dent inode->i_uid = attr->ia_uid; if (attr->ia_valid & ATTR_GID) inode->i_gid = attr->ia_gid; - if ((attr->ia_valid & ATTR_XID) && - IS_TAGXID(inode)) - inode->i_xid = attr->ia_xid; + if ((attr->ia_valid & ATTR_TAG) && + IS_TAGGED(inode)) + inode->i_tag = attr->ia_tag; mark_inode_dirty(inode); error = journal_end(&th, inode->i_sb, jbegin_count); diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/reiserfs/namei.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/reiserfs/namei.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/reiserfs/namei.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/reiserfs/namei.c 2006-01-25 05:34:51 +0100 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #define INC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) { i->i_nlink++; if (i->i_nlink >= REISERFS_LINK_MAX) i->i_nlink=1; } #define DEC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) i->i_nlink--; @@ -366,7 +366,7 @@ static struct dentry *reiserfs_lookup(st reiserfs_write_unlock(dir->i_sb); return ERR_PTR(-EACCES); } - vx_propagate_xid(nd, inode); + dx_propagate_tag(nd, inode); /* Propogate the priv_object flag so we know we're in the priv tree */ if (is_reiserfs_priv_object(dir)) @@ -602,7 +602,7 @@ static int new_inode_init(struct inode * } else { inode->i_gid = current->fsgid; } - inode->i_xid = vx_current_fsxid(inode->i_sb); + inode->i_tag = dx_current_fstag(inode->i_sb); DQUOT_INIT(inode); return 0; } diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/reiserfs/super.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/reiserfs/super.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/reiserfs/super.c 2006-01-21 18:28:18 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/reiserfs/super.c 2006-01-25 05:34:51 +0100 @@ -888,8 +888,13 @@ static int reiserfs_parse_options(struct {"user_xattr",.setmask = 1 << REISERFS_UNSUPPORTED_OPT}, {"nouser_xattr",.clrmask = 1 << REISERFS_UNSUPPORTED_OPT}, #endif -#ifndef CONFIG_INOXID_NONE - {"tagxid",.setmask = 1 << REISERFS_TAGXID}, +#ifndef CONFIG_TAGGING_NONE + {"tagxid",.setmask = 1 << REISERFS_TAGGED}, + {"tag",.setmask = 1 << REISERFS_TAGGED}, + {"notag",.clrmask = 1 << REISERFS_TAGGED}, +#endif +#ifdef CONFIG_PROPAGATE + {"tag",.arg_required = 'T',.values = NULL}, #endif #ifdef CONFIG_REISERFS_FS_POSIX_ACL {"acl",.setmask = 1 << REISERFS_POSIXACL}, @@ -1165,9 +1170,9 @@ static int reiserfs_remount(struct super return -EINVAL; } - if ((mount_options & (1 << REISERFS_TAGXID)) && - !(s->s_flags & MS_TAGXID)) { - reiserfs_warning(s, "reiserfs: tagxid not permitted on remount."); + if ((mount_options & (1 << REISERFS_TAGGED)) && + !(s->s_flags & MS_TAGGED)) { + reiserfs_warning(s, "reiserfs: tagging not permitted on remount."); return -EINVAL; } @@ -1747,8 +1752,8 @@ static int reiserfs_fill_super(struct su } /* map mount option tagxid */ - if (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_TAGXID)) - s->s_flags |= MS_TAGXID; + if (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_TAGGED)) + s->s_flags |= MS_TAGGED; rs = SB_DISK_SUPER_BLOCK(s); /* Let's do basic sanity check to verify that underlying device is not diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/stat.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/stat.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/stat.c 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/stat.c 2006-01-25 05:34:51 +0100 @@ -27,7 +27,7 @@ void generic_fillattr(struct inode *inod stat->nlink = inode->i_nlink; stat->uid = inode->i_uid; stat->gid = inode->i_gid; - stat->xid = inode->i_xid; + stat->tag = inode->i_tag; stat->rdev = inode->i_rdev; stat->atime = inode->i_atime; stat->mtime = inode->i_mtime; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/linux-2.6/xfs_iops.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/linux-2.6/xfs_iops.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/linux-2.6/xfs_iops.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/linux-2.6/xfs_iops.c 2006-01-25 05:34:51 +0100 @@ -55,7 +55,7 @@ #include #include #include -#include +#include /* * Get a XFS inode from a given vnode. @@ -397,7 +397,7 @@ linvfs_lookup( d_add(dentry, NULL); return NULL; } - vx_propagate_xid(nd, LINVFS_GET_IP(cvp)); + dx_propagate_tag(nd, LINVFS_GET_IP(cvp)); return d_splice_alias(LINVFS_GET_IP(cvp), dentry); } @@ -693,9 +693,9 @@ linvfs_setattr( vattr.va_mask |= XFS_AT_GID; vattr.va_gid = attr->ia_gid; } - if ((ia_valid & ATTR_XID) && IS_TAGXID(inode)) { - vattr.va_mask |= XFS_AT_XID; - vattr.va_xid = attr->ia_xid; + if ((ia_valid & ATTR_TAG) && IS_TAGGED(inode)) { + vattr.va_mask |= XFS_AT_TAG; + vattr.va_tag = attr->ia_tag; } if (ia_valid & ATTR_SIZE) { vattr.va_mask |= XFS_AT_SIZE; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/linux-2.6/xfs_linux.h linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/linux-2.6/xfs_linux.h --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/linux-2.6/xfs_linux.h 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/linux-2.6/xfs_linux.h 2006-01-25 05:34:51 +0100 @@ -133,7 +133,7 @@ BUFFER_FNS(PrivateStart, unwritten); #define current_pid() (current->pid) #define current_fsuid(cred) (current->fsuid) #define current_fsgid(cred) (current->fsgid) -#define current_fsxid(cred,vp) (vx_current_fsxid(LINVFS_GET_IP(vp)->i_sb)) +#define current_fstag(cred,vp) (dx_current_fstag(LINVFS_GET_IP(vp)->i_sb)) #define NBPP PAGE_SIZE #define DPPSHFT (PAGE_SHIFT - 9) diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/linux-2.6/xfs_super.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/linux-2.6/xfs_super.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/linux-2.6/xfs_super.c 2006-01-21 18:28:18 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/linux-2.6/xfs_super.c 2006-01-25 05:34:51 +0100 @@ -161,7 +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_xid = ip->i_d.di_xid; + inode->i_tag = ip->i_d.di_tag; switch (inode->i_mode & S_IFMT) { case S_IFBLK: @@ -738,9 +738,9 @@ linvfs_remount( int error; VFS_PARSEARGS(vfsp, options, args, 1, error); - if ((args->flags2 & XFSMNT2_TAGXID) && - !(sb->s_flags & MS_TAGXID)) { - printk("XFS: %s: tagxid not permitted on remount.\n", + if ((args->flags2 & XFSMNT2_TAGGED) && + !(sb->s_flags & MS_TAGGED)) { + printk("XFS: %s: tagging not permitted on remount.\n", sb->s_id); error = EINVAL; } diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/linux-2.6/xfs_vnode.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/linux-2.6/xfs_vnode.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/linux-2.6/xfs_vnode.c 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/linux-2.6/xfs_vnode.c 2006-01-25 05:34:51 +0100 @@ -103,7 +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_xid = vap->va_xid; + inode->i_tag = vap->va_tag; inode->i_blocks = vap->va_nblocks; inode->i_mtime = vap->va_mtime; inode->i_ctime = vap->va_ctime; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/linux-2.6/xfs_vnode.h linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/linux-2.6/xfs_vnode.h --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/linux-2.6/xfs_vnode.h 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/linux-2.6/xfs_vnode.h 2006-01-25 05:34:51 +0100 @@ -386,7 +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 */ - xid_t va_xid; /* 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 */ @@ -435,7 +435,7 @@ typedef struct vattr { #define XFS_AT_PROJID 0x04000000 #define XFS_AT_SIZE_NOPERM 0x08000000 #define XFS_AT_GENCOUNT 0x10000000 -#define XFS_AT_XID 0x20000000 +#define XFS_AT_TAG 0x20000000 #define XFS_AT_ALL (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\ XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\ @@ -443,7 +443,7 @@ typedef struct vattr { XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|XFS_AT_MAC|\ XFS_AT_ACL|XFS_AT_CAP|XFS_AT_INF|XFS_AT_XFLAGS|XFS_AT_EXTSIZE|\ XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_PROJID|XFS_AT_GENCOUNT\ - XFS_AT_XID) + XFS_AT_TAG) #define XFS_AT_STAT (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\ XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\ diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_clnt.h linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_clnt.h --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_clnt.h 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_clnt.h 2006-01-25 05:34:51 +0100 @@ -100,7 +100,7 @@ struct xfs_mount_args { */ #define XFSMNT2_COMPAT_IOSIZE 0x00000001 /* don't report large preferred * I/O size in stat(2) */ -#define XFSMNT2_TAGXID 0x80000000 /* context xid tagging */ +#define XFSMNT2_TAGGED 0x80000000 /* context tagging */ #endif /* __XFS_CLNT_H__ */ diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_dinode.h linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_dinode.h --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_dinode.h 2006-01-21 22:12:26 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_dinode.h 2006-01-25 05:34:51 +0100 @@ -53,7 +53,7 @@ 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 */ - __uint16_t di_xid; /* vserver context id */ + __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 */ diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_fs.h linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_fs.h --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_fs.h 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_fs.h 2006-01-25 05:34:51 +0100 @@ -297,7 +297,7 @@ typedef struct xfs_bstat { __s32 bs_extents; /* number of extents */ __u32 bs_gen; /* generation count */ __u16 bs_projid; /* project id */ - __u16 bs_xid; /* context id */ + __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 */ diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_inode.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_inode.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_inode.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_inode.c 2006-01-25 05:34:51 +0100 @@ -52,7 +52,7 @@ #include "xfs_mac.h" #include "xfs_acl.h" -#include +#include kmem_zone_t *xfs_ifork_zone; kmem_zone_t *xfs_inode_zone; @@ -736,16 +736,16 @@ xfs_xlate_dinode_core( 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 xid = 0; + uint16_t tag = 0; ASSERT(dir); if (dir < 0) { - xid = mem_core->di_xid; + tag = mem_core->di_tag; /* FIXME: supposed to use superblock flag */ - uid = XIDINO_UID(1, mem_core->di_uid, xid); - gid = XIDINO_GID(1, mem_core->di_gid, xid); - xid = XIDINO_XID(1, xid); + 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); @@ -755,15 +755,15 @@ xfs_xlate_dinode_core( INT_XLATE(buf_core->di_onlink, mem_core->di_onlink, 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_xid, xid, 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); if (dir > 0) { /* FIXME: supposed to use superblock flag */ - mem_core->di_uid = INOXID_UID(1, uid, gid); - mem_core->di_gid = INOXID_GID(1, uid, gid); - mem_core->di_xid = INOXID_XID(1, uid, gid, xid); + 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 { @@ -1145,7 +1145,7 @@ xfs_ialloc( ASSERT(ip->i_d.di_nlink == nlink); ip->i_d.di_uid = current_fsuid(cr); ip->i_d.di_gid = current_fsgid(cr); - ip->i_d.di_xid = current_fsxid(cr, vp); + ip->i_d.di_tag = current_fstag(cr, vp); ip->i_d.di_projid = prid; memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_itable.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_itable.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_itable.c 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_itable.c 2006-01-25 05:34:51 +0100 @@ -85,7 +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_xid = dic->di_xid; + 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; @@ -160,7 +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_xid = INT_GET(dic->di_xid, 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); diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_mount.h linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_mount.h --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_mount.h 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_mount.h 2006-01-25 05:34:51 +0100 @@ -412,7 +412,7 @@ typedef struct xfs_mount { #define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred * I/O size in stat() */ -#define XFS_MOUNT_TAGXID (1ULL << 31) /* context xid tagging */ +#define XFS_MOUNT_TAGGED (1ULL << 31) /* context tagging */ /* * Default minimum read and write sizes. diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_vfsops.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_vfsops.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_vfsops.c 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_vfsops.c 2006-01-25 05:34:51 +0100 @@ -296,8 +296,8 @@ xfs_start_flags( if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE) mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; - if (ap->flags2 & XFSMNT2_TAGXID) - mp->m_flags |= XFS_MOUNT_TAGXID; + if (ap->flags2 & XFSMNT2_TAGGED) + mp->m_flags |= XFS_MOUNT_TAGGED; /* * no recovery flag requires a read-only mount @@ -392,8 +392,8 @@ xfs_finish_flags( return XFS_ERROR(EINVAL); } - if (ap->flags2 & XFSMNT2_TAGXID) - vfs->vfs_super->s_flags |= MS_TAGXID; + if (ap->flags2 & XFSMNT2_TAGGED) + vfs->vfs_super->s_flags |= MS_TAGGED; return 0; } @@ -1657,7 +1657,9 @@ xfs_vget( * in stat(). */ #define MNTOPT_ATTR2 "attr2" /* do use attr2 attribute format */ #define MNTOPT_NOATTR2 "noattr2" /* do not use attr2 attribute format */ -#define MNTOPT_TAGXID "tagxid" /* context xid tagging for inodes */ +#define MNTOPT_TAGXID "tagxid" /* context tagging for inodes */ +#define MNTOPT_TAGGED "tag" /* context tagging for inodes */ +#define MNTOPT_NOTAGTAG "notag" /* do not use context tagging */ STATIC unsigned long suffix_strtoul(const char *cp, char **endp, unsigned int base) @@ -1834,9 +1836,18 @@ xfs_parseargs( args->flags |= XFSMNT_ATTR2; } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { args->flags &= ~XFSMNT_ATTR2; -#ifndef CONFIG_INOXID_NONE +#ifndef CONFIG_TAGGING_NONE + } else if (!strcmp(this_char, MNTOPT_TAGGED)) { + args->flags2 |= XFSMNT2_TAGGED; + } else if (!strcmp(this_char, MNTOPT_NOTAGTAG)) { + args->flags2 &= ~XFSMNT2_TAGGED; } else if (!strcmp(this_char, MNTOPT_TAGXID)) { - args->flags2 |= XFSMNT2_TAGXID; + args->flags2 |= XFSMNT2_TAGGED; +#endif +#ifdef CONFIG_PROPAGATE + } else if (!strcmp(this_char, MNTOPT_TAGGED)) { + /* use value */ + args->flags2 |= XFSMNT2_TAGGED; #endif } else if (!strcmp(this_char, "osyncisdsync")) { /* no-op, this is now the default */ diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_vnodeops.c linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_vnodeops.c --- linux-2.6.16-rc1-vs2.1.0.6.1/fs/xfs/xfs_vnodeops.c 2006-01-21 18:28:18 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/fs/xfs/xfs_vnodeops.c 2006-01-25 05:34:51 +0100 @@ -154,7 +154,7 @@ xfs_getattr( vap->va_mode = ip->i_d.di_mode; vap->va_uid = ip->i_d.di_uid; vap->va_gid = ip->i_d.di_gid; - vap->va_xid = ip->i_d.di_xid; + vap->va_tag = ip->i_d.di_tag; vap->va_projid = ip->i_d.di_projid; /* @@ -255,7 +255,7 @@ xfs_setattr( uint commit_flags=0; uid_t uid=0, iuid=0; gid_t gid=0, igid=0; - xid_t xid=0, ixid=0; + tag_t tag=0, itag=0; int timeflags = 0; vnode_t *vp; xfs_prid_t projid=0, iprojid=0; @@ -312,7 +312,7 @@ xfs_setattr( (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_PROJID))) { uint qflags = 0; - /* FIXME: handle xid? */ + /* FIXME: handle tagging? */ if ((mask & XFS_AT_UID) && XFS_IS_UQUOTA_ON(mp)) { uid = vap->va_uid; qflags |= XFS_QMOPT_UQUOTA; @@ -393,7 +393,7 @@ xfs_setattr( if (mask & (XFS_AT_MODE|XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_UID| XFS_AT_GID|XFS_AT_PROJID)) { - /* FIXME: handle xid? */ + /* FIXME: handle tagging? */ /* * CAP_FOWNER overrides the following restrictions: @@ -443,7 +443,7 @@ xfs_setattr( * and can change the group id only to a group of which he * or she is a member. */ - if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_XID|XFS_AT_PROJID)) { + if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_TAG|XFS_AT_PROJID)) { /* * These IDs could have changed since we last looked at them. * But, we're assured that if the ownership did change @@ -452,11 +452,11 @@ xfs_setattr( */ iuid = ip->i_d.di_uid; igid = ip->i_d.di_gid; - ixid = ip->i_d.di_xid; + 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; - xid = (mask & XFS_AT_XID) ? vap->va_xid : ixid; + tag = (mask & XFS_AT_TAG) ? vap->va_tag : itag; projid = (mask & XFS_AT_PROJID) ? (xfs_prid_t)vap->va_projid : iprojid; @@ -484,7 +484,7 @@ xfs_setattr( if ((XFS_IS_UQUOTA_ON(mp) && iuid != uid) || (XFS_IS_PQUOTA_ON(mp) && iprojid != projid) || (XFS_IS_GQUOTA_ON(mp) && igid != gid)) { - /* FIXME: handle xid? */ + /* FIXME: handle tagging? */ ASSERT(tp); code = XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, udqp, gdqp, capable(CAP_FOWNER) ? @@ -701,7 +701,7 @@ xfs_setattr( * and can change the group id only to a group of which he * or she is a member. */ - if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_XID|XFS_AT_PROJID)) { + if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_TAG|XFS_AT_PROJID)) { /* * CAP_FSETID overrides the following restrictions: * @@ -717,11 +717,11 @@ xfs_setattr( * Change the ownerships and register quota modifications * in the transaction. */ - if (ixid != xid) { + if (itag != tag) { if (XFS_IS_GQUOTA_ON(mp)) { - /* FIXME: handle xid quota? */ + /* FIXME: handle tag quota? */ } - ip->i_d.di_xid = xid; + ip->i_d.di_tag = tag; } if (iuid != uid) { if (XFS_IS_UQUOTA_ON(mp)) { diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/ext2_fs.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/ext2_fs.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/ext2_fs.h 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/ext2_fs.h 2006-01-25 05:34:51 +0100 @@ -247,7 +247,7 @@ struct ext2_inode { struct { __u8 l_i_frag; /* Fragment number */ __u8 l_i_fsize; /* Fragment size */ - __u16 l_i_xid; /* LRU Context */ + __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; @@ -279,7 +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_xid osd2.linux2.l_i_xid +#define i_raw_tag osd2.linux2.l_i_tag #define i_reserved2 osd2.linux2.l_i_reserved2 #endif @@ -323,7 +323,7 @@ struct ext2_inode { #define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ #define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ #define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ -#define EXT2_MOUNT_TAGXID (1<<24) /* Enable Context Tags */ +#define EXT2_MOUNT_TAGGED (1<<24) /* Enable Context Tags */ #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/ext3_fs.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/ext3_fs.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/ext3_fs.h 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/ext3_fs.h 2006-01-25 05:34:51 +0100 @@ -197,7 +197,7 @@ struct ext3_group_desc #define EXT3_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ #endif #ifdef CONFIG_VSERVER_LEGACY -#define EXT3_IOC_SETXID FIOC_SETXIDJ +#define EXT3_IOC_SETTAG FIOC_SETTAGJ #endif /* @@ -297,7 +297,7 @@ struct ext3_inode { struct { __u8 l_i_frag; /* Fragment number */ __u8 l_i_fsize; /* Fragment size */ - __u16 l_i_xid; /* LRU Context */ + __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; @@ -331,7 +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_xid osd2.linux2.l_i_xid +#define i_raw_tag osd2.linux2.l_i_tag #define i_reserved2 osd2.linux2.l_i_reserved2 #elif defined(__GNU__) @@ -386,7 +386,7 @@ struct ext3_inode { #define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */ #define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ #define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ -#define EXT3_MOUNT_TAGXID (1<<24) /* Enable Context Tags */ +#define EXT3_MOUNT_TAGGED (1<<24) /* Enable Context Tags */ /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ #ifndef _LINUX_EXT2_FS_H diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/fs.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/fs.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/fs.h 2006-01-21 18:28:18 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/fs.h 2006-01-25 05:34:51 +0100 @@ -108,8 +108,8 @@ extern int dir_notify_enable; #define MS_PRIVATE (1<<18) /* change to private */ #define MS_SLAVE (1<<19) /* change to slave */ #define MS_SHARED (1<<20) /* change to shared */ -#define MS_TAGXID (1<<24) /* tag inodes with context information */ -#define MS_XID (1<<25) /* use specific xid for this mount */ +#define MS_TAGGED (1<<24) /* use generic inode tagging */ +#define MS_TAGID (1<<25) /* use specific tag for this mount */ #define MS_ACTIVE (1<<30) #define MS_NOUSER (1<<31) @@ -160,7 +160,7 @@ extern int dir_notify_enable; #define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \ ((inode)->i_flags & (S_SYNC|S_DIRSYNC))) #define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK) -#define IS_TAGXID(inode) __IS_FLG(inode, MS_TAGXID) +#define IS_TAGGED(inode) __IS_FLG(inode, MS_TAGGED) #define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) @@ -275,7 +275,7 @@ typedef void (dio_iodone_t)(struct kiocb #define ATTR_KILL_SUID 2048 #define ATTR_KILL_SGID 4096 #define ATTR_FILE 8192 -#define ATTR_XID 16384 +#define ATTR_TAG 16384 /* * This is the Inode Attributes structure, used for notify_change(). It @@ -291,7 +291,7 @@ struct iattr { umode_t ia_mode; uid_t ia_uid; gid_t ia_gid; - xid_t ia_xid; + tag_t ia_tag; loff_t ia_size; struct timespec ia_atime; struct timespec ia_mtime; @@ -484,7 +484,7 @@ struct inode { unsigned int i_nlink; uid_t i_uid; gid_t i_gid; - xid_t i_xid; + tag_t i_tag; dev_t i_rdev; loff_t i_size; struct timespec i_atime; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/mount.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/mount.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/mount.h 2006-01-21 19:20:57 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/mount.h 2006-01-25 05:34:51 +0100 @@ -29,7 +29,7 @@ #define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ #define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ #define MNT_PNODE_MASK 0x3000 /* propogation flag mask */ -#define MNT_XID 0x8000 +#define MNT_TAGID 0x8000 struct vfsmount { struct list_head mnt_hash; @@ -51,7 +51,7 @@ struct vfsmount { struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ struct namespace *mnt_namespace; /* containing namespace */ int mnt_pinned; - xid_t mnt_xid; /* xid tagging used for vfsmount */ + tag_t mnt_tag; /* tagging used for vfsmount */ }; static inline struct vfsmount *mntget(struct vfsmount *mnt) diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/nfs_mount.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/nfs_mount.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/nfs_mount.h 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/nfs_mount.h 2006-01-25 05:34:51 +0100 @@ -61,7 +61,7 @@ struct nfs_mount_data { #define NFS_MOUNT_NOACL 0x0800 /* 4 */ #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ -#define NFS_MOUNT_TAGXID 0x8000 /* tagxid */ +#define NFS_MOUNT_TAGGED 0x8000 /* context tagging */ #define NFS_MOUNT_FLAGMASK 0xFFFF #endif diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/reiserfs_fs_sb.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/reiserfs_fs_sb.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/reiserfs_fs_sb.h 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/reiserfs_fs_sb.h 2006-01-25 05:34:51 +0100 @@ -457,7 +457,7 @@ enum reiserfs_mount_options { REISERFS_POSIXACL, REISERFS_BARRIER_NONE, REISERFS_BARRIER_FLUSH, - REISERFS_TAGXID, + REISERFS_TAGGED, /* Actions on error */ REISERFS_ERROR_PANIC, diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/stat.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/stat.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/stat.h 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/stat.h 2006-01-25 05:34:51 +0100 @@ -63,7 +63,7 @@ struct kstat { unsigned int nlink; uid_t uid; gid_t gid; - xid_t xid; + tag_t tag; dev_t rdev; loff_t size; struct timespec atime; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/sunrpc/clnt.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/sunrpc/clnt.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/sunrpc/clnt.h 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/sunrpc/clnt.h 2006-01-25 05:34:51 +0100 @@ -52,7 +52,7 @@ struct rpc_clnt { cl_autobind : 1,/* use getport() */ cl_oneshot : 1,/* dispose after use */ cl_dead : 1,/* abandoned */ - cl_tagxid : 1;/* do xid tagging */ + cl_tag : 1;/* context tagging */ struct rpc_rtt * cl_rtt; /* RTO estimator data */ struct rpc_portmap * cl_pmap; /* port mapping */ diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/types.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/types.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/types.h 2006-01-21 18:27:59 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/types.h 2006-01-25 05:34:51 +0100 @@ -38,6 +38,7 @@ typedef __kernel_uid16_t uid16_t; typedef __kernel_gid16_t gid16_t; typedef unsigned int xid_t; typedef unsigned int nid_t; +typedef unsigned int tag_t; #ifdef CONFIG_UID16 /* This is defined by include/asm-{arch}/posix_types.h */ diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vs_dlimit.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vs_dlimit.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vs_dlimit.h 2006-01-21 18:27:58 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vs_dlimit.h 2006-01-25 05:34:51 +0100 @@ -14,7 +14,7 @@ static inline struct dl_info *__get_dl_i if (!dli) return NULL; vxlprintk(VXD_CBIT(dlim, 4), "get_dl_info(%p[#%d.%d])", - dli, dli?dli->dl_xid:0, dli?atomic_read(&dli->dl_usecnt):0, + dli, dli?dli->dl_tag:0, dli?atomic_read(&dli->dl_usecnt):0, _file, _line); atomic_inc(&dli->dl_usecnt); return dli; @@ -32,7 +32,7 @@ static inline void __put_dl_info(struct if (!dli) return; vxlprintk(VXD_CBIT(dlim, 4), "put_dl_info(%p[#%d.%d])", - dli, dli?dli->dl_xid:0, dli?atomic_read(&dli->dl_usecnt):0, + dli, dli?dli->dl_tag:0, dli?atomic_read(&dli->dl_usecnt):0, _file, _line); if (atomic_dec_and_test(&dli->dl_usecnt)) free_dl_info(dli); @@ -180,33 +180,33 @@ static inline void __dl_adjust_block(str } #define DLIMIT_ALLOC_SPACE(in, bytes) \ - __dl_alloc_space((in)->i_sb, (in)->i_xid, (dlsize_t)(bytes), \ + __dl_alloc_space((in)->i_sb, (in)->i_tag, (dlsize_t)(bytes), \ __FILE__, __LINE__ ) #define DLIMIT_FREE_SPACE(in, bytes) \ - __dl_free_space((in)->i_sb, (in)->i_xid, (dlsize_t)(bytes), \ + __dl_free_space((in)->i_sb, (in)->i_tag, (dlsize_t)(bytes), \ __FILE__, __LINE__ ) #define DLIMIT_ALLOC_BLOCK(in, nr) \ - __dl_alloc_space((in)->i_sb, (in)->i_xid, \ + __dl_alloc_space((in)->i_sb, (in)->i_tag, \ ((dlsize_t)(nr)) << (in)->i_sb->s_blocksize_bits, \ __FILE__, __LINE__ ) #define DLIMIT_FREE_BLOCK(in, nr) \ - __dl_free_space((in)->i_sb, (in)->i_xid, \ + __dl_free_space((in)->i_sb, (in)->i_tag, \ ((dlsize_t)(nr)) << (in)->i_sb->s_blocksize_bits, \ __FILE__, __LINE__ ) #define DLIMIT_ALLOC_INODE(in) \ - __dl_alloc_inode((in)->i_sb, (in)->i_xid, __FILE__, __LINE__ ) + __dl_alloc_inode((in)->i_sb, (in)->i_tag, __FILE__, __LINE__ ) #define DLIMIT_FREE_INODE(in) \ - __dl_free_inode((in)->i_sb, (in)->i_xid, __FILE__, __LINE__ ) + __dl_free_inode((in)->i_sb, (in)->i_tag, __FILE__, __LINE__ ) -#define DLIMIT_ADJUST_BLOCK(sb, xid, fb, rb) \ - __dl_adjust_block(sb, xid, fb, rb, __FILE__, __LINE__ ) +#define DLIMIT_ADJUST_BLOCK(sb, tag, fb, rb) \ + __dl_adjust_block(sb, tag, fb, rb, __FILE__, __LINE__ ) #else diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vs_tag.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vs_tag.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vs_tag.h 1970-01-01 01:00:00 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vs_tag.h 2006-01-25 05:34:51 +0100 @@ -0,0 +1,45 @@ +#ifndef _VX_VS_TAG_H +#define _VX_VS_TAG_H + +#include +#include + +/* check conditions */ + +#define DX_ADMIN 0x0001 +#define DX_WATCH 0x0002 +#define DX_HOSTID 0x0008 + +#define DX_IDENT 0x0010 + +#define DX_ARG_MASK 0x0010 + + +#define dx_task_tag(t) ((t)->xid) + +#define dx_current_tag() dx_task_tag(current) + +#define dx_check(c,m) __dx_check(dx_current_tag(),c,m) + +#define dx_weak_check(c,m) ((m) ? dx_check(c,m) : 1) + + +/* + * check current context for ADMIN/WATCH and + * optionally against supplied argument + */ +static inline int __dx_check(tag_t cid, tag_t id, unsigned int mode) +{ + if (mode & DX_ARG_MASK) { + if ((mode & DX_IDENT) && + (id == cid)) + return 1; + } + return (((mode & DX_ADMIN) && (cid == 0)) || + ((mode & DX_WATCH) && (cid == 1)) || + ((mode & DX_HOSTID) && (id == 0))); +} + +#else +#warning duplicate inclusion +#endif diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vserver/debug.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vserver/debug.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vserver/debug.h 2006-01-21 18:28:14 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vserver/debug.h 2006-01-25 06:07:00 +0100 @@ -27,6 +27,7 @@ extern unsigned int vx_debug_switch; extern unsigned int vx_debug_xid; extern unsigned int vx_debug_nid; +extern unsigned int vx_debug_tag; extern unsigned int vx_debug_net; extern unsigned int vx_debug_limit; extern unsigned int vx_debug_dlim; @@ -77,6 +78,7 @@ void dump_vx_info_inactive(int); #define vx_debug_switch 0 #define vx_debug_xid 0 #define vx_debug_nid 0 +#define vx_debug_tag 0 #define vx_debug_net 0 #define vx_debug_limit 0 #define vx_debug_dlim 0 diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vserver/dlimit.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vserver/dlimit.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vserver/dlimit.h 2006-01-21 18:28:14 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vserver/dlimit.h 2006-01-25 05:34:51 +0100 @@ -17,7 +17,7 @@ struct super_block; struct dl_info { struct hlist_node dl_hlist; /* linked list of contexts */ struct rcu_head dl_rcu; /* the rcu head */ - xid_t dl_xid; /* context id */ + tag_t dl_tag; /* context tag */ atomic_t dl_usecnt; /* usage count */ atomic_t dl_refcnt; /* reference count */ diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vserver/inode.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vserver/inode.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vserver/inode.h 2006-01-21 18:28:11 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vserver/inode.h 2006-01-25 05:34:51 +0100 @@ -2,7 +2,7 @@ #define _VX_INODE_H -#define IATTR_XID 0x01000000 +#define IATTR_TAG 0x01000000 #define IATTR_ADMIN 0x00000001 #define IATTR_WATCH 0x00000002 diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vserver/tag.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vserver/tag.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vserver/tag.h 1970-01-01 01:00:00 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vserver/tag.h 2006-01-25 06:15:45 +0100 @@ -0,0 +1,156 @@ +#ifndef _DX_TAG_H +#define _DX_TAG_H + +#ifndef CONFIG_VSERVER +#warning config options missing +#endif + +#define DX_TAG(in) (IS_TAGGED(in)) + + +#ifdef CONFIG_DX_TAG_NFSD +#define DX_TAG_NFSD 1 +#else +#define DX_TAG_NFSD 0 +#endif + + +#ifdef CONFIG_TAGGING_NONE + +#define MAX_UID 0xFFFFFFFF +#define MAX_GID 0xFFFFFFFF + +#define INOTAG_TAG(cond, uid, gid, tag) (0) + +#define TAGINO_UID(cond, uid, tag) (uid) +#define TAGINO_GID(cond, gid, tag) (gid) + +#endif + + +#ifdef CONFIG_TAGGING_GID16 + +#define MAX_UID 0xFFFFFFFF +#define MAX_GID 0x0000FFFF + +#define INOTAG_TAG(cond, uid, gid, tag) \ + ((cond) ? (((gid) >> 16) & 0xFFFF) : 0) + +#define TAGINO_UID(cond, uid, tag) (uid) +#define TAGINO_GID(cond, gid, tag) \ + ((cond) ? (((gid) & 0xFFFF) | ((tag) << 16)) : (gid)) + +#endif + + +#ifdef CONFIG_TAGGING_ID24 + +#define MAX_UID 0x00FFFFFF +#define MAX_GID 0x00FFFFFF + +#define INOTAG_TAG(cond, uid, gid, tag) \ + ((cond) ? ((((uid) >> 16) & 0xFF00) | (((gid) >> 24) & 0xFF)) : 0) + +#define TAGINO_UID(cond, uid, tag) \ + ((cond) ? (((uid) & 0xFFFFFF) | (((tag) & 0xFF00) << 16)) : (uid)) +#define TAGINO_GID(cond, gid, tag) \ + ((cond) ? (((gid) & 0xFFFFFF) | (((tag) & 0x00FF) << 24)) : (gid)) + +#endif + + +#ifdef CONFIG_TAGGING_UID16 + +#define MAX_UID 0x0000FFFF +#define MAX_GID 0xFFFFFFFF + +#define INOTAG_TAG(cond, uid, gid, tag) \ + ((cond) ? (((uid) >> 16) & 0xFFFF) : 0) + +#define TAGINO_UID(cond, uid, tag) \ + ((cond) ? (((uid) & 0xFFFF) | ((tag) << 16)) : (uid)) +#define TAGINO_GID(cond, gid, tag) (gid) + +#endif + + +#ifdef CONFIG_TAGGING_INTERN + +#define MAX_UID 0xFFFFFFFF +#define MAX_GID 0xFFFFFFFF + +#define INOTAG_TAG(cond, uid, gid, tag) \ + ((cond) ? (tag) : 0) + +#define TAGINO_UID(cond, uid, tag) (uid) +#define TAGINO_GID(cond, gid, tag) (gid) + +#endif + + +#ifdef CONFIG_TAGGING_RUNTIME + +#define MAX_UID 0xFFFFFFFF +#define MAX_GID 0xFFFFFFFF + +#define INOTAG_TAG(cond, uid, gid, tag) (0) + +#define TAGINO_UID(cond, uid, tag) (uid) +#define TAGINO_GID(cond, gid, tag) (gid) + +#endif + + +#ifndef CONFIG_TAGGING_NONE +#define dx_current_fstag(sb) \ + ((sb)->s_flags & MS_TAGGED ? dx_current_tag(): 0) +#else +#define dx_current_fstag(sb) (0) +#endif + +#ifndef CONFIG_TAGGING_INTERN +#define TAGINO_TAG(cond, tag) (0) +#else +#define TAGINO_TAG(cond, tag) ((cond) ? (tag) : 0) +#endif + +#define INOTAG_UID(cond, uid, gid) \ + ((cond) ? ((uid) & MAX_UID) : (uid)) +#define INOTAG_GID(cond, uid, gid) \ + ((cond) ? ((gid) & MAX_GID) : (gid)) + + +static inline uid_t dx_map_uid(uid_t uid) +{ + if ((uid > MAX_UID) && (uid != -1)) + uid = -2; + return (uid & MAX_UID); +} + +static inline gid_t dx_map_gid(gid_t gid) +{ + if ((gid > MAX_GID) && (gid != -1)) + gid = -2; + return (gid & MAX_GID); +} + + +#ifdef CONFIG_VSERVER_LEGACY +#define FIOC_GETTAG _IOR('x', 1, long) +#define FIOC_SETTAG _IOW('x', 2, long) +#define FIOC_SETTAGJ _IOW('x', 3, long) +#endif + +#ifdef CONFIG_PROPAGATE + +int dx_parse_tag(char *string, tag_t *tag, int remove); + +void __dx_propagate_tag(struct nameidata *nd, struct inode *inode); + +#define dx_propagate_tag(n,i) __dx_propagate_tag(n,i) + +#else +#define dx_propagate_tag(n,i) do { } while (0) +#endif + +#endif /* _DX_TAG_H */ diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vserver/xid.h linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vserver/xid.h --- linux-2.6.16-rc1-vs2.1.0.6.1/include/linux/vserver/xid.h 2006-01-21 18:28:12 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/include/linux/vserver/xid.h 1970-01-01 01:00:00 +0100 @@ -1,156 +0,0 @@ -#ifndef _VX_XID_H -#define _VX_XID_H - -#ifndef CONFIG_VSERVER -#warning config options missing -#endif - -#define XID_TAG(in) (IS_TAGXID(in)) - - -#ifdef CONFIG_XID_TAG_NFSD -#define XID_TAG_NFSD 1 -#else -#define XID_TAG_NFSD 0 -#endif - - -#ifdef CONFIG_INOXID_NONE - -#define MAX_UID 0xFFFFFFFF -#define MAX_GID 0xFFFFFFFF - -#define INOXID_XID(tag, uid, gid, xid) (0) - -#define XIDINO_UID(tag, uid, xid) (uid) -#define XIDINO_GID(tag, gid, xid) (gid) - -#endif - - -#ifdef CONFIG_INOXID_GID16 - -#define MAX_UID 0xFFFFFFFF -#define MAX_GID 0x0000FFFF - -#define INOXID_XID(tag, uid, gid, xid) \ - ((tag) ? (((gid) >> 16) & 0xFFFF) : 0) - -#define XIDINO_UID(tag, uid, xid) (uid) -#define XIDINO_GID(tag, gid, xid) \ - ((tag) ? (((gid) & 0xFFFF) | ((xid) << 16)) : (gid)) - -#endif - - -#ifdef CONFIG_INOXID_UGID24 - -#define MAX_UID 0x00FFFFFF -#define MAX_GID 0x00FFFFFF - -#define INOXID_XID(tag, uid, gid, xid) \ - ((tag) ? ((((uid) >> 16) & 0xFF00) | (((gid) >> 24) & 0xFF)) : 0) - -#define XIDINO_UID(tag, uid, xid) \ - ((tag) ? (((uid) & 0xFFFFFF) | (((xid) & 0xFF00) << 16)) : (uid)) -#define XIDINO_GID(tag, gid, xid) \ - ((tag) ? (((gid) & 0xFFFFFF) | (((xid) & 0x00FF) << 24)) : (gid)) - -#endif - - -#ifdef CONFIG_INOXID_UID16 - -#define MAX_UID 0x0000FFFF -#define MAX_GID 0xFFFFFFFF - -#define INOXID_XID(tag, uid, gid, xid) \ - ((tag) ? (((uid) >> 16) & 0xFFFF) : 0) - -#define XIDINO_UID(tag, uid, xid) \ - ((tag) ? (((uid) & 0xFFFF) | ((xid) << 16)) : (uid)) -#define XIDINO_GID(tag, gid, xid) (gid) - -#endif - - -#ifdef CONFIG_INOXID_INTERN - -#define MAX_UID 0xFFFFFFFF -#define MAX_GID 0xFFFFFFFF - -#define INOXID_XID(tag, uid, gid, xid) \ - ((tag) ? (xid) : 0) - -#define XIDINO_UID(tag, uid, xid) (uid) -#define XIDINO_GID(tag, gid, xid) (gid) - -#endif - - -#ifdef CONFIG_INOXID_RUNTIME - -#define MAX_UID 0xFFFFFFFF -#define MAX_GID 0xFFFFFFFF - -#define INOXID_XID(tag, uid, gid, xid) (0) - -#define XIDINO_UID(tag, uid, xid) (uid) -#define XIDINO_GID(tag, gid, xid) (gid) - -#endif - - -#ifndef CONFIG_INOXID_NONE -#define vx_current_fsxid(sb) \ - ((sb)->s_flags & MS_TAGXID ? current->xid : 0) -#else -#define vx_current_fsxid(sb) (0) -#endif - -#ifndef CONFIG_INOXID_INTERN -#define XIDINO_XID(tag, xid) (0) -#else -#define XIDINO_XID(tag, xid) ((tag) ? (xid) : 0) -#endif - -#define INOXID_UID(tag, uid, gid) \ - ((tag) ? ((uid) & MAX_UID) : (uid)) -#define INOXID_GID(tag, uid, gid) \ - ((tag) ? ((gid) & MAX_GID) : (gid)) - - -static inline uid_t vx_map_uid(uid_t uid) -{ - if ((uid > MAX_UID) && (uid != -1)) - uid = -2; - return (uid & MAX_UID); -} - -static inline gid_t vx_map_gid(gid_t gid) -{ - if ((gid > MAX_GID) && (gid != -1)) - gid = -2; - return (gid & MAX_GID); -} - - -#ifdef CONFIG_VSERVER_LEGACY -#define FIOC_GETXID _IOR('x', 1, long) -#define FIOC_SETXID _IOW('x', 2, long) -#define FIOC_SETXIDJ _IOW('x', 3, long) -#endif - -#ifdef CONFIG_XID_PROPAGATE - -int vx_parse_xid(char *string, xid_t *xid, int remove); - -void __vx_propagate_xid(struct nameidata *nd, struct inode *inode); - -#define vx_propagate_xid(n,i) __vx_propagate_xid(n,i) - -#else -#define vx_propagate_xid(n,i) do { } while (0) -#endif - -#endif /* _VX_XID_H */ diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/kernel/vserver/Kconfig linux-2.6.16-rc1-vs2.1.0.6.2b/kernel/vserver/Kconfig --- linux-2.6.16-rc1-vs2.1.0.6.1/kernel/vserver/Kconfig 2006-01-21 18:27:59 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/kernel/vserver/Kconfig 2006-01-25 07:47:46 +0100 @@ -123,44 +123,44 @@ config VSERVER_IDLELIMIT will also marginally increase scheduling overhead. choice - prompt "Persistent Inode Context Tagging" - default INOXID_UGID24 + prompt "Persistent Inode Tagging" + default TAGGING_ID24 help This adds persistent context information to filesystems mounted with the tagxid option. Tagging is a requirement for per-context disk limits and per-context quota. -config INOXID_NONE +config TAGGING_NONE bool "Disabled" help do not store per-context information in inodes. -config INOXID_UID16 +config TAGGING_UID16 bool "UID16/GID32" help reduces UID to 16 bit, but leaves GID at 32 bit. -config INOXID_GID16 +config TAGGING_GID16 bool "UID32/GID16" help reduces GID to 16 bit, but leaves UID at 32 bit. -config INOXID_UGID24 +config TAGGING_ID24 bool "UID24/GID24" help uses the upper 8bit from UID and GID for XID tagging which leaves 24bit for UID/GID each, which should be more than sufficient for normal use. -config INOXID_INTERN +config TAGGING_INTERN bool "UID32/GID32" help this uses otherwise reserved inode fields in the on disk representation, which limits the use to a few filesystems (currently ext2 and ext3) -config INOXID_RUNTIME +config TAGGING_RUNTIME bool "Runtime" depends on EXPERIMENTAL help @@ -170,21 +170,21 @@ config INOXID_RUNTIME endchoice -config XID_TAG_NFSD +config TAG_NFSD bool "Tag NFSD User Auth and Files" default n help Enable this if you do want the in-kernel NFS - Server to use the xid tagging specified above. + Server to use the tagging specified above. (will require patched clients too) -config XID_PROPAGATE - bool "Enable XID Propagation" +config PROPAGATE + bool "Enable Inode Tag Propagation" default n depends on EXPERIMENTAL help - This allows for the xid= mount option to specify - an xid which is to be used for the entire mount + This allows for the tagid= mount option to specify + a tagid which is to be used for the entire mount tree. config VSERVER_DEBUG diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/kernel/vserver/dlimit.c linux-2.6.16-rc1-vs2.1.0.6.2b/kernel/vserver/dlimit.c --- linux-2.6.16-rc1-vs2.1.0.6.1/kernel/vserver/dlimit.c 2006-01-21 18:28:14 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/kernel/vserver/dlimit.c 2006-01-25 05:34:51 +0100 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -29,12 +30,12 @@ * allocate an initialized dl_info struct * doesn't make it visible (hash) */ -static struct dl_info *__alloc_dl_info(struct super_block *sb, xid_t xid) +static struct dl_info *__alloc_dl_info(struct super_block *sb, tag_t tag) { struct dl_info *new = NULL; vxdprintk(VXD_CBIT(dlim, 5), - "alloc_dl_info(%p,%d)*", sb, xid); + "alloc_dl_info(%p,%d)*", sb, tag); /* would this benefit from a slab cache? */ new = kmalloc(sizeof(struct dl_info), GFP_KERNEL); @@ -42,7 +43,7 @@ static struct dl_info *__alloc_dl_info(s return 0; memset (new, 0, sizeof(struct dl_info)); - new->dl_xid = xid; + new->dl_tag = tag; new->dl_sb = sb; INIT_RCU_HEAD(&new->dl_rcu); INIT_HLIST_NODE(&new->dl_hlist); @@ -53,7 +54,7 @@ static struct dl_info *__alloc_dl_info(s /* rest of init goes here */ vxdprintk(VXD_CBIT(dlim, 4), - "alloc_dl_info(%p,%d) = %p", sb, xid, new); + "alloc_dl_info(%p,%d) = %p", sb, tag, new); return new; } @@ -67,7 +68,7 @@ static void __dealloc_dl_info(struct dl_ "dealloc_dl_info(%p)", dli); dli->dl_hlist.next = LIST_POISON1; - dli->dl_xid = -1; + dli->dl_tag = -1; dli->dl_sb = 0; BUG_ON(atomic_read(&dli->dl_usecnt)); @@ -103,9 +104,9 @@ static inline void __hash_dl_info(struct struct hlist_head *head; vxdprintk(VXD_CBIT(dlim, 6), - "__hash_dl_info: %p[#%d]", dli, dli->dl_xid); + "__hash_dl_info: %p[#%d]", dli, dli->dl_tag); get_dl_info(dli); - head = &dl_info_hash[__hashval(dli->dl_sb, dli->dl_xid)]; + head = &dl_info_hash[__hashval(dli->dl_sb, dli->dl_tag)]; hlist_add_head_rcu(&dli->dl_hlist, head); } @@ -117,7 +118,7 @@ static inline void __hash_dl_info(struct static inline void __unhash_dl_info(struct dl_info *dli) { vxdprintk(VXD_CBIT(dlim, 6), - "__unhash_dl_info: %p[#%d]", dli, dli->dl_xid); + "__unhash_dl_info: %p[#%d]", dli, dli->dl_tag); hlist_del_rcu(&dli->dl_hlist); put_dl_info(dli); } @@ -128,9 +129,9 @@ static inline void __unhash_dl_info(stru * requires the rcu_read_lock() * doesn't increment the dl_refcnt */ -static inline struct dl_info *__lookup_dl_info(struct super_block *sb, xid_t xid) +static inline struct dl_info *__lookup_dl_info(struct super_block *sb, tag_t tag) { - struct hlist_head *head = &dl_info_hash[__hashval(sb, xid)]; + struct hlist_head *head = &dl_info_hash[__hashval(sb, tag)]; struct hlist_node *pos; struct dl_info *dli; @@ -139,7 +140,7 @@ static inline struct dl_info *__lookup_d // struct dl_info *dli = // hlist_entry(pos, struct dl_info, dl_hlist); - if (dli->dl_xid == xid && dli->dl_sb == sb) { + if (dli->dl_tag == tag && dli->dl_sb == sb) { return dli; } } @@ -484,7 +485,7 @@ void vx_vsi_statfs(struct super_block *s __u64 blimit, bfree, bavail; __u32 ifree; - dli = locate_dl_info(sb, vx_current_xid()); + dli = locate_dl_info(sb, dx_current_tag()); if (!dli) return; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/kernel/vserver/inode.c linux-2.6.16-rc1-vs2.1.0.6.2b/kernel/vserver/inode.c --- linux-2.6.16-rc1-vs2.1.0.6.1/kernel/vserver/inode.c 2006-01-21 20:20:01 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/kernel/vserver/inode.c 2006-01-25 08:07:11 +0100 @@ -19,20 +19,20 @@ #include #include #include -#include +#include #include #include -static int __vc_get_iattr(struct inode *in, uint32_t *xid, uint32_t *flags, uint32_t *mask) +static int __vc_get_iattr(struct inode *in, uint32_t *tag, uint32_t *flags, uint32_t *mask) { struct proc_dir_entry *entry; if (!in || !in->i_sb) return -ESRCH; - *flags = IATTR_XID + *flags = IATTR_TAG | (IS_BARRIER(in) ? IATTR_BARRIER : 0) | (IS_IUNLINK(in) ? IATTR_IUNLINK : 0) | (IS_IMMUTABLE(in) ? IATTR_IMMUTABLE : 0); @@ -41,9 +41,9 @@ static int __vc_get_iattr(struct inode * if (S_ISDIR(in->i_mode)) *mask |= IATTR_BARRIER; - if (IS_TAGXID(in)) { - *xid = in->i_xid; - *mask |= IATTR_XID; + if (IS_TAGGED(in)) { + *tag = in->i_tag; + *mask |= IATTR_TAG; } switch (in->i_sb->s_magic) { @@ -60,8 +60,8 @@ static int __vc_get_iattr(struct inode * break; case DEVPTS_SUPER_MAGIC: - *xid = in->i_xid; - *mask |= IATTR_XID; + *tag = in->i_tag; + *mask |= IATTR_TAG; break; default: @@ -125,10 +125,10 @@ int vc_get_iattr_x32(uint32_t id, void _ #endif /* CONFIG_COMPAT */ -static int __vc_set_iattr(struct dentry *de, uint32_t *xid, uint32_t *flags, uint32_t *mask) +static int __vc_set_iattr(struct dentry *de, uint32_t *tag, uint32_t *flags, uint32_t *mask) { struct inode *in = de->d_inode; - int error = 0, is_proc = 0, has_xid = 0; + int error = 0, is_proc = 0, has_tag = 0; struct iattr attr = { 0 }; if (!in || !in->i_sb) @@ -138,15 +138,15 @@ static int __vc_set_iattr(struct dentry if ((*mask & IATTR_FLAGS) && !is_proc) return -EINVAL; - has_xid = IS_TAGXID(in) || + has_tag = IS_TAGGED(in) || (in->i_sb->s_magic == DEVPTS_SUPER_MAGIC); - if ((*mask & IATTR_XID) && !has_xid) + if ((*mask & IATTR_TAG) && !has_tag) return -EINVAL; mutex_lock(&in->i_mutex); - if (*mask & IATTR_XID) { - attr.ia_xid = *xid; - attr.ia_valid |= ATTR_XID; + if (*mask & IATTR_TAG) { + attr.ia_tag = *tag; + attr.ia_valid |= ATTR_TAG; } if (*mask & IATTR_FLAGS) { @@ -300,12 +300,12 @@ int vx_proc_ioctl(struct inode * inode, } #endif /* CONFIG_VSERVER_LEGACY */ -#ifdef CONFIG_XID_PROPAGATE +#ifdef CONFIG_PROPAGATE -int vx_parse_xid(char *string, xid_t *xid, int remove) +int dx_parse_tag(char *string, tag_t *tag, int remove) { static match_table_t tokens = { - {1, "xid=%u"}, + {1, "tagid=%u"}, {0, NULL} }; substring_t args[MAX_OPT_ARGS]; @@ -315,15 +315,15 @@ int vx_parse_xid(char *string, xid_t *xi return 0; token = match_token(string, tokens, args); - if (token && xid && !match_int(args, &option)) - *xid = option; + if (token && tag && !match_int(args, &option)) + *tag = option; - vxdprintk(VXD_CBIT(xid, 7), - "vx_parse_xid(»%s«): %d:#%d", + vxdprintk(VXD_CBIT(tag, 7), + "dx_parse_tag(»%s«): %d:#%d", string, token, option); - if (token && remove) { - char *p = strstr(string, "xid="); + if ((token == 1) && remove) { + char *p = strstr(string, "tagid="); char *q = p; if (p) { @@ -338,9 +338,9 @@ int vx_parse_xid(char *string, xid_t *xi return token; } -void __vx_propagate_xid(struct nameidata *nd, struct inode *inode) +void __dx_propagate_tag(struct nameidata *nd, struct inode *inode) { - xid_t new_xid = 0; + tag_t new_tag = 0; struct vfsmount *mnt; int propagate; @@ -350,22 +350,22 @@ void __vx_propagate_xid(struct nameidata if (!mnt) return; - propagate = (mnt->mnt_flags & MNT_XID); + propagate = (mnt->mnt_flags & MNT_TAGID); if (propagate) - new_xid = mnt->mnt_xid; + new_tag = mnt->mnt_tag; - vxdprintk(VXD_CBIT(xid, 7), - "vx_propagate_xid(%p[#%lu.%d]): %d,%d", - inode, inode->i_ino, inode->i_xid, - new_xid, (propagate)?1:0); + vxdprintk(VXD_CBIT(tag, 7), + "dx_propagate_tag(%p[#%lu.%d]): %d,%d", + inode, inode->i_ino, inode->i_tag, + new_tag, (propagate)?1:0); if (propagate) - inode->i_xid = new_xid; + inode->i_tag = new_tag; } #include -EXPORT_SYMBOL_GPL(__vx_propagate_xid); +EXPORT_SYMBOL_GPL(__dx_propagate_tag); -#endif /* CONFIG_XID_PROPAGATE */ +#endif /* CONFIG_PROPAGATE */ diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/kernel/vserver/sysctl.c linux-2.6.16-rc1-vs2.1.0.6.2b/kernel/vserver/sysctl.c --- linux-2.6.16-rc1-vs2.1.0.6.1/kernel/vserver/sysctl.c 2006-01-21 18:28:14 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/kernel/vserver/sysctl.c 2006-01-25 05:34:51 +0100 @@ -29,6 +29,7 @@ enum { CTL_DEBUG_SWITCH = 1, CTL_DEBUG_XID, CTL_DEBUG_NID, + CTL_DEBUG_TAG, CTL_DEBUG_NET, CTL_DEBUG_LIMIT, CTL_DEBUG_DLIM, @@ -41,6 +42,7 @@ enum { unsigned int vx_debug_switch = 0; unsigned int vx_debug_xid = 0; unsigned int vx_debug_nid = 0; +unsigned int vx_debug_tag = 0; unsigned int vx_debug_net = 0; unsigned int vx_debug_limit = 0; unsigned int vx_debug_dlim = 0; @@ -142,6 +144,7 @@ static ctl_table debug_table[] = { CTL_ENTRY (CTL_DEBUG_SWITCH, debug_switch), CTL_ENTRY (CTL_DEBUG_XID, debug_xid), CTL_ENTRY (CTL_DEBUG_NID, debug_nid), + CTL_ENTRY (CTL_DEBUG_TAG, debug_tag), CTL_ENTRY (CTL_DEBUG_NET, debug_net), CTL_ENTRY (CTL_DEBUG_LIMIT, debug_limit), CTL_ENTRY (CTL_DEBUG_DLIM, debug_dlim), @@ -166,6 +169,7 @@ static match_table_t tokens = { { CTL_DEBUG_SWITCH, "switch=%x" }, { CTL_DEBUG_XID, "xid=%x" }, { CTL_DEBUG_NID, "nid=%x" }, + { CTL_DEBUG_TAG, "tag=%x" }, { CTL_DEBUG_NET, "net=%x" }, { CTL_DEBUG_LIMIT, "limit=%x" }, { CTL_DEBUG_DLIM, "dlim=%x" }, diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/kernel/vserver/vci_config.h linux-2.6.16-rc1-vs2.1.0.6.2b/kernel/vserver/vci_config.h --- linux-2.6.16-rc1-vs2.1.0.6.1/kernel/vserver/vci_config.h 2006-01-21 18:28:14 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/kernel/vserver/vci_config.h 2006-01-25 06:09:52 +0100 @@ -14,7 +14,7 @@ enum { VCI_KCBIT_LEGACY_VERSION = 15, VCI_KCBIT_DEBUG = 16, VCI_KCBIT_HISTORY = 20, - VCI_KCBIT_TAGXID = 24, + VCI_KCBIT_TAGGED = 24, }; @@ -57,21 +57,21 @@ static inline uint32_t vci_kernel_config (1 << VCI_KCBIT_HISTORY) | #endif - /* inode xid tagging */ -#if defined(CONFIG_INOXID_NONE) - (0 << VCI_KCBIT_TAGXID) | -#elif defined(CONFIG_INOXID_UID16) - (1 << VCI_KCBIT_TAGXID) | -#elif defined(CONFIG_INOXID_GID16) - (2 << VCI_KCBIT_TAGXID) | -#elif defined(CONFIG_INOXID_UGID24) - (3 << VCI_KCBIT_TAGXID) | -#elif defined(CONFIG_INOXID_INTERN) - (4 << VCI_KCBIT_TAGXID) | -#elif defined(CONFIG_INOXID_RUNTIME) - (5 << VCI_KCBIT_TAGXID) | + /* inode context tagging */ +#if defined(CONFIG_TAGGING_NONE) + (0 << VCI_KCBIT_TAGGED) | +#elif defined(CONFIG_TAGGING_UID16) + (1 << VCI_KCBIT_TAGGED) | +#elif defined(CONFIG_TAGGING_GID16) + (2 << VCI_KCBIT_TAGGED) | +#elif defined(CONFIG_TAGGING_ID24) + (3 << VCI_KCBIT_TAGGED) | +#elif defined(CONFIG_TAGGING_INTERN) + (4 << VCI_KCBIT_TAGGED) | +#elif defined(CONFIG_TAGGING_RUNTIME) + (5 << VCI_KCBIT_TAGGED) | #else - (7 << VCI_KCBIT_TAGXID) | + (7 << VCI_KCBIT_TAGGED) | #endif 0; } diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/net/sunrpc/auth.c linux-2.6.16-rc1-vs2.1.0.6.2b/net/sunrpc/auth.c --- linux-2.6.16-rc1-vs2.1.0.6.1/net/sunrpc/auth.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/net/sunrpc/auth.c 2006-01-25 05:34:51 +0100 @@ -13,7 +13,7 @@ #include #include #include -#include +#include #ifdef RPC_DEBUG # define RPCDBG_FACILITY RPCDBG_AUTH @@ -244,7 +244,7 @@ rpcauth_lookupcred(struct rpc_auth *auth struct auth_cred acred = { .uid = current->fsuid, .gid = current->fsgid, - .xid = vx_current_xid(), + .tag = dx_current_tag(), .group_info = current->group_info, }; struct rpc_cred *ret; @@ -264,7 +264,7 @@ rpcauth_bindcred(struct rpc_task *task) struct auth_cred acred = { .uid = current->fsuid, .gid = current->fsgid, - .xid = vx_current_xid(), + .tag = dx_current_tag(), .group_info = current->group_info, }; struct rpc_cred *ret; diff -NurpP linux-2.6.16-rc1-vs2.1.0.6.1/net/sunrpc/auth_unix.c linux-2.6.16-rc1-vs2.1.0.6.2b/net/sunrpc/auth_unix.c --- linux-2.6.16-rc1-vs2.1.0.6.1/net/sunrpc/auth_unix.c 2006-01-21 18:28:13 +0100 +++ linux-2.6.16-rc1-vs2.1.0.6.2b/net/sunrpc/auth_unix.c 2006-01-25 05:34:51 +0100 @@ -11,7 +11,7 @@ #include #include #include -#include +#include #define NFS_NGROUPS 16 @@ -80,7 +80,7 @@ unx_create_cred(struct rpc_auth *auth, s if (flags & RPC_TASK_ROOTCREDS) { cred->uc_uid = 0; cred->uc_gid = 0; - cred->uc_xid = vx_current_xid(); + cred->uc_tag = dx_current_tag(); cred->uc_gids[0] = NOGROUP; } else { int groups = acred->group_info->ngroups; @@ -89,7 +89,7 @@ unx_create_cred(struct rpc_auth *auth, s cred->uc_uid = acred->uid; cred->uc_gid = acred->gid; - cred->uc_xid = acred->xid; + cred->uc_tag = acred->tag; for (i = 0; i < groups; i++) cred->uc_gids[i] = GROUP_AT(acred->group_info, i); if (i < NFS_NGROUPS) @@ -122,7 +122,7 @@ unx_match(struct auth_cred *acred, struc if (cred->uc_uid != acred->uid || cred->uc_gid != acred->gid - || cred->uc_xid != acred->xid) + || cred->uc_tag != acred->tag) return 0; groups = acred->group_info->ngroups; @@ -148,7 +148,7 @@ unx_marshal(struct rpc_task *task, u32 * struct rpc_clnt *clnt = task->tk_client; struct unx_cred *cred = (struct unx_cred *) task->tk_msg.rpc_cred; u32 *base, *hold; - int i, tagxid; + int i, tag; *p++ = htonl(RPC_AUTH_UNIX); base = p++; @@ -158,12 +158,12 @@ unx_marshal(struct rpc_task *task, u32 * * Copy the UTS nodename captured when the client was created. */ p = xdr_encode_array(p, clnt->cl_nodename, clnt->cl_nodelen); - tagxid = task->tk_client->cl_tagxid; + tag = task->tk_client->cl_tag; - *p++ = htonl((u32) XIDINO_UID(tagxid, - cred->uc_uid, cred->uc_xid)); - *p++ = htonl((u32) XIDINO_GID(tagxid, - cred->uc_gid, cred->uc_xid)); + *p++ = htonl((u32) TAGINO_UID(tag, + cred->uc_uid, cred->uc_tag)); + *p++ = htonl((u32) TAGINO_GID(tag, + cred->uc_gid, cred->uc_tag)); hold = p++; for (i = 0; i < 16 && cred->uc_gids[i] != (gid_t) NOGROUP; i++) *p++ = htonl((u32) cred->uc_gids[i]);