This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / kernel / vserver / inode.c
index ca16e0c..60e6fe1 100644 (file)
  */
 
 #include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/vs_base.h>
 #include <linux/vs_context.h>
 #include <linux/fs.h>
 #include <linux/proc_fs.h>
-#include <linux/devpts_fs.h>
 #include <linux/namei.h>
-#include <linux/mount.h>
-#include <linux/parser.h>
 #include <linux/vserver/inode.h>
-#include <linux/vserver/xid.h>
 
 #include <asm/errno.h>
 #include <asm/uaccess.h>
@@ -27,8 +23,6 @@
 
 static int __vc_get_iattr(struct inode *in, uint32_t *xid, uint32_t *flags, uint32_t *mask)
 {
-       struct proc_dir_entry *entry;
-
        if (!in || !in->i_sb)
                return -ESRCH;
 
@@ -46,9 +40,8 @@ static int __vc_get_iattr(struct inode *in, uint32_t *xid, uint32_t *flags, uint
                *mask |= IATTR_XID;
        }
 
-       switch (in->i_sb->s_magic) {
-       case PROC_SUPER_MAGIC:
-               entry = PROC_I(in)->pde;
+       if (in->i_sb->s_magic == PROC_SUPER_MAGIC) {
+               struct proc_dir_entry *entry = PROC_I(in)->pde;
 
                // check for specific inodes ?
                if (entry)
@@ -57,15 +50,6 @@ static int __vc_get_iattr(struct inode *in, uint32_t *xid, uint32_t *flags, uint
                        *flags |= (entry->vx_flags & IATTR_FLAGS);
                else
                        *flags |= (PROC_I(in)->vx_flags & IATTR_FLAGS);
-               break;
-
-       case DEVPTS_SUPER_MAGIC:
-               *xid = in->i_xid;
-               *mask |= IATTR_XID;
-               break;
-
-       default:
-               break;
        }
        return 0;
 }
@@ -73,7 +57,7 @@ static int __vc_get_iattr(struct inode *in, uint32_t *xid, uint32_t *flags, uint
 int vc_get_iattr(uint32_t id, void __user *data)
 {
        struct nameidata nd;
-       struct vcmd_ctx_iattr_v1 vc_data = { .xid = -1 };
+       struct vcmd_ctx_iattr_v1 vc_data;
        int ret;
 
        if (!vx_check(0, VX_ADMIN))
@@ -96,7 +80,7 @@ int vc_get_iattr(uint32_t id, void __user *data)
 static int __vc_set_iattr(struct dentry *de, uint32_t *xid, 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;
 
        if (!in || !in->i_sb)
                return -ESRCH;
@@ -104,10 +88,7 @@ static int __vc_set_iattr(struct dentry *de, uint32_t *xid, uint32_t *flags, uin
        is_proc = (in->i_sb->s_magic == PROC_SUPER_MAGIC);
        if ((*mask & IATTR_FLAGS) && !is_proc)
                return -EINVAL;
-
-       has_xid = (in->i_sb->s_flags & MS_TAGXID) ||
-               (in->i_sb->s_magic == DEVPTS_SUPER_MAGIC);
-       if ((*mask & IATTR_XID) && !has_xid)
+       if ((*mask & IATTR_XID) && !(in->i_sb->s_flags & MS_TAGXID))
                return -EINVAL;
 
        down(&in->i_sem);
@@ -222,6 +203,7 @@ int vc_iattr_ioctl(struct dentry *de, unsigned int cmd, unsigned long arg)
 
 
 #ifdef CONFIG_VSERVER_LEGACY
+#include <linux/proc_fs.h>
 
 #define PROC_DYNAMIC_FIRST 0xF0000000UL
 
@@ -270,69 +252,3 @@ int vx_proc_ioctl(struct inode * inode, struct file * filp,
 }
 #endif
 
-
-int vx_parse_xid(char *string, xid_t *xid, int remove)
-{
-       static match_table_t tokens = {
-               {1, "xid=%u"},
-               {0, NULL}
-       };
-       substring_t args[MAX_OPT_ARGS];
-       int token, option = 0;
-
-       if (!string)
-               return 0;
-
-       token = match_token(string, tokens, args);
-       if (token && xid && !match_int(args, &option))
-               *xid = option;
-
-       vxdprintk(VXD_CBIT(xid, 7),
-               "vx_parse_xid(»%s«): %d:#%d",
-               string, token, option);
-
-       if (token && remove) {
-               char *p = strstr(string, "xid=");
-               char *q = p;
-
-               if (p) {
-                       while (*q != '\0' && *q != ',')
-                               q++;
-                       while (*q)
-                               *p++ = *q++;
-                       while (*p)
-                               *p++ = '\0';
-               }
-       }
-       return token;
-}
-
-void vx_propagate_xid(struct nameidata *nd, struct inode *inode)
-{
-       xid_t new_xid = 0;
-       struct vfsmount *mnt;
-       int propagate;
-
-       if (!nd)
-               return;
-       mnt = nd->mnt;
-       if (!mnt)
-               return;
-
-       propagate = (mnt->mnt_flags & MNT_XID);
-       if (propagate)
-               new_xid = mnt->mnt_xid;
-
-       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);
-
-       if (propagate)
-               inode->i_xid = new_xid;
-}
-
-#include <linux/module.h>
-
-EXPORT_SYMBOL_GPL(vx_propagate_xid);
-