-diff -NurpP --minimal linux-3.10.9/fs/super.c linux-3.10.9-vs2.3.6.6/fs/super.c
---- linux-3.10.9/fs/super.c 2013-08-22 19:51:35.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/super.c 2013-08-22 20:30:00.000000000 +0000
-@@ -34,6 +34,8 @@
- #include <linux/cleancache.h>
- #include <linux/fsnotify.h>
- #include <linux/lockdep.h>
-+#include <linux/magic.h>
-+#include <linux/vs_context.h>
- #include "internal.h"
-
-
-@@ -1112,6 +1114,13 @@ mount_fs(struct file_system_type *type,
- WARN_ON(sb->s_bdi == &default_backing_dev_info);
- sb->s_flags |= MS_BORN;
-
-+ error = -EPERM;
-+ if (!vx_capable(CAP_SYS_ADMIN, VXC_BINARY_MOUNT) &&
-+ !sb->s_bdev &&
-+ (sb->s_magic != PROC_SUPER_MAGIC) &&
-+ (sb->s_magic != DEVPTS_SUPER_MAGIC))
-+ goto out_sb;
-+
- error = security_sb_kern_mount(sb, flags, secdata);
- if (error)
- goto out_sb;
-diff -NurpP --minimal linux-3.10.9/fs/sysfs/mount.c linux-3.10.9-vs2.3.6.6/fs/sysfs/mount.c
---- linux-3.10.9/fs/sysfs/mount.c 2013-05-31 13:45:25.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/sysfs/mount.c 2013-08-22 20:30:00.000000000 +0000
-@@ -48,7 +48,7 @@ static int sysfs_fill_super(struct super
-
- sb->s_blocksize = PAGE_CACHE_SIZE;
- sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
-- sb->s_magic = SYSFS_MAGIC;
-+ sb->s_magic = SYSFS_SUPER_MAGIC;
- sb->s_op = &sysfs_ops;
- sb->s_time_gran = 1;
-
-diff -NurpP --minimal linux-3.10.9/fs/utimes.c linux-3.10.9-vs2.3.6.6/fs/utimes.c
---- linux-3.10.9/fs/utimes.c 2013-02-19 13:58:49.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/utimes.c 2013-08-22 20:30:00.000000000 +0000
-@@ -8,6 +8,8 @@
- #include <linux/stat.h>
- #include <linux/utime.h>
- #include <linux/syscalls.h>
-+#include <linux/mount.h>
-+#include <linux/vs_cowbl.h>
- #include <asm/uaccess.h>
- #include <asm/unistd.h>
-
-@@ -52,12 +54,18 @@ static int utimes_common(struct path *pa
- {
- int error;
- struct iattr newattrs;
-- struct inode *inode = path->dentry->d_inode;
-+ struct inode *inode;
-+
-+ error = cow_check_and_break(path);
-+ if (error)
-+ goto out;
-
- error = mnt_want_write(path->mnt);
- if (error)
- goto out;
-
-+ inode = path->dentry->d_inode;
-+
- if (times && times[0].tv_nsec == UTIME_NOW &&
- times[1].tv_nsec == UTIME_NOW)
- times = NULL;
-diff -NurpP --minimal linux-3.10.9/fs/xattr.c linux-3.10.9-vs2.3.6.6/fs/xattr.c
---- linux-3.10.9/fs/xattr.c 2013-02-19 13:58:49.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xattr.c 2013-08-22 20:30:00.000000000 +0000
-@@ -21,6 +21,7 @@
- #include <linux/audit.h>
- #include <linux/vmalloc.h>
- #include <linux/posix_acl_xattr.h>
-+#include <linux/mount.h>
-
- #include <asm/uaccess.h>
-
-@@ -52,7 +53,7 @@ xattr_permission(struct inode *inode, co
- * The trusted.* namespace can only be accessed by privileged users.
- */
- if (!strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN)) {
-- if (!capable(CAP_SYS_ADMIN))
-+ if (!vx_capable(CAP_SYS_ADMIN, VXC_FS_TRUSTED))
- return (mask & MAY_WRITE) ? -EPERM : -ENODATA;
- return 0;
- }
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_dinode.h linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_dinode.h
---- linux-3.10.9/fs/xfs/xfs_dinode.h 2013-07-14 17:01:29.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_dinode.h 2013-08-22 20:30:00.000000000 +0000
-@@ -51,7 +51,9 @@ typedef struct xfs_dinode {
- __be32 di_nlink; /* number of links to file */
- __be16 di_projid_lo; /* lower part of owner's project id */
- __be16 di_projid_hi; /* higher part owner's project id */
-- __u8 di_pad[6]; /* unused, zeroed space */
-+ __u8 di_pad[2]; /* unused, zeroed space */
-+ __be16 di_tag; /* context tagging */
-+ __be16 di_vflags; /* vserver specific flags */
- __be16 di_flushiter; /* incremented on flush */
- xfs_timestamp_t di_atime; /* time last accessed */
- xfs_timestamp_t di_mtime; /* time last modified */
-@@ -209,6 +211,8 @@ static inline void xfs_dinode_put_rdev(s
- #define XFS_DIFLAG_EXTSZINHERIT_BIT 12 /* inherit inode extent size */
- #define XFS_DIFLAG_NODEFRAG_BIT 13 /* do not reorganize/defragment */
- #define XFS_DIFLAG_FILESTREAM_BIT 14 /* use filestream allocator */
-+#define XFS_DIFLAG_IXUNLINK_BIT 15 /* Immutable inver on unlink */
-+
- #define XFS_DIFLAG_REALTIME (1 << XFS_DIFLAG_REALTIME_BIT)
- #define XFS_DIFLAG_PREALLOC (1 << XFS_DIFLAG_PREALLOC_BIT)
- #define XFS_DIFLAG_NEWRTBM (1 << XFS_DIFLAG_NEWRTBM_BIT)
-@@ -224,6 +228,7 @@ static inline void xfs_dinode_put_rdev(s
- #define XFS_DIFLAG_EXTSZINHERIT (1 << XFS_DIFLAG_EXTSZINHERIT_BIT)
- #define XFS_DIFLAG_NODEFRAG (1 << XFS_DIFLAG_NODEFRAG_BIT)
- #define XFS_DIFLAG_FILESTREAM (1 << XFS_DIFLAG_FILESTREAM_BIT)
-+#define XFS_DIFLAG_IXUNLINK (1 << XFS_DIFLAG_IXUNLINK_BIT)
-
- #ifdef CONFIG_XFS_RT
- #define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)
-@@ -236,6 +241,10 @@ static inline void xfs_dinode_put_rdev(s
- XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \
- XFS_DIFLAG_NOATIME | XFS_DIFLAG_NODUMP | XFS_DIFLAG_RTINHERIT | \
- XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS | XFS_DIFLAG_EXTSIZE | \
-- XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM)
-+ XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM | \
-+ XFS_DIFLAG_IXUNLINK)
-+
-+#define XFS_DIVFLAG_BARRIER 0x01
-+#define XFS_DIVFLAG_COW 0x02
-
- #endif /* __XFS_DINODE_H__ */
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_fs.h linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_fs.h
---- linux-3.10.9/fs/xfs/xfs_fs.h 2013-07-14 17:01:29.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_fs.h 2013-08-22 20:30:00.000000000 +0000
-@@ -67,6 +67,9 @@ struct fsxattr {
- #define XFS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */
- #define XFS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */
- #define XFS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */
-+#define XFS_XFLAG_IXUNLINK 0x00008000 /* immutable invert on unlink */
-+#define XFS_XFLAG_BARRIER 0x10000000 /* chroot() barrier */
-+#define XFS_XFLAG_COW 0x20000000 /* copy on write mark */
- #define XFS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */
-
- /*
-@@ -304,7 +307,8 @@ typedef struct xfs_bstat {
- #define bs_projid bs_projid_lo /* (previously just bs_projid) */
- __u16 bs_forkoff; /* inode fork offset in bytes */
- __u16 bs_projid_hi; /* higher part of project id */
-- unsigned char bs_pad[10]; /* pad space, unused */
-+ unsigned char bs_pad[8]; /* pad space, unused */
-+ __u16 bs_tag; /* context tagging */
- __u32 bs_dmevmask; /* DMIG event mask */
- __u16 bs_dmstate; /* DMIG state info */
- __u16 bs_aextents; /* attribute number of extents */
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_ialloc.c linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_ialloc.c
---- linux-3.10.9/fs/xfs/xfs_ialloc.c 2013-07-14 17:01:29.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_ialloc.c 2013-08-22 20:30:00.000000000 +0000
-@@ -39,7 +39,6 @@
- #include "xfs_cksum.h"
- #include "xfs_buf_item.h"
-
--
- /*
- * Allocation group level functions.
- */
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_inode.c linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_inode.c
---- linux-3.10.9/fs/xfs/xfs_inode.c 2013-07-14 17:01:29.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_inode.c 2013-08-22 21:50:34.000000000 +0000
-@@ -16,6 +16,7 @@
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
- #include <linux/log2.h>
-+#include <linux/vs_tag.h>
-
- #include "xfs.h"
- #include "xfs_fs.h"
-@@ -836,15 +837,25 @@ xfs_iformat_btree(
- STATIC void
- xfs_dinode_from_disk(
- xfs_icdinode_t *to,
-- xfs_dinode_t *from)
-+ xfs_dinode_t *from,
-+ int tagged)
- {
-+ uint32_t uid, gid, tag;
-+
- to->di_magic = be16_to_cpu(from->di_magic);
- to->di_mode = be16_to_cpu(from->di_mode);
- to->di_version = from ->di_version;
- to->di_format = from->di_format;
- to->di_onlink = be16_to_cpu(from->di_onlink);
-- to->di_uid = be32_to_cpu(from->di_uid);
-- to->di_gid = be32_to_cpu(from->di_gid);
-+
-+ uid = be32_to_cpu(from->di_uid);
-+ gid = be32_to_cpu(from->di_gid);
-+ tag = be16_to_cpu(from->di_tag);
-+
-+ to->di_uid = INOTAG_UID(tagged, uid, gid);
-+ to->di_gid = INOTAG_GID(tagged, uid, gid);
-+ to->di_tag = INOTAG_TAG(tagged, uid, gid, tag);
-+
- to->di_nlink = be32_to_cpu(from->di_nlink);
- to->di_projid_lo = be16_to_cpu(from->di_projid_lo);
- to->di_projid_hi = be16_to_cpu(from->di_projid_hi);
-@@ -866,6 +877,7 @@ xfs_dinode_from_disk(
- to->di_dmevmask = be32_to_cpu(from->di_dmevmask);
- to->di_dmstate = be16_to_cpu(from->di_dmstate);
- to->di_flags = be16_to_cpu(from->di_flags);
-+ to->di_vflags = be16_to_cpu(from->di_vflags);
- to->di_gen = be32_to_cpu(from->di_gen);
-
- if (to->di_version == 3) {
-@@ -883,15 +895,19 @@ xfs_dinode_from_disk(
- void
- xfs_dinode_to_disk(
- xfs_dinode_t *to,
-- xfs_icdinode_t *from)
-+ xfs_icdinode_t *from,
-+ int tagged)
- {
- to->di_magic = cpu_to_be16(from->di_magic);
- to->di_mode = cpu_to_be16(from->di_mode);
- to->di_version = from ->di_version;
- to->di_format = from->di_format;
- to->di_onlink = cpu_to_be16(from->di_onlink);
-- to->di_uid = cpu_to_be32(from->di_uid);
-- to->di_gid = cpu_to_be32(from->di_gid);
-+
-+ to->di_uid = cpu_to_be32(TAGINO_UID(tagged, from->di_uid, from->di_tag));
-+ to->di_gid = cpu_to_be32(TAGINO_GID(tagged, from->di_gid, from->di_tag));
-+ to->di_tag = cpu_to_be16(TAGINO_TAG(tagged, from->di_tag));
-+
- to->di_nlink = cpu_to_be32(from->di_nlink);
- to->di_projid_lo = cpu_to_be16(from->di_projid_lo);
- to->di_projid_hi = cpu_to_be16(from->di_projid_hi);
-@@ -913,6 +929,7 @@ xfs_dinode_to_disk(
- to->di_dmevmask = cpu_to_be32(from->di_dmevmask);
- to->di_dmstate = cpu_to_be16(from->di_dmstate);
- to->di_flags = cpu_to_be16(from->di_flags);
-+ to->di_vflags = cpu_to_be16(from->di_vflags);
- to->di_gen = cpu_to_be32(from->di_gen);
-
- if (from->di_version == 3) {
-@@ -929,7 +946,8 @@ xfs_dinode_to_disk(
-
- STATIC uint
- _xfs_dic2xflags(
-- __uint16_t di_flags)
-+ __uint16_t di_flags,
-+ __uint16_t di_vflags)
- {
- uint flags = 0;
-
-@@ -940,6 +958,8 @@ _xfs_dic2xflags(
- flags |= XFS_XFLAG_PREALLOC;
- if (di_flags & XFS_DIFLAG_IMMUTABLE)
- flags |= XFS_XFLAG_IMMUTABLE;
-+ if (di_flags & XFS_DIFLAG_IXUNLINK)
-+ flags |= XFS_XFLAG_IXUNLINK;
- if (di_flags & XFS_DIFLAG_APPEND)
- flags |= XFS_XFLAG_APPEND;
- if (di_flags & XFS_DIFLAG_SYNC)
-@@ -964,6 +984,10 @@ _xfs_dic2xflags(
- flags |= XFS_XFLAG_FILESTREAM;
- }
-
-+ if (di_vflags & XFS_DIVFLAG_BARRIER)
-+ flags |= FS_BARRIER_FL;
-+ if (di_vflags & XFS_DIVFLAG_COW)
-+ flags |= FS_COW_FL;
- return flags;
- }
-
-@@ -973,7 +997,7 @@ xfs_ip2xflags(
- {
- xfs_icdinode_t *dic = &ip->i_d;
-
-- return _xfs_dic2xflags(dic->di_flags) |
-+ return _xfs_dic2xflags(dic->di_flags, dic->di_vflags) |
- (XFS_IFORK_Q(ip) ? XFS_XFLAG_HASATTR : 0);
- }
-
-@@ -981,7 +1005,8 @@ uint
- xfs_dic2xflags(
- xfs_dinode_t *dip)
- {
-- return _xfs_dic2xflags(be16_to_cpu(dip->di_flags)) |
-+ return _xfs_dic2xflags(be16_to_cpu(dip->di_flags),
-+ be16_to_cpu(dip->di_vflags)) |
- (XFS_DFORK_Q(dip) ? XFS_XFLAG_HASATTR : 0);
- }
-
-@@ -1072,7 +1097,8 @@ xfs_iread(
- * Otherwise, just get the truly permanent information.
- */
- if (dip->di_mode) {
-- xfs_dinode_from_disk(&ip->i_d, dip);
-+ xfs_dinode_from_disk(&ip->i_d, dip,
-+ mp->m_flags & XFS_MOUNT_TAGGED);
- error = xfs_iformat(ip, dip);
- if (error) {
- #ifdef DEBUG
-@@ -1270,6 +1296,7 @@ xfs_ialloc(
- ASSERT(ip->i_d.di_nlink == nlink);
- ip->i_d.di_uid = current_fsuid();
- ip->i_d.di_gid = current_fsgid();
-+ ip->i_d.di_tag = current_fstag(&ip->i_vnode);
- xfs_set_projid(ip, prid);
- memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad));
-
-@@ -1329,6 +1356,7 @@ xfs_ialloc(
- ip->i_d.di_dmevmask = 0;
- ip->i_d.di_dmstate = 0;
- ip->i_d.di_flags = 0;
-+ ip->i_d.di_vflags = 0;
-
- if (ip->i_d.di_version == 3) {
- ASSERT(ip->i_d.di_ino == ino);
-@@ -2052,6 +2080,7 @@ xfs_ifree(
- }
- ip->i_d.di_mode = 0; /* mark incore inode as free */
- ip->i_d.di_flags = 0;
-+ ip->i_d.di_vflags = 0;
- ip->i_d.di_dmevmask = 0;
- ip->i_d.di_forkoff = 0; /* mark the attr fork not in use */
- ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS;
-@@ -2219,7 +2248,6 @@ xfs_iroot_realloc(
- return;
- }
-
--
- /*
- * This is called when the amount of space needed for if_data
- * is increased or decreased. The change in size is indicated by
-@@ -2899,7 +2927,8 @@ xfs_iflush_int(
- * because if the inode is dirty at all the core must
- * be.
- */
-- xfs_dinode_to_disk(dip, &ip->i_d);
-+ xfs_dinode_to_disk(dip, &ip->i_d,
-+ mp->m_flags & XFS_MOUNT_TAGGED);
-
- /* Wrap, we never let the log put out DI_MAX_FLUSH */
- if (ip->i_d.di_flushiter == DI_MAX_FLUSH)
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_inode.h linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_inode.h
---- linux-3.10.9/fs/xfs/xfs_inode.h 2013-07-14 17:01:30.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_inode.h 2013-08-22 20:30:00.000000000 +0000
-@@ -134,7 +134,9 @@ typedef struct xfs_icdinode {
- __uint32_t di_nlink; /* number of links to file */
- __uint16_t di_projid_lo; /* lower part of owner's project id */
- __uint16_t di_projid_hi; /* higher part of owner's project id */
-- __uint8_t di_pad[6]; /* unused, zeroed space */
-+ __uint8_t di_pad[2]; /* unused, zeroed space */
-+ __uint16_t di_tag; /* context tagging */
-+ __uint16_t di_vflags; /* vserver specific flags */
- __uint16_t di_flushiter; /* incremented on flush */
- xfs_ictimestamp_t di_atime; /* time last accessed */
- xfs_ictimestamp_t di_mtime; /* time last modified */
-@@ -583,7 +585,7 @@ int xfs_iread(struct xfs_mount *, struc
- struct xfs_inode *, uint);
- void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *);
- void xfs_dinode_to_disk(struct xfs_dinode *,
-- struct xfs_icdinode *);
-+ struct xfs_icdinode *, int);
- void xfs_idestroy_fork(struct xfs_inode *, int);
- void xfs_idata_realloc(struct xfs_inode *, int, int);
- void xfs_iroot_realloc(struct xfs_inode *, int, int);
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_ioctl.c linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_ioctl.c
---- linux-3.10.9/fs/xfs/xfs_ioctl.c 2013-07-14 17:01:30.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_ioctl.c 2013-08-22 20:30:00.000000000 +0000
-@@ -26,7 +26,7 @@
- #include "xfs_bmap_btree.h"
- #include "xfs_dinode.h"
- #include "xfs_inode.h"
--#include "xfs_ioctl.h"
-+// #include "xfs_ioctl.h"
- #include "xfs_rtalloc.h"
- #include "xfs_itable.h"
- #include "xfs_error.h"
-@@ -769,6 +769,10 @@ xfs_merge_ioc_xflags(
- xflags |= XFS_XFLAG_IMMUTABLE;
- else
- xflags &= ~XFS_XFLAG_IMMUTABLE;
-+ if (flags & FS_IXUNLINK_FL)
-+ xflags |= XFS_XFLAG_IXUNLINK;
-+ else
-+ xflags &= ~XFS_XFLAG_IXUNLINK;
- if (flags & FS_APPEND_FL)
- xflags |= XFS_XFLAG_APPEND;
- else
-@@ -797,6 +801,8 @@ xfs_di2lxflags(
-
- if (di_flags & XFS_DIFLAG_IMMUTABLE)
- flags |= FS_IMMUTABLE_FL;
-+ if (di_flags & XFS_DIFLAG_IXUNLINK)
-+ flags |= FS_IXUNLINK_FL;
- if (di_flags & XFS_DIFLAG_APPEND)
- flags |= FS_APPEND_FL;
- if (di_flags & XFS_DIFLAG_SYNC)
-@@ -857,6 +863,8 @@ xfs_set_diflags(
- di_flags = (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC);
- if (xflags & XFS_XFLAG_IMMUTABLE)
- di_flags |= XFS_DIFLAG_IMMUTABLE;
-+ if (xflags & XFS_XFLAG_IXUNLINK)
-+ di_flags |= XFS_DIFLAG_IXUNLINK;
- if (xflags & XFS_XFLAG_APPEND)
- di_flags |= XFS_DIFLAG_APPEND;
- if (xflags & XFS_XFLAG_SYNC)
-@@ -899,6 +907,10 @@ xfs_diflags_to_linux(
- inode->i_flags |= S_IMMUTABLE;
- else
- inode->i_flags &= ~S_IMMUTABLE;
-+ if (xflags & XFS_XFLAG_IXUNLINK)
-+ inode->i_flags |= S_IXUNLINK;
-+ else
-+ inode->i_flags &= ~S_IXUNLINK;
- if (xflags & XFS_XFLAG_APPEND)
- inode->i_flags |= S_APPEND;
- else
-@@ -1403,10 +1415,18 @@ xfs_file_ioctl(
- case XFS_IOC_FSGETXATTRA:
- return xfs_ioc_fsgetxattr(ip, 1, arg);
- case XFS_IOC_FSSETXATTR:
-+ if (IS_BARRIER(inode)) {
-+ vxwprintk_task(1, "messing with the barrier.");
-+ return -XFS_ERROR(EACCES);
-+ }
- return xfs_ioc_fssetxattr(ip, filp, arg);
- case XFS_IOC_GETXFLAGS:
- return xfs_ioc_getxflags(ip, arg);
- case XFS_IOC_SETXFLAGS:
-+ if (IS_BARRIER(inode)) {
-+ vxwprintk_task(1, "messing with the barrier.");
-+ return -XFS_ERROR(EACCES);
-+ }
- return xfs_ioc_setxflags(ip, filp, arg);
-
- case XFS_IOC_FSSETDM: {
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_ioctl.h linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_ioctl.h
---- linux-3.10.9/fs/xfs/xfs_ioctl.h 2012-12-11 03:30:57.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_ioctl.h 2013-08-22 20:30:00.000000000 +0000
-@@ -70,6 +70,12 @@ xfs_handle_to_dentry(
- void __user *uhandle,
- u32 hlen);
-
-+extern int
-+xfs_sync_flags(
-+ struct inode *inode,
-+ int flags,
-+ int vflags);
-+
- extern long
- xfs_file_ioctl(
- struct file *filp,
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_iops.c linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_iops.c
---- linux-3.10.9/fs/xfs/xfs_iops.c 2013-07-14 17:01:30.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_iops.c 2013-08-22 20:30:00.000000000 +0000
-@@ -28,6 +28,7 @@
- #include "xfs_bmap_btree.h"
- #include "xfs_dinode.h"
- #include "xfs_inode.h"
-+#include "xfs_ioctl.h"
- #include "xfs_bmap.h"
- #include "xfs_rtalloc.h"
- #include "xfs_error.h"
-@@ -47,6 +48,7 @@
- #include <linux/security.h>
- #include <linux/fiemap.h>
- #include <linux/slab.h>
-+#include <linux/vs_tag.h>
-
- static int
- xfs_initxattrs(
-@@ -422,6 +424,7 @@ xfs_vn_getattr(
- stat->nlink = ip->i_d.di_nlink;
- stat->uid = ip->i_d.di_uid;
- stat->gid = ip->i_d.di_gid;
-+ stat->tag = ip->i_d.di_tag;
- stat->ino = ip->i_ino;
- stat->atime = inode->i_atime;
- stat->mtime = inode->i_mtime;
-@@ -1054,6 +1057,7 @@ static const struct inode_operations xfs
- .listxattr = xfs_vn_listxattr,
- .fiemap = xfs_vn_fiemap,
- .update_time = xfs_vn_update_time,
-+ .sync_flags = xfs_sync_flags,
- };
-
- static const struct inode_operations xfs_dir_inode_operations = {
-@@ -1080,6 +1084,7 @@ static const struct inode_operations xfs
- .removexattr = generic_removexattr,
- .listxattr = xfs_vn_listxattr,
- .update_time = xfs_vn_update_time,
-+ .sync_flags = xfs_sync_flags,
- };
-
- static const struct inode_operations xfs_dir_ci_inode_operations = {
-@@ -1131,6 +1136,10 @@ xfs_diflags_to_iflags(
- inode->i_flags |= S_IMMUTABLE;
- else
- inode->i_flags &= ~S_IMMUTABLE;
-+ if (ip->i_d.di_flags & XFS_DIFLAG_IXUNLINK)
-+ inode->i_flags |= S_IXUNLINK;
-+ else
-+ inode->i_flags &= ~S_IXUNLINK;
- if (ip->i_d.di_flags & XFS_DIFLAG_APPEND)
- inode->i_flags |= S_APPEND;
- else
-@@ -1143,6 +1152,15 @@ xfs_diflags_to_iflags(
- inode->i_flags |= S_NOATIME;
- else
- inode->i_flags &= ~S_NOATIME;
-+
-+ if (ip->i_d.di_vflags & XFS_DIVFLAG_BARRIER)
-+ inode->i_vflags |= V_BARRIER;
-+ else
-+ inode->i_vflags &= ~V_BARRIER;
-+ if (ip->i_d.di_vflags & XFS_DIVFLAG_COW)
-+ inode->i_vflags |= V_COW;
-+ else
-+ inode->i_vflags &= ~V_COW;
- }
-
- /*
-@@ -1174,6 +1192,7 @@ xfs_setup_inode(
- set_nlink(inode, ip->i_d.di_nlink);
- inode->i_uid = ip->i_d.di_uid;
- inode->i_gid = ip->i_d.di_gid;
-+ inode->i_tag = ip->i_d.di_tag;
-
- switch (inode->i_mode & S_IFMT) {
- case S_IFBLK:
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_itable.c linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_itable.c
---- linux-3.10.9/fs/xfs/xfs_itable.c 2013-02-19 13:58:49.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_itable.c 2013-08-22 20:30:00.000000000 +0000
-@@ -97,6 +97,7 @@ xfs_bulkstat_one_int(
- buf->bs_mode = dic->di_mode;
- buf->bs_uid = dic->di_uid;
- buf->bs_gid = dic->di_gid;
-+ buf->bs_tag = dic->di_tag;
- buf->bs_size = dic->di_size;
- buf->bs_atime.tv_sec = dic->di_atime.t_sec;
- buf->bs_atime.tv_nsec = dic->di_atime.t_nsec;
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_linux.h linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_linux.h
---- linux-3.10.9/fs/xfs/xfs_linux.h 2013-07-14 17:01:30.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_linux.h 2013-08-22 20:30:00.000000000 +0000
-@@ -124,6 +124,7 @@
-
- #define current_cpu() (raw_smp_processor_id())
- #define current_pid() (current->pid)
-+#define current_fstag(vp) (dx_current_fstag((vp)->i_sb))
- #define current_test_flags(f) (current->flags & (f))
- #define current_set_flags_nested(sp, f) \
- (*(sp) = current->flags, current->flags |= (f))
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_log_recover.c linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_log_recover.c
---- linux-3.10.9/fs/xfs/xfs_log_recover.c 2013-07-14 17:01:31.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_log_recover.c 2013-08-22 21:48:01.000000000 +0000
-@@ -2662,7 +2662,7 @@ xlog_recover_inode_pass2(
- }
-
- /* The core is in in-core format */
-- xfs_dinode_to_disk(dip, dicp);
-+ xfs_dinode_to_disk(dip, dicp, mp->m_flags & XFS_MOUNT_TAGGED);
-
- /* the rest is in on-disk format */
- if (item->ri_buf[1].i_len > isize) {
-diff -NurpP --minimal linux-3.10.9/fs/xfs/xfs_mount.h linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_mount.h
---- linux-3.10.9/fs/xfs/xfs_mount.h 2013-07-14 17:01:31.000000000 +0000
-+++ linux-3.10.9-vs2.3.6.6/fs/xfs/xfs_mount.h 2013-08-22 20:30:00.000000000 +0000
-@@ -253,6 +253,7 @@ typedef struct xfs_mount {
- allocator */
- #define XFS_MOUNT_NOATTR2 (1ULL << 25) /* disable use of attr2 format */